diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-11-30 12:56:53 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-30 12:56:53 +0800 |
| commit | ab4588a6190de24118bdab0f2a182736484a2b68 (patch) | |
| tree | a6f843d203716312b91c936f0de576d2cb052a40 /tests/coverage/branch/lazy-boolean.rs | |
| parent | 70e71f570dc8c88cdaf0f7341ab6543ab720c5b5 (diff) | |
| parent | 0c8e36bb3052b217aebcd8bd2154cc31618caf4f (diff) | |
| download | rust-ab4588a6190de24118bdab0f2a182736484a2b68.tar.gz rust-ab4588a6190de24118bdab0f2a182736484a2b68.zip | |
Rollup merge of #133587 - taiki-e:loongarch-asm-freg, r=Amanieu
Fix target_feature handling in freg of LoongArch inline assembly
In LoongArch inline assembly, freg currently always accepts f32/f64 as input/output.
https://github.com/rust-lang/rust/blob/9b4d7c6a40b328d212095c28670c629facf1557d/compiler/rustc_target/src/asm/loongarch.rs#L41
However, these types actually require f/d target features as in RISC-V.
Otherwise, an (ugly) compile error will occur: https://godbolt.org/z/K61Gq1E9E
f32/f64 without f:
```
error: couldn't allocate output register for constraint '{$f1}'
--> <source>:12:11
|
12 | asm!("", in("$f1") x, lateout("$f1") y);
| ^
```
f64 with f but without d:
```
error: scalar-to-vector conversion failed, possible invalid constraint for vector type
--> <source>:19:11
|
19 | asm!("", in("$f1") x, lateout("$f1") y);
| ^
```
cc ``@heiher``
r? ``@Amanieu``
``@rustbot`` label +O-LoongArch +A-inline-assembly
Diffstat (limited to 'tests/coverage/branch/lazy-boolean.rs')
0 files changed, 0 insertions, 0 deletions
