aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/floatdihf.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-06-15 23:09:56 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-06-17 16:38:59 -0700
commitc99c085d70c9347ec9a15d9a4f73c19e628912b7 (patch)
tree877b2d98b2611f8b4a1598f3c7b28e62f20ddd90 /lib/compiler_rt/floatdihf.zig
parent47c834e477657113bccaaad32e91148ff837f1a4 (diff)
downloadzig-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/floatdihf.zig')
-rw-r--r--lib/compiler_rt/floatdihf.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/compiler_rt/floatdihf.zig b/lib/compiler_rt/floatdihf.zig
new file mode 100644
index 0000000000..f2f7236d6f
--- /dev/null
+++ b/lib/compiler_rt/floatdihf.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(__floatdihf, .{ .name = "__floatdihf", .linkage = common.linkage });
+}
+
+fn __floatdihf(a: i64) callconv(.C) f16 {
+ return intToFloat(f16, a);
+}