aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/floatuntidf.zig
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-07-10 16:42:58 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-07-10 20:51:34 -0700
commitbb8971150c6844bbb6eaee3687068bf2d4923710 (patch)
treed0f3672766368eb52ba49a82b8f8019b1fd9c387 /lib/compiler_rt/floatuntidf.zig
parent680419c407bc1216b86511d1f045d0d92066584e (diff)
downloadzig-bb8971150c6844bbb6eaee3687068bf2d4923710.tar.gz
zig-bb8971150c6844bbb6eaee3687068bf2d4923710.zip
compiler_rt: Slightly re-factor exports for Windows x86-64
This is just a cosmetic change. The goal is to keep the export logic relatively flat and centralized.
Diffstat (limited to 'lib/compiler_rt/floatuntidf.zig')
-rw-r--r--lib/compiler_rt/floatuntidf.zig17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/compiler_rt/floatuntidf.zig b/lib/compiler_rt/floatuntidf.zig
index 75bad71386..a00175d9a9 100644
--- a/lib/compiler_rt/floatuntidf.zig
+++ b/lib/compiler_rt/floatuntidf.zig
@@ -1,26 +1,21 @@
const builtin = @import("builtin");
-const arch = builtin.cpu.arch;
const common = @import("./common.zig");
const intToFloat = @import("./int_to_float.zig").intToFloat;
pub const panic = common.panic;
comptime {
- const floatuntidf_fn = if (builtin.os.tag == .windows and arch == .x86_64) b: {
- // The "ti" functions must use Vector(2, u64) return types to adhere to the ABI
- // that LLVM expects compiler-rt to have.
- break :b __floatuntidf_windows_x86_64;
- } else __floatuntidf;
-
- @export(floatuntidf_fn, .{ .name = "__floatuntidf", .linkage = common.linkage });
+ if (common.want_windows_v2u64_abi) {
+ @export(__floatuntidf_windows_x86_64, .{ .name = "__floatuntidf", .linkage = common.linkage });
+ } else {
+ @export(__floatuntidf, .{ .name = "__floatuntidf", .linkage = common.linkage });
+ }
}
pub fn __floatuntidf(a: u128) callconv(.C) f64 {
return intToFloat(f64, a);
}
-const v128 = @import("std").meta.Vector(2, u64);
-
-fn __floatuntidf_windows_x86_64(a: v128) callconv(.C) f64 {
+fn __floatuntidf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f64 {
return intToFloat(f64, @bitCast(u128, a));
}