aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/fixtfti.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/fixtfti.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/fixtfti.zig')
-rw-r--r--lib/compiler_rt/fixtfti.zig19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/compiler_rt/fixtfti.zig b/lib/compiler_rt/fixtfti.zig
index 117b2f91b4..ba46eb8598 100644
--- a/lib/compiler_rt/fixtfti.zig
+++ b/lib/compiler_rt/fixtfti.zig
@@ -1,26 +1,23 @@
const builtin = @import("builtin");
-const arch = builtin.cpu.arch;
const common = @import("./common.zig");
const floatToInt = @import("./float_to_int.zig").floatToInt;
pub const panic = common.panic;
comptime {
- const fixtfti_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 __fixtfti_windows_x86_64;
- } else __fixtfti;
-
- @export(fixtfti_fn, .{ .name = "__fixtfti", .linkage = common.linkage });
+ if (common.want_windows_v2u64_abi) {
+ @export(__fixtfti_windows_x86_64, .{ .name = "__fixtfti", .linkage = common.linkage });
+ } else {
+ @export(__fixtfti, .{ .name = "__fixtfti", .linkage = common.linkage });
+ }
}
pub fn __fixtfti(a: f128) callconv(.C) i128 {
return floatToInt(i128, a);
}
-const v128 = @import("std").meta.Vector(2, u64);
+const v2u64 = @Vector(2, u64);
-fn __fixtfti_windows_x86_64(a: f128) callconv(.C) v128 {
- return @bitCast(v128, floatToInt(i128, a));
+fn __fixtfti_windows_x86_64(a: f128) callconv(.C) v2u64 {
+ return @bitCast(v2u64, floatToInt(i128, a));
}