aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
AgeCommit message (Collapse)Author
2024-10-19llvn: fix incorrect mips64 callconv handlingmlugg
2024-10-19llvm: fix lowering of avr_interrupt and m68k_interrupt callconvsmlugg
2024-10-19cbe,translate-c: support more callconvsmlugg
There are several more that we could support here, but I didn't feel like going down the rabbit-hole of figuring them out. In particular, some of the Clang enum fields aren't specific enough for us, so we'll have to switch on the target to figure out how to translate-c them. That can be a future enhancement.
2024-10-19std.Target: rename `defaultCCallingConvention` and `Cpu.Arch.fromCallconv`mlugg
2024-10-19std: update for new `CallingConvention`mlugg
The old `CallingConvention` type is replaced with the new `NewCallingConvention`. References to `NewCallingConvention` in the compiler are updated accordingly. In addition, a few parts of the standard library are updated to use the new type correctly.
2024-10-19compiler: introduce new `CallingConvention`mlugg
This commit begins implementing accepted proposal #21209 by making `std.builtin.CallingConvention` a tagged union. The stage1 dance here is a little convoluted. This commit introduces the new type as `NewCallingConvention`, keeping the old `CallingConvention` around. The compiler uses `std.builtin.NewCallingConvention` exclusively, but when fetching the type from `std` when running the compiler (e.g. with `getBuiltinType`), the name `CallingConvention` is used. This allows a prior build of Zig to be used to build this commit. The next commit will update `zig1.wasm`, and then the compiler and standard library can be updated to completely replace `CallingConvention` with `NewCallingConvention`. The second half of #21209 is to remove `@setAlignStack`, which will be implemented in another commit after updating `zig1.wasm`.
2024-10-17Merge pull request #21610 from alexrp/riscv-abisAndrew Kelley
Fix some RISC-V ABI issues and add ILP32/LP64 (soft float) to module tests
2024-10-16llvm: Disable f16 lowering for loongarch.Alex Rønne Petersen
This should be reverted with LLVM 20.
2024-10-16llvm: Fix natural int width specifications for loongarch in DataLayoutBuilder.Alex Rønne Petersen
2024-10-15llvm: Enable native f16 lowering for riscv32.Alex Rønne Petersen
2024-10-15llvm: Fix compiler crash when lowering f16 for riscv32 ilp32.Alex Rønne Petersen
2024-10-13Merge pull request #21688 from Snektron/spirv-fixRobin Voetter
spirv: fix some bitrot
2024-10-12implement packed struct equality (#21679)David Rubin
2024-10-13spirv: don't generate OpUnreachable after noreturn callRobin Voetter
It seems that these are now automatically added to AIR in Sema.
2024-10-13spirv: implement repeat and dbg_arg_inlineRobin Voetter
2024-10-13spirv: don't try to lower types which have no runtime bitsRobin Voetter
2024-10-06Merge pull request #21605 from alexrp/ohos-stuffAlex Rønne Petersen
`std.Target`: Introduce `Abi.ohoseabi` to distinguish the soft float case.
2024-10-06Merge pull request #21587 from alexrp/hexagon-portingAlex Rønne Petersen
Some initial `hexagon-linux` port work
2024-10-05std.Target: Introduce Abi.ohoseabi to distinguish the soft float case.Alex Rønne Petersen
For the same reason as #21504.
2024-10-05Merge pull request #21574 from alexrp/llvm-sub-archAlex Rønne Petersen
`llvm`: Implement sub-architecture translation in `targetTriple()`.
2024-10-04remove `@fence` (#21585)David Rubin
closes #11650
2024-10-04Adds new cpu architectures propeller1 and propeller2. (#21563)Felix Queißner
* Adds new cpu architectures propeller1 and propeller2. These cpu architectures allow targeting the Parallax Propeller 1 and Propeller 2, which are both very special microcontrollers with 512 registers and 8 cpu cores. Resolves #21559 * Adds std.elf.EM.PROPELLER and std.elf.EM.PROPELLER2 * Fixes missing switch prongs in src/codegen/llvm.zig * Fixes order in std.Target.Arch --------- Co-authored-by: Felix "xq" Queißner <git@random-projects.net>
2024-10-04Merge pull request #21572 from alexrp/tests-llvm-targetsAlex Rønne Petersen
`test`: Rewrite the target triple list for `llvm_targets`.
2024-10-03llvm: Disable f16 lowering for hexagon.Alex Rønne Petersen
In theory, this should work for v68+. In practice, it runs into an LLVM assertion when using a `freeze` instruction on `f16` values, similar to the issue we had for LoongArch.
2024-10-03llvm: Fix C ABI integer promotion for s390x.Alex Rønne Petersen
2024-10-03std.Target: Remove Os.Tag.shadermodel.Alex Rønne Petersen
This was a leftover from the Cpu.Arch.dxil removal.
2024-10-03llvm: Implement sub-architecture translation in targetTriple().Alex Rønne Petersen
2024-10-03Merge pull request #21504 from alexrp/android-softfpAlex Rønne Petersen
`std.Target`: Introduce `Abi.androideabi` to distinguish the soft float case.
2024-09-26fixes and make sema report errors when std.builtin wrongAndrew Kelley
instead of panicking
2024-09-26reimplement integer overflow safety panic function callsAndrew Kelley
in the llvm backend.
2024-09-26fixes for this branchAndrew Kelley
I had to bring back some of the old API so that I could compile the new compiler with an old compiler.
2024-09-24std.Target: Introduce Abi.androideabi to distinguish the soft float case.Alex Rønne Petersen
Abi.android on its own is not enough to know whether soft float or hard float should be used. In the C world, androideabi is typically used for the soft float case, so let's go with that. Note that Android doesn't have a hard float ABI, so no androideabihf. Closes #21488.
2024-09-23std.Target: Remove Cpu.Arch.dxil and ObjectFormat.dxcontainer.Alex Rønne Petersen
See: https://devblogs.microsoft.com/directx/directx-adopting-spir-v Since we never hooked up the (experimental) DirectX LLVM backend, we've never actually supported targeting DXIL in Zig. With Microsoft moving away from DXIL, that seems very unlikely to change.
2024-09-19Partially revert "LLVM: work around `@floatFromInt` bug"Alex Rønne Petersen
This partially reverts commit ab4d6bf468bd8cba4ffd2d700d83e9707f5307b1.
2024-09-19std.Target: Add bridgeos tag to Os.Alex Rønne Petersen
2024-09-19llvm: Stop emitting shl/xor ops for constant packed structs.Alex Rønne Petersen
This is no longer supported in LLVM 19; fall back to the generic code path.
2024-09-19zig_llvm: Update to LLVM 19.Alex Rønne Petersen
2024-09-12Replace deprecated default initializations with decl literalsLinus Groh
2024-09-11Merge pull request #21269 from alexrp/soft-floatAndrew Kelley
Fix soft float support, split musl triples by float ABI, and enable CI
2024-09-10llvm: Don't use the optimized jump table construction logic for wasm.Alex Rønne Petersen
2024-09-10llvm: Limit f16/f128 lowering on arm to fp_armv8 and soft float.Alex Rønne Petersen
2024-09-10llvm: Set use-soft-float and noimplicitfloat on functions for soft float.Alex Rønne Petersen
Closes #10961.
2024-09-07mips: fix C ABI compatibilityMaciej 'vesim' Kuliński
2024-09-06Merge pull request #21261 from alexrp/riscv32Andrew Kelley
More `riscv32-linux` port work
2024-09-06llvm: Set float ABI based on std.Target.floatAbi().Alex Rønne Petersen
2024-09-06llvm: Don't lower to f16 for riscv32.Alex Rønne Petersen
This causes so many test failures that I doubt this has been tested at all.
2024-09-04Merge pull request #21257 from mlugg/computed-goto-3Andrew Kelley
compiler: implement labeled switch/continue
2024-09-01cbe: don't emit 'x = x' in switch dispatch loopmlugg
2024-09-01compiler: implement labeled switch/continuemlugg
2024-09-01Air: add explicit `repeat` instruction to repeat loopsmlugg
This commit introduces a new AIR instruction, `repeat`, which causes control flow to move back to the start of a given AIR loop. `loop` instructions will no longer automatically perform this operation after control flow reaches the end of the body. The motivation for making this change now was really just consistency with the upcoming implementation of #8220: it wouldn't make sense to have this feature work significantly differently. However, there were already some TODOs kicking around which wanted this feature. It's useful for two key reasons: * It allows loops over AIR instruction bodies to loop precisely until they reach a `noreturn` instruction. This allows for tail calling a few things, and avoiding a range check on each iteration of a hot path, plus gives a nice assertion that validates AIR structure a little. This is a very minor benefit, which this commit does apply to the LLVM and C backends. * It should allow for more compact ZIR and AIR to be emitted by having AstGen emit `repeat` instructions more often rather than having `continue` statements `break` to a `block` which is *followed* by a `repeat`. This is done in status quo because `repeat` instructions only ever cause the direct parent block to repeat. Now that AIR is more flexible, this flexibility can be pretty trivially extended to ZIR, and we can then emit better ZIR. This commit does not implement this. Support for this feature is currently regressed on all self-hosted native backends, including x86_64. This support will be added where necessary before this branch is merged.