diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-11 23:31:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-11 23:31:49 +0100 |
| commit | 443ed7c6203608def39739b21a50a8e7a0f4e428 (patch) | |
| tree | 86e3b56cc886cb428cc8c146f51ea56e79d3a3dd /src | |
| parent | 9383a49cd470d6456199cf1900a4bfbdb95ffa02 (diff) | |
| parent | 17766f88ff4661fc25d4c86ae15e187200be74fc (diff) | |
| download | rust-443ed7c6203608def39739b21a50a8e7a0f4e428.tar.gz rust-443ed7c6203608def39739b21a50a8e7a0f4e428.zip | |
Rollup merge of #91643 - Amanieu:r9x18, r=joshtriplett
asm: Allow using r9 (ARM) and x18 (AArch64) if they are not reserved by the current target This supersedes https://github.com/rust-lang/rust/pull/88879. cc `@Skirmisher` r? `@joshtriplett`
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/asm/aarch64/bad-reg.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/asm/aarch64/bad-reg.stderr | 28 |
2 files changed, 11 insertions, 19 deletions
diff --git a/src/test/ui/asm/aarch64/bad-reg.rs b/src/test/ui/asm/aarch64/bad-reg.rs index 4d7a7fd31fe..e346f8d992a 100644 --- a/src/test/ui/asm/aarch64/bad-reg.rs +++ b/src/test/ui/asm/aarch64/bad-reg.rs @@ -29,8 +29,6 @@ fn main() { //~^ ERROR invalid register `sp`: the stack pointer cannot be used as an operand asm!("", in("xzr") foo); //~^ ERROR invalid register `xzr`: the zero register cannot be used as an operand - asm!("", in("x18") foo); - //~^ ERROR invalid register `x18`: x18 is used as a reserved register on some targets and cannot be used as an operand for inline asm asm!("", in("x19") foo); //~^ ERROR invalid register `x19`: x19 is used internally by LLVM and cannot be used as an operand for inline asm diff --git a/src/test/ui/asm/aarch64/bad-reg.stderr b/src/test/ui/asm/aarch64/bad-reg.stderr index 091e6077ef4..42f2a5d72ec 100644 --- a/src/test/ui/asm/aarch64/bad-reg.stderr +++ b/src/test/ui/asm/aarch64/bad-reg.stderr @@ -74,38 +74,32 @@ error: invalid register `xzr`: the zero register cannot be used as an operand fo LL | asm!("", in("xzr") foo); | ^^^^^^^^^^^^^ -error: invalid register `x18`: x18 is used as a reserved register on some targets and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:32:18 - | -LL | asm!("", in("x18") foo); - | ^^^^^^^^^^^^^ - error: invalid register `x19`: x19 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:34:18 + --> $DIR/bad-reg.rs:32:18 | LL | asm!("", in("x19") foo); | ^^^^^^^^^^^^^ error: register class `preg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:37:18 + --> $DIR/bad-reg.rs:35:18 | LL | asm!("", in("p0") foo); | ^^^^^^^^^^^^ error: register class `preg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:40:20 + --> $DIR/bad-reg.rs:38:20 | LL | asm!("{}", in(preg) foo); | ^^^^^^^^^^^^ error: register class `preg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:42:20 + --> $DIR/bad-reg.rs:40:20 | LL | asm!("{}", out(preg) _); | ^^^^^^^^^^^ error: register `x0` conflicts with register `x0` - --> $DIR/bad-reg.rs:48:32 + --> $DIR/bad-reg.rs:46:32 | LL | asm!("", in("x0") foo, in("w0") bar); | ------------ ^^^^^^^^^^^^ register `x0` @@ -113,7 +107,7 @@ LL | asm!("", in("x0") foo, in("w0") bar); | register `x0` error: register `x0` conflicts with register `x0` - --> $DIR/bad-reg.rs:50:32 + --> $DIR/bad-reg.rs:48:32 | LL | asm!("", in("x0") foo, out("x0") bar); | ------------ ^^^^^^^^^^^^^ register `x0` @@ -121,13 +115,13 @@ LL | asm!("", in("x0") foo, out("x0") bar); | register `x0` | help: use `lateout` instead of `out` to avoid conflict - --> $DIR/bad-reg.rs:50:18 + --> $DIR/bad-reg.rs:48:18 | LL | asm!("", in("x0") foo, out("x0") bar); | ^^^^^^^^^^^^ error: register `v0` conflicts with register `v0` - --> $DIR/bad-reg.rs:53:32 + --> $DIR/bad-reg.rs:51:32 | LL | asm!("", in("v0") foo, in("q0") bar); | ------------ ^^^^^^^^^^^^ register `v0` @@ -135,7 +129,7 @@ LL | asm!("", in("v0") foo, in("q0") bar); | register `v0` error: register `v0` conflicts with register `v0` - --> $DIR/bad-reg.rs:55:32 + --> $DIR/bad-reg.rs:53:32 | LL | asm!("", in("v0") foo, out("q0") bar); | ------------ ^^^^^^^^^^^^^ register `v0` @@ -143,10 +137,10 @@ LL | asm!("", in("v0") foo, out("q0") bar); | register `v0` | help: use `lateout` instead of `out` to avoid conflict - --> $DIR/bad-reg.rs:55:18 + --> $DIR/bad-reg.rs:53:18 | LL | asm!("", in("v0") foo, out("q0") bar); | ^^^^^^^^^^^^ -error: aborting due to 19 previous errors +error: aborting due to 18 previous errors |
