Commit f4a15bf
committed
Update
As seen at [1], LLVM uses `long long` on LLP64 (to get a 64-bit integer
matching pointer size) and `long` on everything else, with exceptions
for AArch64 and AVR. Our current logic always uses an `i32`. This
happens to work because LLVM uses 32-bit instructions to check the
output on x86-64, but the GCC checks the full 64-bit register so garbage
in the upper half leads to incorrect results.
Update our return type to be `isize`, with exceptions for AArch64 and
AVR.
Fixes: #919
[1]: https://github.com/llvm/llvm-project/blob/0cf3c437c18ed27d9663d87804a9a15ff6874af2/compiler-rt/lib/builtins/fp_compare_impl.inc#L11-L27CmpResult to use a pointer-sized return type1 parent 157a0b7 commit f4a15bf
File tree
4 files changed
+48
-26
lines changed- builtins-test
- benches
- src
- compiler-builtins/src/float
- libm/src/math/support
4 files changed
+48
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
10 | 21 | | |
11 | 22 | | |
12 | 23 | | |
13 | 24 | | |
14 | 25 | | |
15 | 26 | | |
16 | 27 | | |
17 | | - | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
24 | | - | |
| 35 | + | |
25 | 36 | | |
26 | 37 | | |
27 | 38 | | |
| |||
36 | 47 | | |
37 | 48 | | |
38 | 49 | | |
39 | | - | |
| 50 | + | |
40 | 51 | | |
41 | 52 | | |
42 | 53 | | |
| |||
53 | 64 | | |
54 | 65 | | |
55 | 66 | | |
56 | | - | |
| 67 | + | |
57 | 68 | | |
58 | 69 | | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
62 | | - | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
74 | 85 | | |
75 | 86 | | |
76 | 87 | | |
77 | | - | |
| 88 | + | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| |||
91 | 102 | | |
92 | 103 | | |
93 | 104 | | |
94 | | - | |
| 105 | + | |
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
101 | | - | |
| 112 | + | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
| |||
113 | 124 | | |
114 | 125 | | |
115 | 126 | | |
116 | | - | |
| 127 | + | |
117 | 128 | | |
118 | 129 | | |
119 | 130 | | |
| |||
130 | 141 | | |
131 | 142 | | |
132 | 143 | | |
133 | | - | |
| 144 | + | |
134 | 145 | | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
139 | | - | |
| 150 | + | |
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
| |||
151 | 162 | | |
152 | 163 | | |
153 | 164 | | |
154 | | - | |
| 165 | + | |
155 | 166 | | |
156 | 167 | | |
157 | 168 | | |
| |||
168 | 179 | | |
169 | 180 | | |
170 | 181 | | |
171 | | - | |
| 182 | + | |
172 | 183 | | |
173 | 184 | | |
174 | 185 | | |
| |||
180 | 191 | | |
181 | 192 | | |
182 | 193 | | |
183 | | - | |
| 194 | + | |
184 | 195 | | |
185 | 196 | | |
186 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
| 361 | + | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
13 | 22 | | |
14 | 23 | | |
15 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
0 commit comments