zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

fixsfdi.zig (701B) - Raw


      1 const builtin = @import("builtin");
      2 const common = @import("./common.zig");
      3 const intFromFloat = @import("./int_from_float.zig").intFromFloat;
      4 
      5 pub const panic = common.panic;
      6 
      7 comptime {
      8     if (common.want_aeabi) {
      9         @export(&__aeabi_f2lz, .{ .name = "__aeabi_f2lz", .linkage = common.linkage, .visibility = common.visibility });
     10     } else {
     11         @export(&__fixsfdi, .{ .name = if (common.want_windows_arm_abi) "__stoi64" else "__fixsfdi", .linkage = common.linkage, .visibility = common.visibility });
     12     }
     13 }
     14 
     15 pub fn __fixsfdi(a: f32) callconv(.c) i64 {
     16     return intFromFloat(i64, a);
     17 }
     18 
     19 fn __aeabi_f2lz(a: f32) callconv(.{ .arm_aapcs = .{} }) i64 {
     20     return intFromFloat(i64, a);
     21 }