authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-04-27 18:26:47-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-04-27 18:26:47-07:00
log51f8ce182573e940ee090c1df146a83de63d6b5c
tree4101f385da70705f001fc6d7ac0406c7ce0195a5
parent1ac21cdec5747e2c7788c566a2998b2bee54eb47

compiler-rt: fix powerpc f128 suffix


1 files changed, 9 insertions(+), 5 deletions(-)

lib/std/special/compiler_rt.zig+9-5
......@@ -8,6 +8,7 @@ const abi = builtin.abi;
88const is_gnu = abi.isGnu();
99const is_mingw = os_tag == .windows and is_gnu;
1010const is_darwin = std.Target.Os.Tag.isDarwin(os_tag);
11const is_ppc = arch.isPPC() or arch.isPPC64();
1112
1213const linkage = if (is_test)
1314 std.builtin.GlobalLinkage.Internal
......@@ -795,7 +796,7 @@ comptime {
795796 @export(_Qp_qtod, .{ .name = "_Qp_qtod", .linkage = linkage });
796797 }
797798
798 if ((arch.isPPC() or arch.isPPC64()) and !is_test) {
799 if (is_ppc and !is_test) {
799800 @export(__addtf3, .{ .name = "__addkf3", .linkage = linkage });
800801 @export(__subtf3, .{ .name = "__subkf3", .linkage = linkage });
801802 @export(__multf3, .{ .name = "__mulkf3", .linkage = linkage });
......@@ -820,10 +821,6 @@ comptime {
820821 @export(__letf2, .{ .name = "__lekf2", .linkage = linkage });
821822 @export(__getf2, .{ .name = "__gtkf2", .linkage = linkage });
822823 @export(__unordtf2, .{ .name = "__unordkf2", .linkage = linkage });
823
824 // LLVM PPC backend lowers f128 fma to `fmaf128`.
825 const fmaq = @import("./compiler_rt/fma.zig").fmaq;
826 @export(fmaq, .{ .name = "fmaf128", .linkage = linkage });
827824 }
828825}
829826
......@@ -845,6 +842,8 @@ inline fn mathExport(double_name: []const u8, comptime import: type, is_standard
845842 @export(xf80_fn, .{ .name = xf80_name, .linkage = linkage });
846843 @export(quad_fn, .{ .name = quad_name, .linkage = linkage });
847844
845 if (is_test) return;
846
848847 const pairs = .{
849848 .{ f16, half_fn },
850849 .{ f32, float_fn },
......@@ -864,6 +863,11 @@ inline fn mathExport(double_name: []const u8, comptime import: type, is_standard
864863 }
865864 }
866865 }
866
867 if (is_ppc and is_standard) {
868 // LLVM PPC backend lowers f128 ops with the suffix `f128` instead of `l`.
869 @export(quad_fn, .{ .name = double_name ++ "f128", .linkage = linkage });
870 }
867871}
868872
869873// Avoid dragging in the runtime safety mechanisms into this .o file,