-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12071 from topolarity/windows-abi-change
compiler_rt: Update Windows ABI for float<->int conversion routines
- Loading branch information
Showing
30 changed files
with
334 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixdfti, .{ .name = "__fixdfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixdfti_windows_x86_64, .{ .name = "__fixdfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixdfti, .{ .name = "__fixdfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __fixdfti(a: f64) callconv(.C) i128 { | ||
return floatToInt(i128, a); | ||
} | ||
|
||
const v2u64 = @Vector(2, u64); | ||
|
||
fn __fixdfti_windows_x86_64(a: f64) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixhfti, .{ .name = "__fixhfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixhfti_windows_x86_64, .{ .name = "__fixhfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixhfti, .{ .name = "__fixhfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
fn __fixhfti(a: f16) callconv(.C) i128 { | ||
pub fn __fixhfti(a: f16) callconv(.C) i128 { | ||
return floatToInt(i128, a); | ||
} | ||
|
||
const v2u64 = @Vector(2, u64); | ||
|
||
fn __fixhfti_windows_x86_64(a: f16) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixsfti, .{ .name = "__fixsfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixsfti_windows_x86_64, .{ .name = "__fixsfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixsfti, .{ .name = "__fixsfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __fixsfti(a: f32) callconv(.C) i128 { | ||
return floatToInt(i128, a); | ||
} | ||
|
||
const v2u64 = @Vector(2, u64); | ||
|
||
fn __fixsfti_windows_x86_64(a: f32) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixtfti, .{ .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 v2u64 = @Vector(2, u64); | ||
|
||
fn __fixtfti_windows_x86_64(a: f128) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixunsdfti, .{ .name = "__fixunsdfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixunsdfti_windows_x86_64, .{ .name = "__fixunsdfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixunsdfti, .{ .name = "__fixunsdfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __fixunsdfti(a: f64) callconv(.C) u128 { | ||
return floatToInt(u128, a); | ||
} | ||
|
||
const v2u64 = @Vector(2, u64); | ||
|
||
fn __fixunsdfti_windows_x86_64(a: f64) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(u128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixunshfti, .{ .name = "__fixunshfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixunshfti_windows_x86_64, .{ .name = "__fixunshfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixunshfti, .{ .name = "__fixunshfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __fixunshfti(a: f16) callconv(.C) u128 { | ||
return floatToInt(u128, a); | ||
} | ||
|
||
const v2u64 = @import("std").meta.Vector(2, u64); | ||
|
||
fn __fixunshfti_windows_x86_64(a: f16) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(u128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixunssfti, .{ .name = "__fixunssfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixunssfti_windows_x86_64, .{ .name = "__fixunssfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixunssfti, .{ .name = "__fixunssfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __fixunssfti(a: f32) callconv(.C) u128 { | ||
return floatToInt(u128, a); | ||
} | ||
|
||
const v2u64 = @Vector(2, u64); | ||
|
||
fn __fixunssfti_windows_x86_64(a: f32) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(u128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixunstfti, .{ .name = "__fixunstfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixunstfti_windows_x86_64, .{ .name = "__fixunstfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixunstfti, .{ .name = "__fixunstfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __fixunstfti(a: f128) callconv(.C) u128 { | ||
return floatToInt(u128, a); | ||
} | ||
|
||
const v2u64 = @Vector(2, u64); | ||
|
||
fn __fixunstfti_windows_x86_64(a: f128) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(u128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixunsxfti, .{ .name = "__fixunsxfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixunsxfti_windows_x86_64, .{ .name = "__fixunsxfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixunsxfti, .{ .name = "__fixunsxfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __fixunsxfti(a: f80) callconv(.C) u128 { | ||
return floatToInt(u128, a); | ||
} | ||
|
||
const v2u64 = @Vector(2, u64); | ||
|
||
fn __fixunsxfti_windows_x86_64(a: f80) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(u128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const floatToInt = @import("./float_to_int.zig").floatToInt; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__fixxfti, .{ .name = "__fixxfti", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__fixxfti_windows_x86_64, .{ .name = "__fixxfti", .linkage = common.linkage }); | ||
} else { | ||
@export(__fixxfti, .{ .name = "__fixxfti", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
fn __fixxfti(a: f80) callconv(.C) i128 { | ||
pub fn __fixxfti(a: f80) callconv(.C) i128 { | ||
return floatToInt(i128, a); | ||
} | ||
|
||
const v2u64 = @Vector(2, u64); | ||
|
||
fn __fixxfti_windows_x86_64(a: f80) callconv(.C) v2u64 { | ||
return @bitCast(v2u64, floatToInt(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const intToFloat = @import("./int_to_float.zig").intToFloat; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__floattidf, .{ .name = "__floattidf", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__floattidf_windows_x86_64, .{ .name = "__floattidf", .linkage = common.linkage }); | ||
} else { | ||
@export(__floattidf, .{ .name = "__floattidf", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __floattidf(a: i128) callconv(.C) f64 { | ||
return intToFloat(f64, a); | ||
} | ||
|
||
fn __floattidf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f64 { | ||
return intToFloat(f64, @bitCast(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const intToFloat = @import("./int_to_float.zig").intToFloat; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__floattihf, .{ .name = "__floattihf", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__floattihf_windows_x86_64, .{ .name = "__floattihf", .linkage = common.linkage }); | ||
} else { | ||
@export(__floattihf, .{ .name = "__floattihf", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
fn __floattihf(a: i128) callconv(.C) f16 { | ||
pub fn __floattihf(a: i128) callconv(.C) f16 { | ||
return intToFloat(f16, a); | ||
} | ||
|
||
fn __floattihf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f16 { | ||
return intToFloat(f16, @bitCast(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const intToFloat = @import("./int_to_float.zig").intToFloat; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__floattisf, .{ .name = "__floattisf", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__floattisf_windows_x86_64, .{ .name = "__floattisf", .linkage = common.linkage }); | ||
} else { | ||
@export(__floattisf, .{ .name = "__floattisf", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __floattisf(a: i128) callconv(.C) f32 { | ||
return intToFloat(f32, a); | ||
} | ||
|
||
fn __floattisf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f32 { | ||
return intToFloat(f32, @bitCast(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const intToFloat = @import("./int_to_float.zig").intToFloat; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__floattitf, .{ .name = "__floattitf", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__floattitf_windows_x86_64, .{ .name = "__floattitf", .linkage = common.linkage }); | ||
} else { | ||
@export(__floattitf, .{ .name = "__floattitf", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
pub fn __floattitf(a: i128) callconv(.C) f128 { | ||
return intToFloat(f128, a); | ||
} | ||
|
||
fn __floattitf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f128 { | ||
return intToFloat(f128, @bitCast(i128, a)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
const builtin = @import("builtin"); | ||
const common = @import("./common.zig"); | ||
const intToFloat = @import("./int_to_float.zig").intToFloat; | ||
|
||
pub const panic = common.panic; | ||
|
||
comptime { | ||
@export(__floattixf, .{ .name = "__floattixf", .linkage = common.linkage }); | ||
if (common.want_windows_v2u64_abi) { | ||
@export(__floattixf_windows_x86_64, .{ .name = "__floattixf", .linkage = common.linkage }); | ||
} else { | ||
@export(__floattixf, .{ .name = "__floattixf", .linkage = common.linkage }); | ||
} | ||
} | ||
|
||
fn __floattixf(a: i128) callconv(.C) f80 { | ||
pub fn __floattixf(a: i128) callconv(.C) f80 { | ||
return intToFloat(f80, a); | ||
} | ||
|
||
fn __floattixf_windows_x86_64(a: @Vector(2, u64)) callconv(.C) f80 { | ||
return intToFloat(f80, @bitCast(i128, a)); | ||
} |
Oops, something went wrong.