-
-
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
Commits on Oct 19, 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 51706af - Browse repository at this point
Copy the full SHA 51706afView commit details -
As well as being necessary for the `CallingConvention` changes, this update includes the following notable changes: * Fix unlabeled `break` targeting the wrong scope in the presence of labeled continue, unblocking ziglang#21422 * Implement `@FieldType` * Implement `@splat` on arrays Signed-off-by: mlugg <mlugg@mlugg.co.uk>
Configuration menu - View commit details
-
Copy full SHA for 36405b9 - Browse repository at this point
Copy the full SHA 36405b9View 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 bc797a9 - Browse repository at this point
Copy the full SHA bc797a9View 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 ec19086 - Browse repository at this point
Copy the full SHA ec19086View 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 4be0cf3 - Browse repository at this point
Copy the full SHA 4be0cf3View commit details -
Configuration menu - View commit details
-
Copy full SHA for cbfe00b - Browse repository at this point
Copy the full SHA cbfe00bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d9a167 - Browse repository at this point
Copy the full SHA 2d9a167View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6657982 - Browse repository at this point
Copy the full SHA 6657982View commit details -
Configuration menu - View commit details
-
Copy full SHA for a2c519b - Browse repository at this point
Copy the full SHA a2c519bView 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 67580ed - Browse repository at this point
Copy the full SHA 67580edView 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 cb48376 - Browse repository at this point
Copy the full SHA cb48376View commit details -
Configuration menu - View commit details
-
Copy full SHA for d466c08 - Browse repository at this point
Copy the full SHA d466c08View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2319d62 - Browse repository at this point
Copy the full SHA 2319d62View commit details -
compiler: avoid unreasonable eval branch quotas
Using `@FieldType` (ziglang#21702).
Configuration menu - View commit details
-
Copy full SHA for 0b78605 - Browse repository at this point
Copy the full SHA 0b78605View commit details -
Configuration menu - View commit details
-
Copy full SHA for ed862b0 - Browse repository at this point
Copy the full SHA ed862b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f11eed - Browse repository at this point
Copy the full SHA 1f11eedView commit details -
Configuration menu - View commit details
-
Copy full SHA for bde68fd - Browse repository at this point
Copy the full SHA bde68fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d1e8e1 - Browse repository at this point
Copy the full SHA 1d1e8e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ef8bb6 - Browse repository at this point
Copy the full SHA 3ef8bb6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8302301 - Browse repository at this point
Copy the full SHA 8302301View commit details -
Configuration menu - View commit details
-
Copy full SHA for 04ffc1c - Browse repository at this point
Copy the full SHA 04ffc1cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 28cb887 - Browse repository at this point
Copy the full SHA 28cb887View commit details -
Configuration menu - View commit details
-
Copy full SHA for 289b2f8 - Browse repository at this point
Copy the full SHA 289b2f8View 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. We were for some reason missing a direct test for `__udivmodsi4`, so one has been added.
Configuration menu - View commit details
-
Copy full SHA for cf39652 - Browse repository at this point
Copy the full SHA cf39652View 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 387965a - Browse repository at this point
Copy the full SHA 387965aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 73f4c68 - Browse repository at this point
Copy the full SHA 73f4c68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d5ac6b - Browse repository at this point
Copy the full SHA 8d5ac6bView commit details -
Looks like the self-hosted riscv64 backend can't handle `std.meta.eql` involving the new `CallingConvention` right now.
Configuration menu - View commit details
-
Copy full SHA for f7d679c - Browse repository at this point
Copy the full SHA f7d679cView commit details