Commit b1925a9
committed
Fix Hexagon ABI calling convention for aggregates
Correct the handling of aggregate types in extern "C" functions to match
the Hexagon ABI specification:
- Aggregates up to 32 bits: passed/returned in a single register (R0)
- Aggregates 33-64 bits: passed/returned in a register pair (R1:R0)
- Aggregates > 64 bits: passed on stack via byval, returned via sret
This fixes all tests/ui/abi/extern/ tests for Hexagon, including:
- extern-pass-TwoU8s, extern-pass-TwoU16s, extern-pass-TwoU32s
- extern-pass-TwoU64s, extern-pass-FiveU16s
- extern-return-TwoU8s, extern-return-TwoU16s, extern-return-TwoU32s
- extern-return-TwoU64s, extern-return-FiveU16s1 parent f1d5fde commit b1925a9
1 file changed
Lines changed: 21 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | | - | |
25 | 31 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
0 commit comments