Commit Graph

10 Commits

Author SHA1 Message Date
Jordan 65fc564c16 Added missing <algorithm> header to fix compiler error. (#4396)
When compiling today, I had this error on Arch Linux x86-64 due to the
missing <algorithm> header.
<img width="1952" height="1079" alt="Screenshot from 2026-08-27
22-53-33"
src="https://github.com/user-attachments/assets/c0101a23-ac2a-40a5-a1b9-b1e926e600a7"
/>

Adding the header fixes it.

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2026-08-31 22:52:59 -04:00
Parker de25f39439 arm64: Apple Silicon support (#4390)
Got OpenGOAL building and running natively on Apple Silicon.

This is the rest of the port after the smaller arm64 emitter PRs. I was
told pushing one big PR was okay. This covers goalc, the runtime,
linker, kernel and the GOAL asm.

The new paths have native tests. I also found four more emitter bugs
while running it. They're in scalar sqrt, 128-bit stores, scalar max and
indexed stores above 4 GB.

Spent a while cleaning it up so it's easier to read. 4am gotta sleep lol

Closes #3841

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2026-08-24 23:22:47 -04:00
Parker b59a6d1cf3 goalc: arm64 vector loads and stores with a register offset were wrong (#4386)
Some neon tests, plus the fix they needed to run at all.

`ldr q` and `str q` with a register offset had a bad option field so
they don't
decode. The s8 load was ignoring addr2 and reading from the base on its
own. A
few used post indexed forms, which move the address register.

Rest of the avx list to come.
2026-08-22 17:00:13 -04:00
Parker 8c926caa23 goalc: arm64 SIMD encoders emitted the wrong instructions (#4385)
Alters the opcode constants and the lane index maths, so the pext,
vector shift, shuffle, blend and splat helpers now emit the correct
ZIP1/ZIP2, SHL/SSHR/USHR, INS and DUP machine encodings for 128-bit
vector operations.

Adds an Imm5 field helper, which the lane-insert and duplicate encodings
need.

Follows #4384, from the same Apple Silicon work.
2026-08-22 16:34:00 -04:00
Parker 9e5ecef614 goalc: arm64 vector float ops were not float ops (#4384)
Alters the opcode constants in Base, so these helpers now emit the
correct FADD/FMAX/FMIN machine encodings for 4×f32 vector operations.

Found these while getting OpenGOAL running natively on Apple Silicon.
2026-08-21 18:39:37 -04:00
Tyler Wilding bfc4c18ada goalc: replicate tests for the majority of ARM64 non-simd cases (#4377)
- Adds `capstone` as a disassembling library that could eventually
replace Zydis (for now left that alone)
- Replicates all of the existing x86 tests to ARM64, fixed a bunch of
underlying issues along the way
- There are a very small handful of tests remaining that need to be
enabled / fixed
2026-08-16 15:34:37 -04:00
iHR4K d8710bb2f6 goalc: fix compilation error in arm64 code (#4337)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2026-07-06 22:52:31 -04:00
Tyler Wilding 76941379e9 goalc: Finish converting all load/store instructions to ARM64 (#4334)
All that remains (8 instructions) are division, and NEON instructions
that require me to convert the x86 control byte to NEON `TBL` values.
Those handful of instructions can be done later while doing the next
steps (finally something more interesting than just encoding
instructions).
2026-07-03 19:40:29 -04:00
Tyler Wilding 8daf33492e goalc: Implement the bulk of ARM64 instructions from x86 (#4318)
Less than 100 instructions left to implement, with the vast vast
majority being load-and-stores. These will likely be knocked out quickly
but they require a more involved implementation than just simply
translating the instructions (several need multiple instructions, others
may need reserved registers (x16 or x17 are common for this purpose))

This is a good milestone to get something pushed to master.
2026-06-22 22:25:49 -04:00
Tyler Wilding 64bcd8c030 goalc: Get CodeTester tests passing on Arm64 (only targetting macOS atm) (#3290)
This PR does the following:
- Designs a mechanism by which arm64 instructions can be encoded and
emitted
- Dispatch our higher-level instruction emitting calls to either x86 or
arm64 instructions depending on what the compiler is set to (defaults to
x86)
- Bare minimum scaffolding to get the arm64 instructions successfully
executing atleast on apple silicon
- Implement enough instructions to get the codetester test suite passing
on arm
2026-03-30 20:20:47 -04:00