zig

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

truncsfhf2.zig (881B) - Raw


      1 const common = @import("./common.zig");
      2 const truncf = @import("./truncf.zig").truncf;
      3 
      4 pub const panic = common.panic;
      5 
      6 comptime {
      7     if (common.gnu_f16_abi) {
      8         @export(&__gnu_f2h_ieee, .{ .name = "__gnu_f2h_ieee", .linkage = common.linkage, .visibility = common.visibility });
      9     } else if (common.want_aeabi) {
     10         @export(&__aeabi_f2h, .{ .name = "__aeabi_f2h", .linkage = common.linkage, .visibility = common.visibility });
     11     }
     12     @export(&__truncsfhf2, .{ .name = "__truncsfhf2", .linkage = common.linkage, .visibility = common.visibility });
     13 }
     14 
     15 pub fn __truncsfhf2(a: f32) callconv(.c) common.F16T(f32) {
     16     return @bitCast(truncf(f16, f32, a));
     17 }
     18 
     19 fn __gnu_f2h_ieee(a: f32) callconv(.c) common.F16T(f32) {
     20     return @bitCast(truncf(f16, f32, a));
     21 }
     22 
     23 fn __aeabi_f2h(a: f32) callconv(.{ .arm_aapcs = .{} }) u16 {
     24     return @bitCast(truncf(f16, f32, a));
     25 }