Commit 1f07568
Fix FP register encoding and stack alignment in codegen
Summary:
Fix two AArch64 code generation bugs:
1. In generatePrologue, FP argument loading used a64::d(arg.loc) directly, but arg.loc includes the VECD_REG_BASE offset (e.g., 32 for D0). This produced invalid register IDs like d32 instead of d0. Fix by subtracting VECD_REG_BASE, consistent with all other FP register construction in the codebase.
2. In rewriteRegularFunction, the stack argument buffer size was not aligned to kStackAlign (16 bytes). When a regular function call had an odd number of stack-spilled arguments, the unaligned size triggered an assertion failure in generatePrologue on AArch64 where the stack pointer must always be 16-byte aligned. Fix by rounding up the buffer size, consistent with prepareArgsArray which already does this for vectorcall paths.
Reviewed By: kddnewton
Differential Revision: D93875144
fbshipit-source-id: 9454441b7941572f98f318a43ba508803f3188851 parent a3a8ffd commit 1f07568
2 files changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1694 | 1694 | | |
1695 | 1695 | | |
1696 | 1696 | | |
1697 | | - | |
| 1697 | + | |
1698 | 1698 | | |
1699 | 1699 | | |
1700 | 1700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| |||
0 commit comments