authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-15 21:52:08+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-15 21:52:08+02:00
logbd4421befee2157018dad88b31b684f9a5af73c2
tree132825be35dd39042feea81e53ede3d5c7891a09
parent5bc1dc59e693287e1ffcd14023048b2abc7e1764

compiler-rt: Don't pass f16 around as arguments

Fixes some failures on AArch64. f16 was a mistake.

1 files changed, 15 insertions(+), 15 deletions(-)

lib/std/special/compiler_rt/extendXfYf2_test.zig+15-15
......@@ -163,8 +163,8 @@ fn makeInf32() f32 {
163163 return @bitCast(f32, @as(u32, 0x7f800000));
164164}
165165
166fn test__extendhftf2(a: f16, expectedHi: u64, expectedLo: u64) void {
167 const x = __extendhftf2(@bitCast(u16, a));
166fn test__extendhftf2(a: u16, expectedHi: u64, expectedLo: u64) void {
167 const x = __extendhftf2(a);
168168
169169 const rep = @bitCast(u128, x);
170170 const hi = @intCast(u64, rep >> 64);
......@@ -187,24 +187,24 @@ fn test__extendhftf2(a: f16, expectedHi: u64, expectedLo: u64) void {
187187
188188test "extendhftf2" {
189189 // qNaN
190 test__extendhftf2(@bitCast(f16, @as(u16, 0x7e00)), 0x7fff800000000000, 0x0);
190 test__extendhftf2(0x7e00, 0x7fff800000000000, 0x0);
191191 // NaN
192 test__extendhftf2(@bitCast(f16, @as(u16, 0x7d00)), 0x7fff400000000000, 0x0);
192 test__extendhftf2(0x7d00, 0x7fff400000000000, 0x0);
193193 // inf
194 test__extendhftf2(@bitCast(f16, @as(u16, 0x7c00)), 0x7fff000000000000, 0x0);
195 test__extendhftf2(-@bitCast(f16, @as(u16, 0x7c00)), 0xffff000000000000, 0x0);
194 test__extendhftf2(0x7c00, 0x7fff000000000000, 0x0);
195 test__extendhftf2(0xfc00, 0xffff000000000000, 0x0);
196196 // zero
197 test__extendhftf2(@bitCast(f16, @as(u16, 0x0)), 0x0, 0x0);
198 test__extendhftf2(@bitCast(f16, @as(u16, 0x8000)), 0x8000000000000000, 0x0);
197 test__extendhftf2(0x0000, 0x0000000000000000, 0x0);
198 test__extendhftf2(0x8000, 0x8000000000000000, 0x0);
199199 // denormal
200 test__extendhftf2(@bitCast(f16, @as(u16, 0x0010)), 0x3feb000000000000, 0x0000000000000000);
201 test__extendhftf2(@bitCast(f16, @as(u16, 0x0001)), 0x3fe7000000000000, 0x0000000000000000);
202 test__extendhftf2(@bitCast(f16, @as(u16, 0x8001)), 0xbfe7000000000000, 0x0000000000000000);
200 test__extendhftf2(0x0010, 0x3feb000000000000, 0x0);
201 test__extendhftf2(0x0001, 0x3fe7000000000000, 0x0);
202 test__extendhftf2(0x8001, 0xbfe7000000000000, 0x0);
203203
204204 // pi
205 test__extendhftf2(@bitCast(f16, @as(u16, 0x4248)), 0x4000920000000000, 0x0000000000000000);
206 test__extendhftf2(@bitCast(f16, @as(u16, 0xc248)), 0xc000920000000000, 0x0000000000000000);
205 test__extendhftf2(0x4248, 0x4000920000000000, 0x0);
206 test__extendhftf2(0xc248, 0xc000920000000000, 0x0);
207207
208 test__extendhftf2(@bitCast(f16, @as(u16, 0x508c)), 0x4004230000000000, 0x0);
209 test__extendhftf2(@bitCast(f16, @as(u16, 0x1bb7)), 0x3ff6edc000000000, 0x0);
208 test__extendhftf2(0x508c, 0x4004230000000000, 0x0);
209 test__extendhftf2(0x1bb7, 0x3ff6edc000000000, 0x0);
210210}