| author | |
| committer | |
| log | 387965a696e567357ca4729b41951e51592ef821 |
| tree | d117dce4fcec67fef2adb58ff9341ee708ebb060 |
| parent | cf39652500df07d33470d89ba96a97463beff986 |
| signature |
The 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.3 files changed, 4 insertions(+), 9 deletions(-)
src/Zcu.zig+2-1| ... | ... | @@ -3607,7 +3607,8 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu |
| 3607 | 3607 | else => false, |
| 3608 | 3608 | }, |
| 3609 | 3609 | .stage2_x86_64 => switch (cc) { |
| 3610 | .x86_64_sysv, .x86_64_win, .naked => true, // stack alignment supported | |
| 3610 | .x86_64_sysv, .x86_64_win => |opts| opts.incoming_stack_alignment == null, | |
| 3611 | .naked => true, | |
| 3611 | 3612 | else => false, |
| 3612 | 3613 | }, |
| 3613 | 3614 | .stage2_aarch64 => switch (cc) { |
src/arch/riscv64/CodeGen.zig+1-4| ... | ... | @@ -820,10 +820,7 @@ pub fn generate( |
| 820 | 820 | try function.frame_allocs.resize(gpa, FrameIndex.named_count); |
| 821 | 821 | function.frame_allocs.set( |
| 822 | 822 | @intFromEnum(FrameIndex.stack_frame), |
| 823 | FrameAlloc.init(.{ | |
| 824 | .size = 0, | |
| 825 | .alignment = .fromByteUnits(target_util.stackAlignment(function.target.*, fn_type.fnCallingConvention(zcu))), | |
| 826 | }), | |
| 823 | FrameAlloc.init(.{ .size = 0, .alignment = .@"1" }), | |
| 827 | 824 | ); |
| 828 | 825 | function.frame_allocs.set( |
| 829 | 826 | @intFromEnum(FrameIndex.call_frame), |
src/arch/x86_64/CodeGen.zig+1-4| ... | ... | @@ -871,10 +871,7 @@ pub fn generate( |
| 871 | 871 | try function.frame_allocs.resize(gpa, FrameIndex.named_count); |
| 872 | 872 | function.frame_allocs.set( |
| 873 | 873 | @intFromEnum(FrameIndex.stack_frame), |
| 874 | FrameAlloc.init(.{ | |
| 875 | .size = 0, | |
| 876 | .alignment = .fromByteUnits(target_util.stackAlignment(function.target.*, fn_type.fnCallingConvention(zcu))), | |
| 877 | }), | |
| 874 | FrameAlloc.init(.{ .size = 0, .alignment = .@"1" }), | |
| 878 | 875 | ); |
| 879 | 876 | function.frame_allocs.set( |
| 880 | 877 | @intFromEnum(FrameIndex.call_frame), |