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 {
1133211332 break :dst dst_mcv;
1133311333 };
1133411334
11335 if (dst_ty.isRuntimeFloat()) break :result dst_mcv;
11336
1133511337 const dst_signedness =
1133611338 if (dst_ty.isAbiInt(mod)) dst_ty.intInfo(mod).signedness else .unsigned;
11337 const src_signedness =
11338 if (src_ty.isAbiInt(mod)) src_ty.intInfo(mod).signedness else .unsigned;
11339 if (dst_signedness == src_signedness) break :result dst_mcv;
11339 if (!src_ty.isRuntimeFloat() or src_ty.floatBits(self.target.*) != 80) {
11340 const src_signedness =
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
1134111345 const abi_size: u16 = @intCast(dst_ty.abiSize(mod));
1134211346 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" {
12941294 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
12951295 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
12961296 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
12991299 try testNeg(f80);
13001300 try comptime testNeg(f80);