diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-11-22 23:33:58 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-11-22 23:33:58 -0700 |
| commit | 4ec27a4e2508049ce0d9b6e3cc149c0403c7014b (patch) | |
| tree | 381f694dba4cd63b6de67ef3902e2bf54826fc85 /src/target.zig | |
| parent | 0b28133ec239d62fc0df7460ac8b8e12b08ee88f (diff) | |
| download | zig-4ec27a4e2508049ce0d9b6e3cc149c0403c7014b.tar.gz zig-4ec27a4e2508049ce0d9b6e3cc149c0403c7014b.zip | |
C backend: implement vector reduce and overflow intrinsics
Diffstat (limited to 'src/target.zig')
| -rw-r--r-- | src/target.zig | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/target.zig b/src/target.zig index 90cc50db23..debcfb3776 100644 --- a/src/target.zig +++ b/src/target.zig @@ -729,3 +729,43 @@ pub fn supportsTailCall(target: std.Target, backend: std.builtin.CompilerBackend else => return false, } } + +pub fn libcFloatPrefix(float_bits: u16) []const u8 { + return switch (float_bits) { + 16, 80 => "__", + 32, 64, 128 => "", + else => unreachable, + }; +} + +pub fn libcFloatSuffix(float_bits: u16) []const u8 { + return switch (float_bits) { + 16 => "h", // Non-standard + 32 => "f", + 64 => "", + 80 => "x", // Non-standard + 128 => "q", // Non-standard (mimics convention in GCC libquadmath) + else => unreachable, + }; +} + +pub fn compilerRtFloatAbbrev(float_bits: u16) []const u8 { + return switch (float_bits) { + 16 => "h", + 32 => "s", + 64 => "d", + 80 => "x", + 128 => "t", + else => unreachable, + }; +} + +pub fn compilerRtIntAbbrev(bits: u16) []const u8 { + return switch (bits) { + 16 => "h", + 32 => "s", + 64 => "d", + 128 => "t", + else => "o", // Non-standard + }; +} |
