master
 1///! The quoted behavior definitions are from
 2///! https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gccint/Soft-float-library-routines.html#Soft-float-library-routines
 3const common = @import("./common.zig");
 4const comparef = @import("./comparef.zig");
 5
 6pub const panic = common.panic;
 7
 8comptime {
 9    if (common.want_ppc_abi) {
10        @export(&__getf2, .{ .name = "__gekf2", .linkage = common.linkage, .visibility = common.visibility });
11        @export(&__gttf2, .{ .name = "__gtkf2", .linkage = common.linkage, .visibility = common.visibility });
12    } else if (common.want_sparc_abi) {
13        // These exports are handled in cmptf2.zig because gt and ge on sparc
14        // are based on calling _Qp_cmp.
15    }
16    @export(&__getf2, .{ .name = "__getf2", .linkage = common.linkage, .visibility = common.visibility });
17    @export(&__gttf2, .{ .name = "__gttf2", .linkage = common.linkage, .visibility = common.visibility });
18}
19
20/// "These functions return a value greater than or equal to zero if neither
21/// argument is NaN, and a is greater than or equal to b."
22fn __getf2(a: f128, b: f128) callconv(.c) i32 {
23    return @intFromEnum(comparef.cmpf2(f128, comparef.GE, a, b));
24}
25
26/// "These functions return a value greater than zero if neither argument is NaN,
27/// and a is strictly greater than b."
28fn __gttf2(a: f128, b: f128) callconv(.c) i32 {
29    return __getf2(a, b);
30}