| author | |
| committer | |
| log | bb8971150c6844bbb6eaee3687068bf2d4923710 |
| tree | d0f3672766368eb52ba49a82b8f8019b1fd9c387 |
| parent | 680419c407bc1216b86511d1f045d0d92066584e |
This is just a cosmetic change. The goal is to keep the export logic
relatively flat and centralized.26 files changed, 169 insertions(+), 309 deletions(-)
lib/compiler_rt/common.zig+4| ... | ... | @@ -17,6 +17,10 @@ pub const want_aeabi = switch (builtin.abi) { |
| 17 | 17 | }; |
| 18 | 18 | pub const want_ppc_abi = builtin.cpu.arch.isPPC() or builtin.cpu.arch.isPPC64(); |
| 19 | 19 | |
| 20 | // Libcalls that involve u128 on Windows x86-64 are expected by LLVM to use the | |
| 21 | // calling convention of @Vector(2, u64), rather than what's standard. | |
| 22 | pub const want_windows_v2u64_abi = builtin.os.tag == .windows and builtin.cpu.arch == .x86_64; | |
| 23 | ||
| 20 | 24 | /// This governs whether to use these symbol names for f16/f32 conversions |
| 21 | 25 | /// rather than the standard names: |
| 22 | 26 | /// * __gnu_f2h_ieee |
lib/compiler_rt/fixdfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixdfti_windows_x86_64, .{ .name = "__fixdfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixdfti, .{ .name = "__fixdfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixdfti(a: f64) callconv(.C) i128 { |
| 19 | 16 | return floatToInt(i128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixdfti_windows_x86_64(a: f64) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(i128, a)); | |
| 21 | fn __fixdfti_windows_x86_64(a: f64) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(i128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixhfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixhfti_windows_x86_64, .{ .name = "__fixhfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixhfti, .{ .name = "__fixhfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixhfti(a: f16) callconv(.C) i128 { |
| 19 | 16 | return floatToInt(i128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixhfti_windows_x86_64(a: f16) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(i128, a)); | |
| 21 | fn __fixhfti_windows_x86_64(a: f16) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(i128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixsfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixsfti_windows_x86_64, .{ .name = "__fixsfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixsfti, .{ .name = "__fixsfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixsfti(a: f32) callconv(.C) i128 { |
| 19 | 16 | return floatToInt(i128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixsfti_windows_x86_64(a: f32) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(i128, a)); | |
| 21 | fn __fixsfti_windows_x86_64(a: f32) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(i128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixtfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixtfti_windows_x86_64, .{ .name = "__fixtfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixtfti, .{ .name = "__fixtfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixtfti(a: f128) callconv(.C) i128 { |
| 19 | 16 | return floatToInt(i128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixtfti_windows_x86_64(a: f128) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(i128, a)); | |
| 21 | fn __fixtfti_windows_x86_64(a: f128) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(i128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixunsdfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixunsdfti_windows_x86_64, .{ .name = "__fixunsdfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixunsdfti, .{ .name = "__fixunsdfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixunsdfti(a: f64) callconv(.C) u128 { |
| 19 | 16 | return floatToInt(u128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixunsdfti_windows_x86_64(a: f64) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(u128, a)); | |
| 21 | fn __fixunsdfti_windows_x86_64(a: f64) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(u128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixunshfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixunshfti_windows_x86_64, .{ .name = "__fixunshfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixunshfti, .{ .name = "__fixunshfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixunshfti(a: f16) callconv(.C) u128 { |
| 19 | 16 | return floatToInt(u128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @import("std").meta.Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixunshfti_windows_x86_64(a: f16) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(u128, a)); | |
| 21 | fn __fixunshfti_windows_x86_64(a: f16) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(u128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixunssfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixunssfti_windows_x86_64, .{ .name = "__fixunssfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixunssfti, .{ .name = "__fixunssfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixunssfti(a: f32) callconv(.C) u128 { |
| 19 | 16 | return floatToInt(u128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixunssfti_windows_x86_64(a: f32) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(u128, a)); | |
| 21 | fn __fixunssfti_windows_x86_64(a: f32) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(u128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixunstfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixunstfti_windows_x86_64, .{ .name = "__fixunstfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixunstfti, .{ .name = "__fixunstfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixunstfti(a: f128) callconv(.C) u128 { |
| 19 | 16 | return floatToInt(u128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixunstfti_windows_x86_64(a: f128) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(u128, a)); | |
| 21 | fn __fixunstfti_windows_x86_64(a: f128) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(u128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixunsxfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixunsxfti_windows_x86_64, .{ .name = "__fixunsxfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixunsxfti, .{ .name = "__fixunsxfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixunsxfti(a: f80) callconv(.C) u128 { |
| 19 | 16 | return floatToInt(u128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixunsxfti_windows_x86_64(a: f80) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(u128, a)); | |
| 21 | fn __fixunsxfti_windows_x86_64(a: f80) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(u128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/fixxfti.zig+8-11| ... | ... | @@ -1,26 +1,23 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const floatToInt = @import("./float_to_int.zig").floatToInt; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__fixxfti_windows_x86_64, .{ .name = "__fixxfti", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__fixxfti, .{ .name = "__fixxfti", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __fixxfti(a: f80) callconv(.C) i128 { |
| 19 | 16 | return floatToInt(i128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 19 | const v2u64 = @Vector(2, u64); | |
| 23 | 20 | |
| 24 | fn __fixxfti_windows_x86_64(a: f80) callconv(.C) v128 { | |
| 25 | return @bitCast(v128, floatToInt(i128, a)); | |
| 21 | fn __fixxfti_windows_x86_64(a: f80) callconv(.C) v2u64 { | |
| 22 | return @bitCast(v2u64, floatToInt(i128, a)); | |
| 26 | 23 | } |
lib/compiler_rt/floattidf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floattidf_windows_x86_64, .{ .name = "__floattidf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floattidf, .{ .name = "__floattidf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floattidf(a: i128) callconv(.C) f64 { |
| 19 | 16 | return intToFloat(f64, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floattidf_windows_x86_64(a: v128) callconv(.C) f64 { | |
| 19 | fn __floattidf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f64 { | |
| 25 | 20 | return intToFloat(f64, @bitCast(i128, a)); |
| 26 | 21 | } |
lib/compiler_rt/floattihf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floattihf_windows_x86_64, .{ .name = "__floattihf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floattihf, .{ .name = "__floattihf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floattihf(a: i128) callconv(.C) f16 { |
| 19 | 16 | return intToFloat(f16, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floattihf_windows_x86_64(a: v128) callconv(.C) f16 { | |
| 19 | fn __floattihf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f16 { | |
| 25 | 20 | return intToFloat(f16, @bitCast(i128, a)); |
| 26 | 21 | } |
lib/compiler_rt/floattisf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floattisf_windows_x86_64, .{ .name = "__floattisf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floattisf, .{ .name = "__floattisf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floattisf(a: i128) callconv(.C) f32 { |
| 19 | 16 | return intToFloat(f32, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floattisf_windows_x86_64(a: v128) callconv(.C) f32 { | |
| 19 | fn __floattisf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f32 { | |
| 25 | 20 | return intToFloat(f32, @bitCast(i128, a)); |
| 26 | 21 | } |
lib/compiler_rt/floattitf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floattitf_windows_x86_64, .{ .name = "__floattitf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floattitf, .{ .name = "__floattitf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floattitf(a: i128) callconv(.C) f128 { |
| 19 | 16 | return intToFloat(f128, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floattitf_windows_x86_64(a: v128) callconv(.C) f128 { | |
| 19 | fn __floattitf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f128 { | |
| 25 | 20 | return intToFloat(f128, @bitCast(i128, a)); |
| 26 | 21 | } |
lib/compiler_rt/floattixf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floattixf_windows_x86_64, .{ .name = "__floattixf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floattixf, .{ .name = "__floattixf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floattixf(a: i128) callconv(.C) f80 { |
| 19 | 16 | return intToFloat(f80, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floattixf_windows_x86_64(a: v128) callconv(.C) f80 { | |
| 19 | fn __floattixf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f80 { | |
| 25 | 20 | return intToFloat(f80, @bitCast(i128, a)); |
| 26 | 21 | } |
lib/compiler_rt/floatuntidf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floatuntidf_windows_x86_64, .{ .name = "__floatuntidf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floatuntidf, .{ .name = "__floatuntidf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floatuntidf(a: u128) callconv(.C) f64 { |
| 19 | 16 | return intToFloat(f64, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floatuntidf_windows_x86_64(a: v128) callconv(.C) f64 { | |
| 19 | fn __floatuntidf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f64 { | |
| 25 | 20 | return intToFloat(f64, @bitCast(u128, a)); |
| 26 | 21 | } |
lib/compiler_rt/floatuntihf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floatuntihf_windows_x86_64, .{ .name = "__floatuntihf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floatuntihf, .{ .name = "__floatuntihf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floatuntihf(a: u128) callconv(.C) f16 { |
| 19 | 16 | return intToFloat(f16, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floatuntihf_windows_x86_64(a: v128) callconv(.C) f16 { | |
| 19 | fn __floatuntihf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f16 { | |
| 25 | 20 | return intToFloat(f16, @bitCast(u128, a)); |
| 26 | 21 | } |
lib/compiler_rt/floatuntisf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floatuntisf_windows_x86_64, .{ .name = "__floatuntisf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floatuntisf, .{ .name = "__floatuntisf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floatuntisf(a: u128) callconv(.C) f32 { |
| 19 | 16 | return intToFloat(f32, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floatuntisf_windows_x86_64(a: v128) callconv(.C) f32 { | |
| 19 | fn __floatuntisf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f32 { | |
| 25 | 20 | return intToFloat(f32, @bitCast(u128, a)); |
| 26 | 21 | } |
lib/compiler_rt/floatuntitf.zig+6-11| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| ... | ... | @@ -8,21 +7,17 @@ pub const panic = common.panic; |
| 8 | 7 | comptime { |
| 9 | 8 | const symbol_name = if (common.want_ppc_abi) "__floatuntikf" else "__floatuntitf"; |
| 10 | 9 | |
| 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 }); | |
| 10 | if (common.want_windows_v2u64_abi) { | |
| 11 | @export(__floatuntitf_windows_x86_64, .{ .name = symbol_name, .linkage = common.linkage }); | |
| 12 | } else { | |
| 13 | @export(__floatuntitf, .{ .name = symbol_name, .linkage = common.linkage }); | |
| 14 | } | |
| 18 | 15 | } |
| 19 | 16 | |
| 20 | 17 | pub fn __floatuntitf(a: u128) callconv(.C) f128 { |
| 21 | 18 | return intToFloat(f128, a); |
| 22 | 19 | } |
| 23 | 20 | |
| 24 | const v128 = @import("std").meta.Vector(2, u64); | |
| 25 | ||
| 26 | fn __floatuntitf_windows_x86_64(a: v128) callconv(.C) f128 { | |
| 21 | fn __floatuntitf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f128 { | |
| 27 | 22 | return intToFloat(f128, @bitCast(u128, a)); |
| 28 | 23 | } |
lib/compiler_rt/floatuntixf.zig+6-11| ... | ... | @@ -1,26 +1,21 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | const arch = builtin.cpu.arch; | |
| 3 | 2 | const common = @import("./common.zig"); |
| 4 | 3 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
| 5 | 4 | |
| 6 | 5 | pub const panic = common.panic; |
| 7 | 6 | |
| 8 | 7 | comptime { |
| 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 }); | |
| 8 | if (common.want_windows_v2u64_abi) { | |
| 9 | @export(__floatuntixf_windows_x86_64, .{ .name = "__floatuntixf", .linkage = common.linkage }); | |
| 10 | } else { | |
| 11 | @export(__floatuntixf, .{ .name = "__floatuntixf", .linkage = common.linkage }); | |
| 12 | } | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | pub fn __floatuntixf(a: u128) callconv(.C) f80 { |
| 19 | 16 | return intToFloat(f80, a); |
| 20 | 17 | } |
| 21 | 18 | |
| 22 | const v128 = @import("std").meta.Vector(2, u64); | |
| 23 | ||
| 24 | fn __floatuntixf_windows_x86_64(a: v128) callconv(.C) f80 { | |
| 19 | fn __floatuntixf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f80 { | |
| 25 | 20 | return intToFloat(f80, @bitCast(u128, a)); |
| 26 | 21 | } |
lib/compiler_rt/modti3.zig+5-19| ... | ... | @@ -5,27 +5,13 @@ |
| 5 | 5 | const std = @import("std"); |
| 6 | 6 | const builtin = @import("builtin"); |
| 7 | 7 | const udivmod = @import("udivmod.zig").udivmod; |
| 8 | const arch = builtin.cpu.arch; | |
| 9 | 8 | const common = @import("common.zig"); |
| 10 | 9 | |
| 11 | 10 | pub const panic = common.panic; |
| 12 | 11 | |
| 13 | 12 | comptime { |
| 14 | if (builtin.os.tag == .windows) { | |
| 15 | switch (arch) { | |
| 16 | .i386 => { | |
| 17 | @export(__modti3, .{ .name = "__modti3", .linkage = common.linkage }); | |
| 18 | }, | |
| 19 | .x86_64 => { | |
| 20 | // The "ti" functions must use Vector(2, u64) parameter types to adhere to the ABI | |
| 21 | // that LLVM expects compiler-rt to have. | |
| 22 | @export(__modti3_windows_x86_64, .{ .name = "__modti3", .linkage = common.linkage }); | |
| 23 | }, | |
| 24 | else => {}, | |
| 25 | } | |
| 26 | if (arch.isAARCH64()) { | |
| 27 | @export(__modti3, .{ .name = "__modti3", .linkage = common.linkage }); | |
| 28 | } | |
| 13 | if (common.want_windows_v2u64_abi) { | |
| 14 | @export(__modti3_windows_x86_64, .{ .name = "__modti3", .linkage = common.linkage }); | |
| 29 | 15 | } else { |
| 30 | 16 | @export(__modti3, .{ .name = "__modti3", .linkage = common.linkage }); |
| 31 | 17 | } |
| ... | ... | @@ -35,10 +21,10 @@ pub fn __modti3(a: i128, b: i128) callconv(.C) i128 { |
| 35 | 21 | return mod(a, b); |
| 36 | 22 | } |
| 37 | 23 | |
| 38 | const v128 = @import("std").meta.Vector(2, u64); | |
| 24 | const v2u64 = @Vector(2, u64); | |
| 39 | 25 | |
| 40 | fn __modti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { | |
| 41 | return @bitCast(v128, mod(@bitCast(i128, a), @bitCast(i128, b))); | |
| 26 | fn __modti3_windows_x86_64(a: v2u64, b: v2u64) callconv(.C) v2u64 { | |
| 27 | return @bitCast(v2u64, mod(@bitCast(i128, a), @bitCast(i128, b))); | |
| 42 | 28 | } |
| 43 | 29 | |
| 44 | 30 | inline fn mod(a: i128, b: i128) i128 { |
lib/compiler_rt/multi3.zig+5-16| ... | ... | @@ -4,25 +4,14 @@ |
| 4 | 4 | |
| 5 | 5 | const std = @import("std"); |
| 6 | 6 | const builtin = @import("builtin"); |
| 7 | const arch = builtin.cpu.arch; | |
| 8 | 7 | const native_endian = builtin.cpu.arch.endian(); |
| 9 | 8 | const common = @import("common.zig"); |
| 10 | 9 | |
| 11 | 10 | pub const panic = common.panic; |
| 12 | 11 | |
| 13 | 12 | comptime { |
| 14 | if (builtin.os.tag == .windows) { | |
| 15 | switch (arch) { | |
| 16 | .i386 => { | |
| 17 | @export(__multi3, .{ .name = "__multi3", .linkage = common.linkage }); | |
| 18 | }, | |
| 19 | .x86_64 => { | |
| 20 | // The "ti" functions must use Vector(2, u64) parameter types to adhere to the ABI | |
| 21 | // that LLVM expects compiler-rt to have. | |
| 22 | @export(__multi3_windows_x86_64, .{ .name = "__multi3", .linkage = common.linkage }); | |
| 23 | }, | |
| 24 | else => {}, | |
| 25 | } | |
| 13 | if (common.want_windows_v2u64_abi) { | |
| 14 | @export(__multi3_windows_x86_64, .{ .name = "__multi3", .linkage = common.linkage }); | |
| 26 | 15 | } else { |
| 27 | 16 | @export(__multi3, .{ .name = "__multi3", .linkage = common.linkage }); |
| 28 | 17 | } |
| ... | ... | @@ -32,10 +21,10 @@ pub fn __multi3(a: i128, b: i128) callconv(.C) i128 { |
| 32 | 21 | return mul(a, b); |
| 33 | 22 | } |
| 34 | 23 | |
| 35 | const v128 = @Vector(2, u64); | |
| 24 | const v2u64 = @Vector(2, u64); | |
| 36 | 25 | |
| 37 | fn __multi3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { | |
| 38 | return @bitCast(v128, mul(@bitCast(i128, a), @bitCast(i128, b))); | |
| 26 | fn __multi3_windows_x86_64(a: v2u64, b: v2u64) callconv(.C) v2u64 { | |
| 27 | return @bitCast(v2u64, mul(@bitCast(i128, a), @bitCast(i128, b))); | |
| 39 | 28 | } |
| 40 | 29 | |
| 41 | 30 | inline fn mul(a: i128, b: i128) i128 { |
lib/compiler_rt/udivmodti4.zig+5-16| ... | ... | @@ -1,24 +1,13 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | const udivmod = @import("udivmod.zig").udivmod; |
| 4 | const arch = builtin.cpu.arch; | |
| 5 | 4 | const common = @import("common.zig"); |
| 6 | 5 | |
| 7 | 6 | pub const panic = common.panic; |
| 8 | 7 | |
| 9 | 8 | comptime { |
| 10 | if (builtin.os.tag == .windows) { | |
| 11 | switch (arch) { | |
| 12 | .i386 => { | |
| 13 | @export(__udivmodti4, .{ .name = "__udivmodti4", .linkage = common.linkage }); | |
| 14 | }, | |
| 15 | .x86_64 => { | |
| 16 | // The "ti" functions must use Vector(2, u64) parameter types to adhere to the ABI | |
| 17 | // that LLVM expects compiler-rt to have. | |
| 18 | @export(__udivmodti4_windows_x86_64, .{ .name = "__udivmodti4", .linkage = common.linkage }); | |
| 19 | }, | |
| 20 | else => {}, | |
| 21 | } | |
| 9 | if (common.want_windows_v2u64_abi) { | |
| 10 | @export(__udivmodti4_windows_x86_64, .{ .name = "__udivmodti4", .linkage = common.linkage }); | |
| 22 | 11 | } else { |
| 23 | 12 | @export(__udivmodti4, .{ .name = "__udivmodti4", .linkage = common.linkage }); |
| 24 | 13 | } |
| ... | ... | @@ -28,10 +17,10 @@ pub fn __udivmodti4(a: u128, b: u128, maybe_rem: ?*u128) callconv(.C) u128 { |
| 28 | 17 | return udivmod(u128, a, b, maybe_rem); |
| 29 | 18 | } |
| 30 | 19 | |
| 31 | const v128 = std.meta.Vector(2, u64); | |
| 20 | const v2u64 = @Vector(2, u64); | |
| 32 | 21 | |
| 33 | fn __udivmodti4_windows_x86_64(a: v128, b: v128, maybe_rem: ?*u128) callconv(.C) v128 { | |
| 34 | return @bitCast(v128, udivmod(u128, @bitCast(u128, a), @bitCast(u128, b), maybe_rem)); | |
| 22 | fn __udivmodti4_windows_x86_64(a: v2u64, b: v2u64, maybe_rem: ?*u128) callconv(.C) v2u64 { | |
| 23 | return @bitCast(v2u64, udivmod(u128, @bitCast(u128, a), @bitCast(u128, b), maybe_rem)); | |
| 35 | 24 | } |
| 36 | 25 | |
| 37 | 26 | test { |
lib/compiler_rt/udivti3.zig+5-19| ... | ... | @@ -1,27 +1,13 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | const udivmod = @import("udivmod.zig").udivmod; |
| 4 | const arch = builtin.cpu.arch; | |
| 5 | 4 | const common = @import("common.zig"); |
| 6 | 5 | |
| 7 | 6 | pub const panic = common.panic; |
| 8 | 7 | |
| 9 | 8 | comptime { |
| 10 | if (builtin.os.tag == .windows) { | |
| 11 | switch (arch) { | |
| 12 | .i386 => { | |
| 13 | @export(__udivti3, .{ .name = "__udivti3", .linkage = common.linkage }); | |
| 14 | }, | |
| 15 | .x86_64 => { | |
| 16 | // The "ti" functions must use Vector(2, u64) parameter types to adhere to the ABI | |
| 17 | // that LLVM expects compiler-rt to have. | |
| 18 | @export(__udivti3_windows_x86_64, .{ .name = "__udivti3", .linkage = common.linkage }); | |
| 19 | }, | |
| 20 | else => {}, | |
| 21 | } | |
| 22 | if (arch.isAARCH64()) { | |
| 23 | @export(__udivti3, .{ .name = "__udivti3", .linkage = common.linkage }); | |
| 24 | } | |
| 9 | if (common.want_windows_v2u64_abi) { | |
| 10 | @export(__udivti3_windows_x86_64, .{ .name = "__udivti3", .linkage = common.linkage }); | |
| 25 | 11 | } else { |
| 26 | 12 | @export(__udivti3, .{ .name = "__udivti3", .linkage = common.linkage }); |
| 27 | 13 | } |
| ... | ... | @@ -31,8 +17,8 @@ pub fn __udivti3(a: u128, b: u128) callconv(.C) u128 { |
| 31 | 17 | return udivmod(u128, a, b, null); |
| 32 | 18 | } |
| 33 | 19 | |
| 34 | const v128 = std.meta.Vector(2, u64); | |
| 20 | const v2u64 = @Vector(2, u64); | |
| 35 | 21 | |
| 36 | fn __udivti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { | |
| 37 | return @bitCast(v128, udivmod(u128, @bitCast(u128, a), @bitCast(u128, b), null)); | |
| 22 | fn __udivti3_windows_x86_64(a: v2u64, b: v2u64) callconv(.C) v2u64 { | |
| 23 | return @bitCast(v2u64, udivmod(u128, @bitCast(u128, a), @bitCast(u128, b), null)); | |
| 38 | 24 | } |
lib/compiler_rt/umodti3.zig+5-19| ... | ... | @@ -1,27 +1,13 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | const udivmod = @import("udivmod.zig").udivmod; |
| 4 | const arch = builtin.cpu.arch; | |
| 5 | 4 | const common = @import("common.zig"); |
| 6 | 5 | |
| 7 | 6 | pub const panic = common.panic; |
| 8 | 7 | |
| 9 | 8 | comptime { |
| 10 | if (builtin.os.tag == .windows) { | |
| 11 | switch (arch) { | |
| 12 | .i386 => { | |
| 13 | @export(__umodti3, .{ .name = "__umodti3", .linkage = common.linkage }); | |
| 14 | }, | |
| 15 | .x86_64 => { | |
| 16 | // The "ti" functions must use Vector(2, u64) parameter types to adhere to the ABI | |
| 17 | // that LLVM expects compiler-rt to have. | |
| 18 | @export(__umodti3_windows_x86_64, .{ .name = "__umodti3", .linkage = common.linkage }); | |
| 19 | }, | |
| 20 | else => {}, | |
| 21 | } | |
| 22 | if (arch.isAARCH64()) { | |
| 23 | @export(__umodti3, .{ .name = "__umodti3", .linkage = common.linkage }); | |
| 24 | } | |
| 9 | if (common.want_windows_v2u64_abi) { | |
| 10 | @export(__umodti3_windows_x86_64, .{ .name = "__umodti3", .linkage = common.linkage }); | |
| 25 | 11 | } else { |
| 26 | 12 | @export(__umodti3, .{ .name = "__umodti3", .linkage = common.linkage }); |
| 27 | 13 | } |
| ... | ... | @@ -33,10 +19,10 @@ pub fn __umodti3(a: u128, b: u128) callconv(.C) u128 { |
| 33 | 19 | return r; |
| 34 | 20 | } |
| 35 | 21 | |
| 36 | const v128 = std.meta.Vector(2, u64); | |
| 22 | const v2u64 = @Vector(2, u64); | |
| 37 | 23 | |
| 38 | fn __umodti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { | |
| 24 | fn __umodti3_windows_x86_64(a: v2u64, b: v2u64) callconv(.C) v2u64 { | |
| 39 | 25 | var r: u128 = undefined; |
| 40 | 26 | _ = udivmod(u128, @bitCast(u128, a), @bitCast(u128, b), &r); |
| 41 | return @bitCast(v128, r); | |
| 27 | return @bitCast(v2u64, r); | |
| 42 | 28 | } |