authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-06 11:48:05+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-15 19:29:56+02:00
log958f57d65d6c612a391bc72a5cf090c9efc9917b
treef7fccca50112d391ec21df7ea229b4954a63a58d
parent3550cacd73b40cea5cfe3d9613bb4f80b5d42417
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

llvm: Enable native f16 lowering for riscv32.


1 files changed, 6 insertions(+), 6 deletions(-)

src/codegen/llvm.zig+6-6
......@@ -12419,7 +12419,8 @@ fn isScalar(zcu: *Zcu, ty: Type) bool {
1241912419}
1242012420
1242112421/// This function returns true if we expect LLVM to lower x86_fp80 correctly
12422/// and false if we expect LLVM to crash if it counters an x86_fp80 type.
12422/// and false if we expect LLVM to crash if it encounters an x86_fp80 type,
12423/// or if it produces miscompilations.
1242312424fn backendSupportsF80(target: std.Target) bool {
1242412425 return switch (target.cpu.arch) {
1242512426 .x86_64, .x86 => !std.Target.x86.featureSetHas(target.cpu.features, .soft_float),
......@@ -12428,8 +12429,8 @@ fn backendSupportsF80(target: std.Target) bool {
1242812429}
1242912430
1243012431/// This function returns true if we expect LLVM to lower f16 correctly
12431/// and false if we expect LLVM to crash if it counters an f16 type or
12432/// if it produces miscompilations.
12432/// and false if we expect LLVM to crash if it encounters an f16 type,
12433/// or if it produces miscompilations.
1243312434fn backendSupportsF16(target: std.Target) bool {
1243412435 return switch (target.cpu.arch) {
1243512436 .hexagon,
......@@ -12443,7 +12444,6 @@ fn backendSupportsF16(target: std.Target) bool {
1244312444 .mipsel,
1244412445 .mips64,
1244512446 .mips64el,
12446 .riscv32,
1244712447 .s390x,
1244812448 => false,
1244912449 .arm,
......@@ -12459,7 +12459,7 @@ fn backendSupportsF16(target: std.Target) bool {
1245912459}
1246012460
1246112461/// This function returns true if we expect LLVM to lower f128 correctly,
12462/// and false if we expect LLVm to crash if it encounters and f128 type
12462/// and false if we expect LLVM to crash if it encounters an f128 type,
1246312463/// or if it produces miscompilations.
1246412464fn backendSupportsF128(target: std.Target) bool {
1246512465 return switch (target.cpu.arch) {
......@@ -12486,7 +12486,7 @@ fn backendSupportsF128(target: std.Target) bool {
1248612486}
1248712487
1248812488/// LLVM does not support all relevant intrinsics for all targets, so we
12489/// may need to manually generate a libc call
12489/// may need to manually generate a compiler-rt call.
1249012490fn intrinsicsAllowed(scalar_ty: Type, target: std.Target) bool {
1249112491 return switch (scalar_ty.toIntern()) {
1249212492 .f16_type => backendSupportsF16(target),