Skip to content

Commit 114e418

Browse files
committed
fixup! [AArch64][llvm] Add instructions for FEAT_MOPS_GO
Adjust assembly so that `Rm` is ignored, since it is always 0b11111.
1 parent e7544d4 commit 114e418

File tree

3 files changed

+72
-85
lines changed

3 files changed

+72
-85
lines changed

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12621,6 +12621,13 @@ class MOPSMemorySet<bits<2> opcode, bit op1, bit op2, bit op3, string asm>
1262112621
class MOPSMemorySetTagging<bits<2> opcode, bit op1, bit op2, bit op3, string asm>
1262212622
: MOPSMemorySetBase<1, opcode, op1, op2, op3, asm>;
1262312623

12624+
class MOPSGoMemorySetTagging<bits<2> opcode, bit op1, bit op2, bit op3, string asm>
12625+
: MOPSMemorySetBase<1, opcode, op1, op2, op3, asm> {
12626+
// No `Rm` operand is required, as all bits are set to 1
12627+
let AsmString = !strconcat(asm, "\t[$Rd]!, $Rn!");
12628+
let Inst{20-16} = 0b11111;
12629+
}
12630+
1262412631
multiclass MOPSMemoryCopyInsns<bits<2> opcode, string asm> {
1262512632
def "" : MOPSMemoryCopy<opcode, 0b00, 0b00, asm>;
1262612633
def WN : MOPSMemoryCopy<opcode, 0b00, 0b01, asm # "wn">;
@@ -12677,10 +12684,10 @@ multiclass MOPSMemorySetTaggingInsns<bits<2> opcode, string asm> {
1267712684
// MOPS Granule Only - FEAT_MOPS_GO
1267812685
//----------------------------------------------------------------------------
1267912686
multiclass MOPSGoMemorySetTaggingInsns<bits<2> opcode, string asm> {
12680-
def "" : MOPSMemorySetTagging<opcode, 0, 0, 0, asm>;
12681-
def T : MOPSMemorySetTagging<opcode, 1, 0, 0, asm # "t">;
12682-
def N : MOPSMemorySetTagging<opcode, 0, 1, 0, asm # "n">;
12683-
def TN : MOPSMemorySetTagging<opcode, 1, 1, 0, asm # "tn">;
12687+
def "" : MOPSGoMemorySetTagging<opcode, 0, 0, 0, asm>;
12688+
def T : MOPSGoMemorySetTagging<opcode, 1, 0, 0, asm # "t">;
12689+
def N : MOPSGoMemorySetTagging<opcode, 0, 1, 0, asm # "n">;
12690+
def TN : MOPSGoMemorySetTagging<opcode, 1, 1, 0, asm # "tn">;
1268412691
}
1268512692

1268612693
//----------------------------------------------------------------------------
Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,36 @@
11
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+mops-go,+mte < %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
22

3-
// All operand must be different from each other
3+
// Operands must be different from each other
44

55
// CHECK-ERROR: error: invalid SET instruction, destination and size registers are the same
6-
// CHECK-ERROR: error: invalid SET instruction, destination and source registers are the same
7-
// CHECK-ERROR: error: invalid SET instruction, source and size registers are the same
8-
setgop [x0]!, x0!, x1
9-
setgop [x0]!, x1!, x0
10-
setgop [x1]!, x0!, x0
11-
126
// CHECK-ERROR: error: invalid SET instruction, destination and size registers are the same
13-
// CHECK-ERROR: error: invalid SET instruction, destination and source registers are the same
14-
// CHECK-ERROR: error: invalid SET instruction, source and size registers are the same
15-
setgom [x0]!, x0!, x1
16-
setgom [x0]!, x1!, x0
17-
setgom [x1]!, x0!, x0
18-
197
// CHECK-ERROR: error: invalid SET instruction, destination and size registers are the same
20-
// CHECK-ERROR: error: invalid SET instruction, destination and source registers are the same
21-
// CHECK-ERROR: error: invalid SET instruction, source and size registers are the same
22-
setgoe [x0]!, x0!, x1
23-
setgoe [x0]!, x1!, x0
24-
setgoe [x1]!, x0!, x0
8+
setgop [x0]!, x0!
9+
setgom [x0]!, x0!
10+
setgoe [x0]!, x0!
2511

2612
// SP cannot be used as argument at any position
2713

2814
// CHECK-ERROR: error: invalid operand for instruction
2915
// CHECK-ERROR: error: invalid operand for instruction
30-
// CHECK-ERROR: error: invalid operand for instruction
31-
setgop [sp]!, x1!, x2
32-
setgop [x0]!, sp!, x2
33-
setgop [x0]!, x1!, sp
16+
setgop [sp]!, x1!
17+
setgop [x0]!, sp!
3418

3519
// CHECK-ERROR: error: invalid operand for instruction
3620
// CHECK-ERROR: error: invalid operand for instruction
37-
// CHECK-ERROR: error: invalid operand for instruction
38-
setgom [sp]!, x1!, x2
39-
setgom [x0]!, sp!, x2
40-
setgom [x0]!, x1!, sp
21+
setgom [sp]!, x1!
22+
setgom [x0]!, sp!
4123

4224
// CHECK-ERROR: error: invalid operand for instruction
4325
// CHECK-ERROR: error: invalid operand for instruction
44-
// CHECK-ERROR: error: invalid operand for instruction
45-
setgoe [sp]!, x1!, x2
46-
setgoe [x0]!, sp!, x2
47-
setgoe [x0]!, x1!, sp
26+
setgoe [sp]!, x1!
27+
setgoe [x0]!, sp!
4828

4929
// CHECK-ERROR: error: invalid operand for instruction
50-
setgop [xzr]!, x1!, x2
30+
setgop [xzr]!, x1!
5131

5232
// CHECK-ERROR: error: invalid operand for instruction
53-
setgom [xzr]!, x1!, x2
33+
setgom [xzr]!, x1!
5434

5535
// CHECK-ERROR: error: invalid operand for instruction
56-
setgoe [xzr]!, x1!, x2
36+
setgoe [xzr]!, x1!

llvm/test/MC/AArch64/arm-mops-go.s

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,74 +16,74 @@
1616
// FEAT_MOPS_GO Extension instructions
1717
//------------------------------------------------------------------------------
1818

19-
setgop [x3]!, x2!, x1
20-
// CHECK-INST: setgop [x3]!, x2!, x1
21-
// CHECK-ENCODING: [0x43,0x00,0xc1,0x1d]
22-
// CHECK-UNKNOWN: 1dc10043
19+
setgop [x3]!, x2!
20+
// CHECK-INST: setgop [x3]!, x2!
21+
// CHECK-ENCODING: [0x43,0x00,0xdf,0x1d]
22+
// CHECK-UNKNOWN: 1ddf0043
2323
// CHECK-ERROR: instruction requires: mops-go mte
2424

25-
setgom [x3]!, x2!, x1
26-
// CHECK-INST: setgom [x3]!, x2!, x1
27-
// CHECK-ENCODING: [0x43,0x40,0xc1,0x1d]
28-
// CHECK-UNKNOWN: 1dc14043
25+
setgom [x3]!, x2!
26+
// CHECK-INST: setgom [x3]!, x2!
27+
// CHECK-ENCODING: [0x43,0x40,0xdf,0x1d]
28+
// CHECK-UNKNOWN: 1ddf4043
2929
// CHECK-ERROR: instruction requires: mops-go mte
3030

31-
setgoe [x3]!, x2!, x1
32-
// CHECK-INST: setgoe [x3]!, x2!, x1
33-
// CHECK-ENCODING: [0x43,0x80,0xc1,0x1d]
34-
// CHECK-UNKNOWN: 1dc18043
31+
setgoe [x3]!, x2!
32+
// CHECK-INST: setgoe [x3]!, x2!
33+
// CHECK-ENCODING: [0x43,0x80,0xdf,0x1d]
34+
// CHECK-UNKNOWN: 1ddf8043
3535
// CHECK-ERROR: instruction requires: mops-go mte
3636

37-
setgopn [x3]!, x2!, x1
38-
// CHECK-INST: setgopn [x3]!, x2!, x1
39-
// CHECK-ENCODING: [0x43,0x20,0xc1,0x1d]
40-
// CHECK-UNKNOWN: 1dc12043
37+
setgopn [x3]!, x2!
38+
// CHECK-INST: setgopn [x3]!, x2!
39+
// CHECK-ENCODING: [0x43,0x20,0xdf,0x1d]
40+
// CHECK-UNKNOWN: 1ddf2043
4141
// CHECK-ERROR: instruction requires: mops-go mte
4242

43-
setgomn [x3]!, x2!, x1
44-
// CHECK-INST: setgomn [x3]!, x2!, x1
45-
// CHECK-ENCODING: [0x43,0x60,0xc1,0x1d]
46-
// CHECK-UNKNOWN: 1dc16043
43+
setgomn [x3]!, x2!
44+
// CHECK-INST: setgomn [x3]!, x2!
45+
// CHECK-ENCODING: [0x43,0x60,0xdf,0x1d]
46+
// CHECK-UNKNOWN: 1ddf6043
4747
// CHECK-ERROR: instruction requires: mops-go mte
4848

49-
setgoen [x3]!, x2!, x1
50-
// CHECK-INST: setgoen [x3]!, x2!, x1
51-
// CHECK-ENCODING: [0x43,0xa0,0xc1,0x1d]
52-
// CHECK-UNKNOWN: 1dc1a043
49+
setgoen [x3]!, x2!
50+
// CHECK-INST: setgoen [x3]!, x2!
51+
// CHECK-ENCODING: [0x43,0xa0,0xdf,0x1d]
52+
// CHECK-UNKNOWN: 1ddfa043
5353
// CHECK-ERROR: instruction requires: mops-go mte
5454

55-
setgopt [x3]!, x2!, x1
56-
// CHECK-INST: setgopt [x3]!, x2!, x1
57-
// CHECK-ENCODING: [0x43,0x10,0xc1,0x1d]
58-
// CHECK-UNKNOWN: 1dc11043
55+
setgopt [x3]!, x2!
56+
// CHECK-INST: setgopt [x3]!, x2!
57+
// CHECK-ENCODING: [0x43,0x10,0xdf,0x1d]
58+
// CHECK-UNKNOWN: 1ddf1043
5959
// CHECK-ERROR: instruction requires: mops-go mte
6060

61-
setgomt [x3]!, x2!, x1
62-
// CHECK-INST: setgomt [x3]!, x2!, x1
63-
// CHECK-ENCODING: [0x43,0x50,0xc1,0x1d]
64-
// CHECK-UNKNOWN: 1dc15043
61+
setgomt [x3]!, x2!
62+
// CHECK-INST: setgomt [x3]!, x2!
63+
// CHECK-ENCODING: [0x43,0x50,0xdf,0x1d]
64+
// CHECK-UNKNOWN: 1ddf5043
6565
// CHECK-ERROR: instruction requires: mops-go mte
6666

67-
setgoet [x3]!, x2!, x1
68-
// CHECK-INST: setgoet [x3]!, x2!, x1
69-
// CHECK-ENCODING: [0x43,0x90,0xc1,0x1d]
70-
// CHECK-UNKNOWN: 1dc19043
67+
setgoet [x3]!, x2!
68+
// CHECK-INST: setgoet [x3]!, x2!
69+
// CHECK-ENCODING: [0x43,0x90,0xdf,0x1d]
70+
// CHECK-UNKNOWN: 1ddf9043
7171
// CHECK-ERROR: instruction requires: mops-go mte
7272

73-
setgoptn [x3]!, x2!, x1
74-
// CHECK-INST: setgoptn [x3]!, x2!, x1
75-
// CHECK-ENCODING: [0x43,0x30,0xc1,0x1d]
76-
// CHECK-UNKNOWN: 1dc13043
73+
setgoptn [x3]!, x2!
74+
// CHECK-INST: setgoptn [x3]!, x2!
75+
// CHECK-ENCODING: [0x43,0x30,0xdf,0x1d]
76+
// CHECK-UNKNOWN: 1ddf3043
7777
// CHECK-ERROR: instruction requires: mops-go mte
7878

79-
setgomtn [x3]!, x2!, x1
80-
// CHECK-INST: setgomtn [x3]!, x2!, x1
81-
// CHECK-ENCODING: [0x43,0x70,0xc1,0x1d]
82-
// CHECK-UNKNOWN: 1dc17043
79+
setgomtn [x3]!, x2!
80+
// CHECK-INST: setgomtn [x3]!, x2!
81+
// CHECK-ENCODING: [0x43,0x70,0xdf,0x1d]
82+
// CHECK-UNKNOWN: 1ddf7043
8383
// CHECK-ERROR: instruction requires: mops-go mte
8484

85-
setgoetn [x3]!, x2!, x1
86-
// CHECK-INST: setgoetn [x3]!, x2!, x1
87-
// CHECK-ENCODING: [0x43,0xb0,0xc1,0x1d]
88-
// CHECK-UNKNOWN: 1dc1b043
85+
setgoetn [x3]!, x2!
86+
// CHECK-INST: setgoetn [x3]!, x2!
87+
// CHECK-ENCODING: [0x43,0xb0,0xdf,0x1d]
88+
// CHECK-UNKNOWN: 1ddfb043
8989
// CHECK-ERROR: instruction requires: mops-go mte

0 commit comments

Comments
 (0)