mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
This struct is larger than 256 bytes and code that copies it consistently shows up in profiles of the compiler.
15 lines
577 B
Zig
15 lines
577 B
Zig
const std = @import("std");
|
|
const builtin = @import("builtin");
|
|
const common = @import("common.zig");
|
|
const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt;
|
|
|
|
pub const panic = common.panic;
|
|
|
|
comptime {
|
|
@export(&__floatuneisf, .{ .name = "__floatuneisf", .linkage = common.linkage, .visibility = common.visibility });
|
|
}
|
|
|
|
pub fn __floatuneisf(a: [*]const u8, bits: usize) callconv(.c) f32 {
|
|
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
|
|
return floatFromBigInt(f32, .unsigned, @ptrCast(@alignCast(a[0..byte_size])));
|
|
}
|