authorgravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-07-10 09:53:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-10 20:51:34-07:00
log680419c407bc1216b86511d1f045d0d92066584e
treecf652496a669e3b275c6872d4d77689e42934016
parentf3333a56e8452c16ad30da99f8e4a62a16e58a03

compiler_rt: Update Windows ABI for float<->int conversion routines

Starting with LLVM 14, the Libcalls to these functions are now lowered using a Vec(2, u64) instead of the standard ABI for i128 integers, so our compiler-rt implementation needs to be updated to expose the same ABI on Windows.

21 files changed, 305 insertions(+), 39 deletions(-)

lib/compiler_rt/fixdfti.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixdfti, .{ .name = "__fixdfti", .linkage = common.linkage });
9 const fixdfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixdfti_windows_x86_64;
13 } else __fixdfti;
14
15 @export(fixdfti_fn, .{ .name = "__fixdfti", .linkage = common.linkage });
816}
917
1018pub fn __fixdfti(a: f64) callconv(.C) i128 {
1119 return floatToInt(i128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixdfti_windows_x86_64(a: f64) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(i128, a));
26}
lib/compiler_rt/fixhfti.zig+16-2
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixhfti, .{ .name = "__fixhfti", .linkage = common.linkage });
9 const fixhfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixhfti_windows_x86_64;
13 } else __fixhfti;
14
15 @export(fixhfti_fn, .{ .name = "__fixhfti", .linkage = common.linkage });
816}
917
10fn __fixhfti(a: f16) callconv(.C) i128 {
18pub fn __fixhfti(a: f16) callconv(.C) i128 {
1119 return floatToInt(i128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixhfti_windows_x86_64(a: f16) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(i128, a));
26}
lib/compiler_rt/fixsfti.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixsfti, .{ .name = "__fixsfti", .linkage = common.linkage });
9 const fixsfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixsfti_windows_x86_64;
13 } else __fixsfti;
14
15 @export(fixsfti_fn, .{ .name = "__fixsfti", .linkage = common.linkage });
816}
917
1018pub fn __fixsfti(a: f32) callconv(.C) i128 {
1119 return floatToInt(i128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixsfti_windows_x86_64(a: f32) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(i128, a));
26}
lib/compiler_rt/fixtfti.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixtfti, .{ .name = "__fixtfti", .linkage = common.linkage });
9 const fixtfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixtfti_windows_x86_64;
13 } else __fixtfti;
14
15 @export(fixtfti_fn, .{ .name = "__fixtfti", .linkage = common.linkage });
816}
917
1018pub fn __fixtfti(a: f128) callconv(.C) i128 {
1119 return floatToInt(i128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixtfti_windows_x86_64(a: f128) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(i128, a));
26}
lib/compiler_rt/fixunsdfti.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixunsdfti, .{ .name = "__fixunsdfti", .linkage = common.linkage });
9 const fixunsdfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixunsdfti_windows_x86_64;
13 } else __fixunsdfti;
14
15 @export(fixunsdfti_fn, .{ .name = "__fixunsdfti", .linkage = common.linkage });
816}
917
1018pub fn __fixunsdfti(a: f64) callconv(.C) u128 {
1119 return floatToInt(u128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixunsdfti_windows_x86_64(a: f64) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(u128, a));
26}
lib/compiler_rt/fixunshfti.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixunshfti, .{ .name = "__fixunshfti", .linkage = common.linkage });
9 const fixunshfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixunshfti_windows_x86_64;
13 } else __fixunshfti;
14
15 @export(fixunshfti_fn, .{ .name = "__fixunshfti", .linkage = common.linkage });
816}
917
1018pub fn __fixunshfti(a: f16) callconv(.C) u128 {
1119 return floatToInt(u128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixunshfti_windows_x86_64(a: f16) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(u128, a));
26}
lib/compiler_rt/fixunssfti.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixunssfti, .{ .name = "__fixunssfti", .linkage = common.linkage });
9 const fixunssfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixunssfti_windows_x86_64;
13 } else __fixunssfti;
14
15 @export(fixunssfti_fn, .{ .name = "__fixunssfti", .linkage = common.linkage });
816}
917
1018pub fn __fixunssfti(a: f32) callconv(.C) u128 {
1119 return floatToInt(u128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixunssfti_windows_x86_64(a: f32) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(u128, a));
26}
lib/compiler_rt/fixunstfti.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixunstfti, .{ .name = "__fixunstfti", .linkage = common.linkage });
9 const fixunstfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixunstfti_windows_x86_64;
13 } else __fixunstfti;
14
15 @export(fixunstfti_fn, .{ .name = "__fixunstfti", .linkage = common.linkage });
816}
917
1018pub fn __fixunstfti(a: f128) callconv(.C) u128 {
1119 return floatToInt(u128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixunstfti_windows_x86_64(a: f128) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(u128, a));
26}
lib/compiler_rt/fixunsxfti.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixunsxfti, .{ .name = "__fixunsxfti", .linkage = common.linkage });
9 const fixunsxfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixunsxfti_windows_x86_64;
13 } else __fixunsxfti;
14
15 @export(fixunsxfti_fn, .{ .name = "__fixunsxfti", .linkage = common.linkage });
816}
917
1018pub fn __fixunsxfti(a: f80) callconv(.C) u128 {
1119 return floatToInt(u128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixunsxfti_windows_x86_64(a: f80) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(u128, a));
26}
lib/compiler_rt/fixxfti.zig+16-2
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const floatToInt = @import("./float_to_int.zig").floatToInt;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__fixxfti, .{ .name = "__fixxfti", .linkage = common.linkage });
9 const fixxfti_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __fixxfti_windows_x86_64;
13 } else __fixxfti;
14
15 @export(fixxfti_fn, .{ .name = "__fixxfti", .linkage = common.linkage });
816}
917
10fn __fixxfti(a: f80) callconv(.C) i128 {
18pub fn __fixxfti(a: f80) callconv(.C) i128 {
1119 return floatToInt(i128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __fixxfti_windows_x86_64(a: f80) callconv(.C) v128 {
25 return @bitCast(v128, floatToInt(i128, a));
26}
lib/compiler_rt/floattidf.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floattidf, .{ .name = "__floattidf", .linkage = common.linkage });
9 const floattidf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floattidf_windows_x86_64;
13 } else __floattidf;
14
15 @export(floattidf_fn, .{ .name = "__floattidf", .linkage = common.linkage });
816}
917
1018pub fn __floattidf(a: i128) callconv(.C) f64 {
1119 return intToFloat(f64, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floattidf_windows_x86_64(a: v128) callconv(.C) f64 {
25 return intToFloat(f64, @bitCast(i128, a));
26}
lib/compiler_rt/floattihf.zig+16-2
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floattihf, .{ .name = "__floattihf", .linkage = common.linkage });
9 const floattihf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floattihf_windows_x86_64;
13 } else __floattihf;
14
15 @export(floattihf_fn, .{ .name = "__floattihf", .linkage = common.linkage });
816}
917
10fn __floattihf(a: i128) callconv(.C) f16 {
18pub fn __floattihf(a: i128) callconv(.C) f16 {
1119 return intToFloat(f16, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floattihf_windows_x86_64(a: v128) callconv(.C) f16 {
25 return intToFloat(f16, @bitCast(i128, a));
26}
lib/compiler_rt/floattisf.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floattisf, .{ .name = "__floattisf", .linkage = common.linkage });
9 const floattisf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floattisf_windows_x86_64;
13 } else __floattisf;
14
15 @export(floattisf_fn, .{ .name = "__floattisf", .linkage = common.linkage });
816}
917
1018pub fn __floattisf(a: i128) callconv(.C) f32 {
1119 return intToFloat(f32, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floattisf_windows_x86_64(a: v128) callconv(.C) f32 {
25 return intToFloat(f32, @bitCast(i128, a));
26}
lib/compiler_rt/floattitf.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floattitf, .{ .name = "__floattitf", .linkage = common.linkage });
9 const floattitf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floattitf_windows_x86_64;
13 } else __floattitf;
14
15 @export(floattitf_fn, .{ .name = "__floattitf", .linkage = common.linkage });
816}
917
1018pub fn __floattitf(a: i128) callconv(.C) f128 {
1119 return intToFloat(f128, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floattitf_windows_x86_64(a: v128) callconv(.C) f128 {
25 return intToFloat(f128, @bitCast(i128, a));
26}
lib/compiler_rt/floattixf.zig+16-2
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floattixf, .{ .name = "__floattixf", .linkage = common.linkage });
9 const floattixf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floattixf_windows_x86_64;
13 } else __floattixf;
14
15 @export(floattixf_fn, .{ .name = "__floattixf", .linkage = common.linkage });
816}
917
10fn __floattixf(a: i128) callconv(.C) f80 {
18pub fn __floattixf(a: i128) callconv(.C) f80 {
1119 return intToFloat(f80, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floattixf_windows_x86_64(a: v128) callconv(.C) f80 {
25 return intToFloat(f80, @bitCast(i128, a));
26}
lib/compiler_rt/floatuntidf.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floatuntidf, .{ .name = "__floatuntidf", .linkage = common.linkage });
9 const floatuntidf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floatuntidf_windows_x86_64;
13 } else __floatuntidf;
14
15 @export(floatuntidf_fn, .{ .name = "__floatuntidf", .linkage = common.linkage });
816}
917
1018pub fn __floatuntidf(a: u128) callconv(.C) f64 {
1119 return intToFloat(f64, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floatuntidf_windows_x86_64(a: v128) callconv(.C) f64 {
25 return intToFloat(f64, @bitCast(u128, a));
26}
lib/compiler_rt/floatuntihf.zig+16-2
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floatuntihf, .{ .name = "__floatuntihf", .linkage = common.linkage });
9 const floatuntihf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floatuntihf_windows_x86_64;
13 } else __floatuntihf;
14
15 @export(floatuntihf_fn, .{ .name = "__floatuntihf", .linkage = common.linkage });
816}
917
10fn __floatuntihf(a: u128) callconv(.C) f16 {
18pub fn __floatuntihf(a: u128) callconv(.C) f16 {
1119 return intToFloat(f16, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floatuntihf_windows_x86_64(a: v128) callconv(.C) f16 {
25 return intToFloat(f16, @bitCast(u128, a));
26}
lib/compiler_rt/floatuntisf.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floatuntisf, .{ .name = "__floatuntisf", .linkage = common.linkage });
9 const floatuntisf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floatuntisf_windows_x86_64;
13 } else __floatuntisf;
14
15 @export(floatuntisf_fn, .{ .name = "__floatuntisf", .linkage = common.linkage });
816}
917
1018pub fn __floatuntisf(a: u128) callconv(.C) f32 {
1119 return intToFloat(f32, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floatuntisf_windows_x86_64(a: v128) callconv(.C) f32 {
25 return intToFloat(f32, @bitCast(u128, a));
26}
lib/compiler_rt/floatuntitf.zig+15-7
......@@ -1,20 +1,28 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 if (common.want_ppc_abi) {
8 @export(__floatuntikf, .{ .name = "__floatuntikf", .linkage = common.linkage });
9 } else {
10 @export(__floatuntitf, .{ .name = "__floatuntitf", .linkage = common.linkage });
11 }
9 const symbol_name = if (common.want_ppc_abi) "__floatuntikf" else "__floatuntitf";
10
11 const floatuntitf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
12 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
13 // that LLVM expects compiler-rt to have.
14 break :b __floatuntitf_windows_x86_64;
15 } else __floatuntitf;
16
17 @export(floatuntitf_fn, .{ .name = symbol_name, .linkage = common.linkage });
1218}
1319
1420pub fn __floatuntitf(a: u128) callconv(.C) f128 {
1521 return intToFloat(f128, a);
1622}
1723
18fn __floatuntikf(a: u128) callconv(.C) f128 {
19 return intToFloat(f128, a);
24const v128 = @import("std").meta.Vector(2, u64);
25
26fn __floatuntitf_windows_x86_64(a: v128) callconv(.C) f128 {
27 return intToFloat(f128, @bitCast(u128, a));
2028}
lib/compiler_rt/floatuntixf.zig+15-1
......@@ -1,12 +1,26 @@
1const builtin = @import("builtin");
2const arch = builtin.cpu.arch;
13const common = @import("./common.zig");
24const intToFloat = @import("./int_to_float.zig").intToFloat;
35
46pub const panic = common.panic;
57
68comptime {
7 @export(__floatuntixf, .{ .name = "__floatuntixf", .linkage = common.linkage });
9 const floatuntixf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
10 // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
11 // that LLVM expects compiler-rt to have.
12 break :b __floatuntixf_windows_x86_64;
13 } else __floatuntixf;
14
15 @export(floatuntixf_fn, .{ .name = "__floatuntixf", .linkage = common.linkage });
816}
917
1018pub fn __floatuntixf(a: u128) callconv(.C) f80 {
1119 return intToFloat(f80, a);
1220}
21
22const v128 = @import("std").meta.Vector(2, u64);
23
24fn __floatuntixf_windows_x86_64(a: v128) callconv(.C) f80 {
25 return intToFloat(f80, @bitCast(u128, a));
26}
lib/std/fmt.zig-8
......@@ -2284,10 +2284,6 @@ test "float.hexadecimal.precision" {
22842284}
22852285
22862286test "float.decimal" {
2287 if (builtin.zig_backend == .stage1 and builtin.os.tag == .windows) {
2288 // https://github.com/ziglang/zig/issues/12063
2289 return error.SkipZigTest;
2290 }
22912287 try expectFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)});
22922288 try expectFmt("f32: 0", "f32: {d}", .{@as(f32, 0.0)});
22932289 try expectFmt("f32: 0", "f32: {d:.0}", .{@as(f32, 0.0)});
......@@ -2311,10 +2307,6 @@ test "float.decimal" {
23112307}
23122308
23132309test "float.libc.sanity" {
2314 if (builtin.zig_backend == .stage1 and builtin.os.tag == .windows) {
2315 // https://github.com/ziglang/zig/issues/12063
2316 return error.SkipZigTest;
2317 }
23182310 try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 916964781)))});
23192311 try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 925353389)))});
23202312 try expectFmt("f64: 0.10000", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1036831278)))});