authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-07 21:06:25-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-08 04:41:55-04:00
log24d76500d2d0220d313b5f79c880855b776d61c2
tree9702f0e4a1ef18fffed7fcedd077861010729542
parent24c67992e00b0043ab9409d58ffcecb2f689ee6f

x86_64: fix bitcast from `f80`


2 files changed, 8 insertions(+), 4 deletions(-)

src/arch/x86_64/CodeGen.zig+7-3
...@@ -11332,11 +11332,15 @@ fn airBitCast(self: *Self, inst: Air.Inst.Index) !void {...@@ -11332,11 +11332,15 @@ fn airBitCast(self: *Self, inst: Air.Inst.Index) !void {
11332 break :dst dst_mcv;11332 break :dst dst_mcv;
11333 };11333 };
1133411334
11335 if (dst_ty.isRuntimeFloat()) break :result dst_mcv;
11336
11335 const dst_signedness =11337 const dst_signedness =
11336 if (dst_ty.isAbiInt(mod)) dst_ty.intInfo(mod).signedness else .unsigned;11338 if (dst_ty.isAbiInt(mod)) dst_ty.intInfo(mod).signedness else .unsigned;
11337 const src_signedness =11339 if (!src_ty.isRuntimeFloat() or src_ty.floatBits(self.target.*) != 80) {
11338 if (src_ty.isAbiInt(mod)) src_ty.intInfo(mod).signedness else .unsigned;11340 const src_signedness =
11339 if (dst_signedness == src_signedness) break :result dst_mcv;11341 if (src_ty.isAbiInt(mod)) src_ty.intInfo(mod).signedness else .unsigned;
11342 if (dst_signedness == src_signedness) break :result dst_mcv;
11343 }
1134011344
11341 const abi_size: u16 = @intCast(dst_ty.abiSize(mod));11345 const abi_size: u16 = @intCast(dst_ty.abiSize(mod));
11342 const bit_size: u16 = @intCast(dst_ty.bitSize(mod));11346 const bit_size: u16 = @intCast(dst_ty.bitSize(mod));
test/behavior/floatop.zig+1-1
...@@ -1294,7 +1294,7 @@ test "neg f80/f128/c_longdouble" {...@@ -1294,7 +1294,7 @@ test "neg f80/f128/c_longdouble" {
1294 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1294 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1295 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;1295 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1296 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;1296 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
1297 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;1297 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf) return error.SkipZigTest;
12981298
1299 try testNeg(f80);1299 try testNeg(f80);
1300 try comptime testNeg(f80);1300 try comptime testNeg(f80);