Skip to content

Commit 55cfa4b

Browse files
committed
Add supported asm types for LoongArch32
1 parent 7c10378 commit 55cfa4b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

compiler/rustc_target/src/asm/loongarch.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@ impl LoongArchInlineAsmRegClass {
3434

3535
pub fn supported_types(
3636
self,
37-
_arch: InlineAsmArch,
37+
arch: InlineAsmArch,
3838
) -> &'static [(InlineAsmType, Option<Symbol>)] {
3939
match self {
40-
Self::reg => types! { _: I8, I16, I32, I64, F32, F64; },
40+
Self::reg => {
41+
if arch == InlineAsmArch::LoongArch64 {
42+
types! { _: I8, I16, I32, I64, F32, F64; }
43+
} else {
44+
types! { _: I8, I16, I32, F32; }
45+
}
46+
}
4147
Self::freg => types! { f: F32; d: F64; },
4248
}
4349
}

src/doc/unstable-book/src/language-features/asm-experimental-arch.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
9191
| CSKY | `freg` | None | `f32`, |
9292
| SPARC | `reg` | None | `i8`, `i16`, `i32`, `i64` (SPARC64 only) |
9393
| SPARC | `yreg` | N/A | Only clobbers |
94+
| LoongArch32 | `reg` | None | `i8`, `i16`, `i32`, `f32` |
95+
| LoongArch32 | `freg` | None | `f32`, `f64` |
9496

9597
## Register aliases
9698

0 commit comments

Comments
 (0)