-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add supported asm types for LoongArch32 #142248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
) -> &'static [(InlineAsmType, Option<Symbol>)] { | ||
match self { | ||
Self::reg => types! { _: I8, I16, I32, I64, F32, F64; }, | ||
Self::reg => { | ||
if arch == InlineAsmArch::LoongArch64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make this an exhaustive match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -91,6 +91,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect | |||
| CSKY | `freg` | None | `f32`, | | |||
| SPARC | `reg` | None | `i8`, `i16`, `i32`, `i64` (SPARC64 only) | | |||
| SPARC | `yreg` | N/A | Only clobbers | | |||
| LoongArch32 | `reg` | None | `i8`, `i16`, `i32`, `f32` | | |||
| LoongArch32 | `freg` | None | `f32`, `f64` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code above reference LoongArch64
but this table doesn't. Is that a mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add LoongArch32 to the table above?
The code above reference
LoongArch64
but this table doesn't. Is that a mistake?
LoongArch64 assembly is already stable. This PR adds it for LoongArch32.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
types! { _: I8, I16, I32, I64, F32, F64; } | ||
} else { | ||
types! { _: I8, I16, I32, F32; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not something to do here, but as a note f16
could probably get allowed in GPRs at some point (maybe also fregs? Not sure what the ABI status is), cc #125398.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll submit a separate PR to add support for types like f16
for both LoongArch32 and LoongArch64.
55cfa4b
to
28c06c4
Compare
(Self::reg, InlineAsmArch::LoongArch64) => types! { _: I8, I16, I32, I64, F32, F64; }, | ||
(Self::reg, InlineAsmArch::LoongArch32) => types! { _: I8, I16, I32, F32; }, | ||
(Self::freg, _) => types! { f: F32; d: F64; }, | ||
_ => unimplemented!("unsupported register class"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be unreachable!
instead of unimplemented!
.
28c06c4
to
de8a91b
Compare
@bors r+ rollup |
Add supported asm types for LoongArch32 r? `@Amanieu`
Rollup of 13 pull requests Successful merges: - #128425 (Make `missing_fragment_specifier` an unconditional error) - #141639 (Expose discriminant values in stable_mir) - #141967 (Configure bootstrap backport nominations through triagebot) - #142042 (Make E0621 missing lifetime suggestion verbose) - #142176 (tests: Split dont-shuffle-bswaps along opt-levels and arches) - #142235 (Build rustc with assertions in `dist-alt` jobs) - #142248 (Add supported asm types for LoongArch32) - #142272 (tests: Change ABIs in tests to more future-resilient ones) - #142282 (Only run `citool` tests on the `auto` branch) - #142285 (tests: Do not run afoul of asm.validity.non-exhaustive in input-stats) - #142297 (Implement `//@ needs-target-std` compiletest directive) - #142298 (Make loongarch-none target maintainers more easily pingable) - #142306 (Dont unwrap and re-wrap typing envs) Failed merges: - #141942 (Implement representation options to smir) r? `@ghost` `@rustbot` modify labels: rollup
Add supported asm types for LoongArch32 r? ``@Amanieu``
Add supported asm types for LoongArch32 r? ```@Amanieu```
Rollup of 13 pull requests Successful merges: - #134841 (Look at proc-macro attributes when encountering unknown attribute) - #141639 (Expose discriminant values in stable_mir) - #141967 (Configure bootstrap backport nominations through triagebot) - #142042 (Make E0621 missing lifetime suggestion verbose) - #142176 (tests: Split dont-shuffle-bswaps along opt-levels and arches) - #142248 (Add supported asm types for LoongArch32) - #142272 (tests: Change ABIs in tests to more future-resilient ones) - #142282 (Only run `citool` tests on the `auto` branch) - #142297 (Implement `//@ needs-target-std` compiletest directive) - #142298 (Make loongarch-none target maintainers more easily pingable) - #142306 (Dont unwrap and re-wrap typing envs) - #142324 (Remove unneeded `FunctionCx` from some codegen methods) - #142328 (feat: Add `bit_width` for unsigned integer types) r? `@ghost` `@rustbot` modify labels: rollup
Add supported asm types for LoongArch32 r? ````@Amanieu````
Add supported asm types for LoongArch32 r? `````@Amanieu`````
r? @Amanieu