-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace std.builtin.CallingConvention
with a tagged union, eliminating @setAlignStack
#21697
base: master
Are you sure you want to change the base?
Commits on Oct 17, 2024
-
compiler: introduce new
CallingConvention
This commit begins implementing accepted proposal ziglang#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 ziglang#21209 is to remove `@setAlignStack`, which will be implemented in another commit after updating `zig1.wasm`.
Configuration menu - View commit details
-
Copy full SHA for 4fe966d - Browse repository at this point
Copy the full SHA 4fe966dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 28aafa6 - Browse repository at this point
Copy the full SHA 28aafa6View commit details -
std: update for new
CallingConvention
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.
Configuration menu - View commit details
-
Copy full SHA for 0f66ec6 - Browse repository at this point
Copy the full SHA 0f66ec6View commit details -
compiler: remove @setAlignStack
This commit finishes implementing ziglang#21209 by removing the `@setAlignStack` builtin in favour of `CallingConvention` payloads. The x86_64 backend is updated to use the stack alignment given in the calling convention (the LLVM backend was already updated in a previous commit). Resolves: ziglang#21209
Configuration menu - View commit details
-
Copy full SHA for b442da2 - Browse repository at this point
Copy the full SHA b442da2View commit details -
test: update for
CallingConvention
changesThis also includes some compiler and std changes to correct error messages which weren't properly updated before.
Configuration menu - View commit details
-
Copy full SHA for 99be949 - Browse repository at this point
Copy the full SHA 99be949View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f5889e - Browse repository at this point
Copy the full SHA 0f5889eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca07f24 - Browse repository at this point
Copy the full SHA ca07f24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8dabad6 - Browse repository at this point
Copy the full SHA 8dabad6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0baf775 - Browse repository at this point
Copy the full SHA 0baf775View commit details -
std.builtin.CallingConvention: RISC-V
PrivilegeLevel
-> `PrivilegeM……ode` The RISC-V specification uses these terms a little interchangably, but "mode" seems more correct here.
Configuration menu - View commit details
-
Copy full SHA for 8339934 - Browse repository at this point
Copy the full SHA 8339934View commit details -
cbe,translate-c: support more callconvs
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.
Configuration menu - View commit details
-
Copy full SHA for b0b30d0 - Browse repository at this point
Copy the full SHA b0b30d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 15d3025 - Browse repository at this point
Copy the full SHA 15d3025View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67c53d3 - Browse repository at this point
Copy the full SHA 67c53d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for e92b416 - Browse repository at this point
Copy the full SHA e92b416View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8152020 - Browse repository at this point
Copy the full SHA 8152020View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f644cb - Browse repository at this point
Copy the full SHA 9f644cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for a73781e - Browse repository at this point
Copy the full SHA a73781eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0292fe0 - Browse repository at this point
Copy the full SHA 0292fe0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 42eafbc - Browse repository at this point
Copy the full SHA 42eafbcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 766290a - Browse repository at this point
Copy the full SHA 766290aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4994d47 - Browse repository at this point
Copy the full SHA 4994d47View commit details -
Configuration menu - View commit details
-
Copy full SHA for e36d270 - Browse repository at this point
Copy the full SHA e36d270View commit details -
Configuration menu - View commit details
-
Copy full SHA for b2dfb69 - Browse repository at this point
Copy the full SHA b2dfb69View commit details -
compiler_rt: remove bogus tests
These only worked before because our lowering of the `AAPCS` calling convention was incorrect in a way which happened to match the ABI of these functions. The tests aren't actually very helpful -- there are already tests for `divmoddi4` etc -- so rather than using inline asm on the caller side to match the ABI, we just delete these two tests.
Configuration menu - View commit details
-
Copy full SHA for f819f7a - Browse repository at this point
Copy the full SHA f819f7aView commit details -
x86_64,riscv64: fix incorrect
incoming_stack_alignment
handlingThe whole motivation behind this proposal in the first place was that the LLVM backend disagrees with the self-hosted backends on what `@setAlignStack` meant, so we can't just translate the old logic to the new system! These backends can introduce support for overriding `incoming_stack_alignment` later on.
Configuration menu - View commit details
-
Copy full SHA for 49ddffe - Browse repository at this point
Copy the full SHA 49ddffeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 39dd828 - Browse repository at this point
Copy the full SHA 39dd828View commit details -
Configuration menu - View commit details
-
Copy full SHA for b77fe59 - Browse repository at this point
Copy the full SHA b77fe59View commit details