fixunstfei.zig (576B) - Raw
1 const std = @import("std"); 2 const builtin = @import("builtin"); 3 const common = @import("common.zig"); 4 const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; 5 6 pub const panic = common.panic; 7 8 comptime { 9 @export(&__fixunstfei, .{ .name = "__fixunstfei", .linkage = common.linkage, .visibility = common.visibility }); 10 } 11 12 pub fn __fixunstfei(r: [*]u8, bits: usize, a: f128) callconv(.c) void { 13 const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits)); 14 return bigIntFromFloat(.unsigned, @ptrCast(@alignCast(r[0..byte_size])), a); 15 }