Skip to content

Commit 48101ed

Browse files
[AArch64] Fix syntax of gcsstr and gcssttr instructions (#82385)
The address register should be surrounded by square brackets, like in all the other str instructions. Fixes #81846
1 parent 91f1161 commit 48101ed

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ def : InstAlias<"chkfeat\tx16", (CHKFEAT), 0>;
12431243
def : InstAlias<"chkfeat\tx16", (CHKFEAT), 1>, Requires<[HasCHK]>;
12441244

12451245
class GCSSt<string mnemonic, bits<3> op>
1246-
: I<(outs), (ins GPR64:$Rt, GPR64sp:$Rn), mnemonic, "\t$Rt, $Rn", "", []>, Sched<[]> {
1246+
: I<(outs), (ins GPR64:$Rt, GPR64sp:$Rn), mnemonic, "\t$Rt, [$Rn]", "", []>, Sched<[]> {
12471247
bits<5> Rt;
12481248
bits<5> Rn;
12491249
let Inst{31-15} = 0b11011001000111110;

llvm/test/MC/AArch64/armv9.4a-gcs.s

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@ hint #19
8686
// ERROR-NO-GCS-NOT: [[@LINE-2]]:1: error: instruction requires: gcs
8787
// NO-GCS: hint #19 // encoding: [0x7f,0x22,0x03,0xd5]
8888

89-
gcsstr x26, x27
90-
// CHECK: gcsstr x26, x27 // encoding: [0x7a,0x0f,0x1f,0xd9]
89+
gcsstr x26, [x27]
90+
// CHECK: gcsstr x26, [x27] // encoding: [0x7a,0x0f,0x1f,0xd9]
9191
// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
9292

93-
gcsstr x26, sp
94-
// CHECK: gcsstr x26, sp // encoding: [0xfa,0x0f,0x1f,0xd9]
93+
gcsstr x26, [sp]
94+
// CHECK: gcsstr x26, [sp] // encoding: [0xfa,0x0f,0x1f,0xd9]
9595
// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
9696

97-
gcssttr x26, x27
98-
// CHECK: gcssttr x26, x27 // encoding: [0x7a,0x1f,0x1f,0xd9]
97+
gcssttr x26, [x27]
98+
// CHECK: gcssttr x26, [x27] // encoding: [0x7a,0x1f,0x1f,0xd9]
9999
// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
100100

101-
gcssttr x26, sp
102-
// CHECK: gcssttr x26, sp // encoding: [0xfa,0x1f,0x1f,0xd9]
101+
gcssttr x26, [sp]
102+
// CHECK: gcssttr x26, [sp] // encoding: [0xfa,0x1f,0x1f,0xd9]
103103
// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
104104

105105
gcspushx

llvm/test/MC/Disassembler/AArch64/armv9.4a-gcs.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@
6969
// CHECK: gcsb dsync
7070

7171
[0x7a,0x0f,0x1f,0xd9]
72-
// CHECK: gcsstr x26, x27
72+
// CHECK: gcsstr x26, [x27]
7373

7474
[0xfa,0x0f,0x1f,0xd9]
75-
// CHECK: gcsstr x26, sp
75+
// CHECK: gcsstr x26, [sp]
7676

7777
[0x7a,0x1f,0x1f,0xd9]
78-
// CHECK: gcssttr x26, x27
78+
// CHECK: gcssttr x26, [x27]
7979

8080
[0xfa,0x1f,0x1f,0xd9]
81-
// CHECK: gcssttr x26, sp
81+
// CHECK: gcssttr x26, [sp]
8282

8383
[0x9f,0x77,0x08,0xd5]
8484
// CHECK: gcspushx

0 commit comments

Comments
 (0)