Commit 9a81ba4
committed
Clarify how struct pass in register
`first half` is incorrect description if the struct size is less than 2 x XLEN
bits, for example a 48 byte struct passed in register pair for RV32, first
32-bits will hold in first register and the remaining 16-bits will hold
in second register, but `first half` means 24 bits in first register and
next 24 bits in next register, that is not we implement on both LLVM and
GCC.
Example code for demonstrate that:
```
struct X {
short x;
int y;
} __attribute__ ((packed));
int foo(int a0, int a1, int a2, int a3, int a4, int a5, int a6, struct X a7)
{
return a7.y;
}
int bar(struct X a7)
{
return a7.y;
}
```
Address review comment come from LLVM community[1].
[1] https://lists.llvm.org/pipermail/llvm-dev/2022-January/154600.html1 parent faf9a9d commit 9a81ba4
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
0 commit comments