File tree Expand file tree Collapse file tree 21 files changed +305
-39
lines changed Expand file tree Collapse file tree 21 files changed +305
-39
lines changed Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixdfti_windows_x86_64 (a : f64 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (i128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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
10- fn __fixhfti (a : f16 ) callconv (.C ) i128 {
18+ pub fn __fixhfti (a : f16 ) callconv (.C ) i128 {
1119 return floatToInt (i128 , a );
1220}
21+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixhfti_windows_x86_64 (a : f16 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (i128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixsfti_windows_x86_64 (a : f32 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (i128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixtfti_windows_x86_64 (a : f128 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (i128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixunsdfti_windows_x86_64 (a : f64 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (u128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixunshfti_windows_x86_64 (a : f16 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (u128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixunssfti_windows_x86_64 (a : f32 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (u128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixunstfti_windows_x86_64 (a : f128 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (u128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixunsxfti_windows_x86_64 (a : f80 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (u128 , a ));
26+ }
Original file line number Diff line number Diff line change 1+ const builtin = @import ("builtin" );
2+ const 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
10- fn __fixxfti (a : f80 ) callconv (.C ) i128 {
18+ pub fn __fixxfti (a : f80 ) callconv (.C ) i128 {
1119 return floatToInt (i128 , a );
1220}
21+
22+ const v128 = @import ("std" ).meta .Vector (2 , u64 );
23+
24+ fn __fixxfti_windows_x86_64 (a : f80 ) callconv (.C ) v128 {
25+ return @bitCast (v128 , floatToInt (i128 , a ));
26+ }
You can’t perform that action at this time.
0 commit comments