about summary refs log tree commit diff
path: root/compiler/rustc_target/src/asm
diff options
context:
space:
mode:
authorbeetrees <b@beetr.ee>2024-06-15 22:30:25 +0100
committerbeetrees <b@beetr.ee>2024-06-21 18:48:20 +0100
commit771e44ebd32df8e342efa1f246f5d5070af04ec4 (patch)
tree3f86a9e6e35a9a580a773337831d7fe8bbb6b06d /compiler/rustc_target/src/asm
parent92af831290cf60434aa44ba7c6a5171ec48e98be (diff)
Add `f16` inline ASM support for RISC-V
Diffstat (limited to 'compiler/rustc_target/src/asm')
-rw-r--r--compiler/rustc_target/src/asm/riscv.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_target/src/asm/riscv.rs b/compiler/rustc_target/src/asm/riscv.rs
index 3845a0e14af..02a4a5e2ece 100644
--- a/compiler/rustc_target/src/asm/riscv.rs
+++ b/compiler/rustc_target/src/asm/riscv.rs
@@ -40,12 +40,13 @@ impl RiscVInlineAsmRegClass {
         match self {
             Self::reg => {
                 if arch == InlineAsmArch::RiscV64 {
-                    types! { _: I8, I16, I32, I64, F32, F64; }
+                    types! { _: I8, I16, I32, I64, F16, F32, F64; }
                 } else {
-                    types! { _: I8, I16, I32, F32; }
+                    types! { _: I8, I16, I32, F16, F32; }
                 }
             }
-            Self::freg => types! { f: F32; d: F64; },
+            // FIXME(f16_f128): Add `q: F128;` once LLVM support the `Q` extension.
+            Self::freg => types! { f: F16, F32; d: F64; },
             Self::vreg => &[],
         }
     }