aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/aarch64
AgeCommit message (Collapse)Author
2025-11-20update deprecated ArrayListUnmanaged usage (#25958)Benjamin Jurk
2025-11-20Merge pull request #25898 from jacobly0/elfv2-progressAndrew Kelley
Elf2: more progress
2025-11-15Legalize: implement soft-float legalizationsMatthew Lugg
A new `Legalize.Feature` tag is introduced for each float bit width (16/32/64/80/128). When e.g. `soft_f16` is enabled, all arithmetic and comparison operations on `f16` are converted to calls to the appropriate compiler_rt function using the new AIR tag `.legalize_compiler_rt_call`. This includes casts where the source *or* target type is `f16`, or integer<=>float conversions to or from `f16`. Occasionally, operations are legalized to blocks because there is extra code required; for instance, legalizing `@floatFromInt` where the integer type is larger than 64 bits requires calling an arbitrary-width integer conversion function which accepts a pointer to the integer, so we need to use `alloc` to create such a pointer, and store the integer there (after possibly zero-extending or sign-extending it). No backend currently uses these new legalizations (and as such, no backend currently needs to implement `.legalize_compiler_rt_call`). However, for testing purposes, I tried modifying the self-hosted x86_64 backend to enable all of the soft-float features (and implement the AIR instruction). This modified backend was able to pass all of the behavior tests (except for one `@mod` test where the LLVM backend has a bug resulting in incorrect compiler-rt behavior!), including the tests specific to the self-hosted x86_64 backend. `f16` and `f80` legalizations are likely of particular interest to backend developers, because most architectures do not have instructions to operate on these types. However, enabling *all* of these legalization passes can be useful when developing a new backend to hit the ground running and pass a good amount of tests more easily.
2025-11-12Air.Legalize: revert to loops for scalarizationsMatthew Lugg
I had tried unrolling the loops to avoid requiring the `vector_store_elem` instruction, but it's arguably a problem to generate O(N) code for an operation on `@Vector(N, T)`. In addition, that lowering emitted a lot of `.aggregate_init` instructions, which is itself a quite difficult operation to codegen. This requires reintroducing runtime vector indexing internally. However, I've put it in a couple of instructions which are intended only for use by `Air.Legalize`, named `legalize_vec_elem_val` (like `array_elem_val`, but for indexing a vector with a runtime-known index) and `legalize_vec_store_elem` (like the old `vector_store_elem` instruction). These are explicitly documented as *not* being emitted by Sema, so need only be implemented by backends if they actually use an `Air.Legalize.Feature` which emits them (otherwise they can be marked as `unreachable`).
2025-11-12compiler: spring cleaningMatthew Lugg
I started this diff trying to remove a little dead code from the C backend, but ended up finding a bunch of dead code sprinkled all over the place: * `packed` handling in the C backend which was made dead by `Legalize` * Representation of pointers to runtime-known vector indices * Handling for the `vector_store_elem` AIR instruction (now removed) * Old tuple handling from when they used the InternPool repr of structs * Straightforward unused functions * TODOs in the LLVM backend for features which Zig just does not support
2025-11-11aarch64: cleanup register lockJacob Young
2025-10-30aarch64: fix macho external referencesJacob Young
2025-10-30aarch64: implement optional comparisonsJacob Young
2025-10-30std.debug.lockStderrWriter: also return ttyconfMatthew Lugg
`std.Io.tty.Config.detect` may be an expensive check (e.g. involving syscalls), and doing it every time we need to print isn't really necessary; under normal usage, we can compute the value once and cache it for the whole program's execution. Since anyone outputting to stderr may reasonably want this information (in fact they are very likely to), it makes sense to cache it and return it from `lockStderrWriter`. Call sites who do not need it will experience no significant overhead, and can just ignore the TTY config with a `const w, _` destructure.
2025-10-02Coff: deleteJacob Young
2025-09-21Elf2: create a new linker from scratchJacob Young
This iteration already has significantly better incremental support. Closes #24110
2025-09-21aarch64/zonCast: don't return a pointer to a stack elementFrank Denis
Elements are computed at comptime, so don't declare them as "var".
2025-09-20aarch64: fix behavior failuresJacob Young
2025-09-20aarch64: implement `ptr_slice_*_ptr`Jacob Young
2025-08-15aarch64: more assembler instructionsJacob Young
Closes #24848
2025-08-11aarch64: implement more assembler instructionsJacob Young
2025-08-01remove usages of `.alignment = 0`David Rubin
2025-07-28aarch64: implement scalar `@mod`Jacob Young
2025-07-28aarch64: workaround some optional/union issuesJacob Young
2025-07-27aarch64: fix error union constantsJacob Young
2025-07-27aarch64: implement var argsJacob Young
2025-07-26aarch64: implement more optional/error union/union supportJacob Young
2025-07-26aarch64: implement some safety checksJacob Young
Closes #24553
2025-07-26aarch64: implement stack probingJacob Young
2025-07-26aarch64: implement complex switch prongsJacob Young
2025-07-25aarch64: more progressJacob Young
- factor out `loadReg` - support all general system control registers in inline asm - fix asserts after iterating field offsets - fix typo in `slice_elem_val` - fix translation of argument locations
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-07-02compiler: delete aarch64 backendAndrew Kelley
this backend was abandoned before it was completed, and it is not worth salvaging.