mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
This struct is larger than 256 bytes and code that copies it consistently shows up in profiles of the compiler.
15 lines
569 B
Zig
15 lines
569 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(&__floateisf, .{ .name = "__floateisf", .linkage = common.linkage, .visibility = common.visibility });
|
|
}
|
|
|
|
pub fn __floateisf(a: [*]const u8, bits: usize) callconv(.c) f32 {
|
|
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
|
|
return floatFromBigInt(f32, .signed, @ptrCast(@alignCast(a[0..byte_size])));
|
|
}
|