Skip to content

Commit 23f3bff

Browse files
authored
[AArch64] make REVD non-MOVPRFXable (#114430)
This patch updates REVD instruction and makes it non-MOVPRFXable as per https://developer.arm.com/documentation/ddi0602/2024-06/SVE-Instructions/REVD--Reverse-64-bit-doublewords-in-elements--predicated--?lang=en
1 parent 93cda6d commit 23f3bff

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

llvm/lib/Target/AArch64/SMEInstrFormats.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,8 +1429,6 @@ class sve2_int_perm_revd<string asm>
14291429
let Inst{4-0} = Zd;
14301430

14311431
let Constraints = "$Zd = $_Zd";
1432-
let DestructiveInstType = DestructiveUnary;
1433-
let ElementSize = ZPR128.ElementSize;
14341432
}
14351433

14361434
multiclass sve2_int_perm_revd<string asm, SDPatternOperator op> {

llvm/test/MC/AArch64/SME/revd-diagnostics.s

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@ revd z0.q, p0/m, z0.s
2727
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
2828
// CHECK-NEXT: revd z0.q, p0/m, z0.s
2929
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
30+
31+
// --------------------------------------------------------------------------//
32+
// Negative tests for instructions that are incompatible with movprfx
33+
34+
movprfx z21, z25
35+
revd z21.q, p5/m, z10.q
36+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
37+
// CHECK-NEXT: revd z21.q, p5/m, z10.q
38+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

llvm/test/MC/AArch64/SME/revd.s

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,4 @@ revd z31.q, p7/m, z31.q
3434
// CHECK-INST: revd z31.q, p7/m, z31.q
3535
// CHECK-ENCODING: [0xff,0x9f,0x2e,0x05]
3636
// CHECK-ERROR: instruction requires: sme
37-
// CHECK-UNKNOWN: 052e9fff <unknown>
38-
39-
// --------------------------------------------------------------------------//
40-
// Test compatibility with MOVPRFX instruction.
41-
42-
movprfx z21, z25
43-
// CHECK-INST: movprfx z21, z25
44-
// CHECK-ENCODING: [0x35,0xbf,0x20,0x04]
45-
// CHECK-ERROR: instruction requires: sve or sme
46-
// CHECK-UNKNOWN: 0420bf35 <unknown>
47-
48-
revd z21.q, p5/m, z10.q
49-
// CHECK-INST: revd z21.q, p5/m, z10.q
50-
// CHECK-ENCODING: [0x55,0x95,0x2e,0x05]
51-
// CHECK-ERROR: instruction requires: sme
52-
// CHECK-UNKNOWN: 052e9555 <unknown>
37+
// CHECK-UNKNOWN: 052e9fff <unknown>

0 commit comments

Comments
 (0)