aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/floatdisf.zig
blob: d1c9515f9a3e3a389121f0c89ede50922bbc37a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const builtin = @import("builtin");
const common = @import("./common.zig");
const floatFromInt = @import("./float_from_int.zig").floatFromInt;

pub const panic = common.panic;

comptime {
    if (common.want_aeabi) {
        @export(&__aeabi_l2f, .{ .name = "__aeabi_l2f", .linkage = common.linkage, .visibility = common.visibility });
    } else {
        @export(&__floatdisf, .{ .name = "__floatdisf", .linkage = common.linkage, .visibility = common.visibility });

        if (common.want_mingw_arm_abi) {
            @export(&__floatdisf, .{ .name = "__i64tos", .linkage = common.linkage, .visibility = common.visibility });
        }
    }
}

pub fn __floatdisf(a: i64) callconv(.C) f32 {
    return floatFromInt(f32, a);
}

fn __aeabi_l2f(a: i64) callconv(.AAPCS) f32 {
    return floatFromInt(f32, a);
}