zig

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

fixunstfsi.zig (754B) - Raw


      1 const common = @import("./common.zig");
      2 const intFromFloat = @import("./int_from_float.zig").intFromFloat;
      3 
      4 pub const panic = common.panic;
      5 
      6 comptime {
      7     if (common.want_ppc_abi) {
      8         @export(&__fixunstfsi, .{ .name = "__fixunskfsi", .linkage = common.linkage, .visibility = common.visibility });
      9     } else if (common.want_sparc_abi) {
     10         @export(&_Qp_qtoui, .{ .name = "_Qp_qtoui", .linkage = common.linkage, .visibility = common.visibility });
     11     }
     12     @export(&__fixunstfsi, .{ .name = "__fixunstfsi", .linkage = common.linkage, .visibility = common.visibility });
     13 }
     14 
     15 pub fn __fixunstfsi(a: f128) callconv(.c) u32 {
     16     return intFromFloat(u32, a);
     17 }
     18 
     19 fn _Qp_qtoui(a: *const f128) callconv(.c) u32 {
     20     return intFromFloat(u32, a.*);
     21 }