diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-06-15 23:09:56 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-06-17 16:38:59 -0700 |
| commit | c99c085d70c9347ec9a15d9a4f73c19e628912b7 (patch) | |
| tree | 877b2d98b2611f8b4a1598f3c7b28e62f20ddd90 /lib/compiler_rt/floatunsihf.zig | |
| parent | 47c834e477657113bccaaad32e91148ff837f1a4 (diff) | |
| download | zig-c99c085d70c9347ec9a15d9a4f73c19e628912b7.tar.gz zig-c99c085d70c9347ec9a15d9a4f73c19e628912b7.zip | |
compiler-rt: break up functions even more
The purpose of this branch is to switch to using an object file for each
independent function, in order to make linking simpler - instead of
relying on `-ffunction-sections` and `--gc-sections`, which involves the
linker doing the work of linking everything and then undoing work via
garbage collection, this will allow the linker to only include the
compilation units that are depended on in the first place.
This commit makes progress towards that goal.
Diffstat (limited to 'lib/compiler_rt/floatunsihf.zig')
| -rw-r--r-- | lib/compiler_rt/floatunsihf.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/compiler_rt/floatunsihf.zig b/lib/compiler_rt/floatunsihf.zig new file mode 100644 index 0000000000..c95de9c536 --- /dev/null +++ b/lib/compiler_rt/floatunsihf.zig @@ -0,0 +1,12 @@ +const common = @import("./common.zig"); +const intToFloat = @import("./int_to_float.zig").intToFloat; + +pub const panic = common.panic; + +comptime { + @export(__floatunsihf, .{ .name = "__floatunsihf", .linkage = common.linkage }); +} + +fn __floatunsihf(a: u32) callconv(.C) f16 { + return intToFloat(f16, a); +} |
