207 changes: 105 additions & 102 deletions llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-inline-asm.ll

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ define void @test2() #0 personality i32 (...)* @__gcc_personality_v0 {
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64common = COPY [[DEF]](p0)
; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 1703945 /* reguse:GPR64common */, [[COPY]]
; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 1769481 /* reguse:GPR64common */, [[COPY]]
; CHECK-NEXT: G_BR %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.a:
Expand Down
30 changes: 15 additions & 15 deletions llvm/test/CodeGen/AArch64/GlobalISel/regbank-inlineasm.mir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ body: |
bb.1:
; CHECK-LABEL: name: inlineasm_memory_clobber
; CHECK: INLINEASM &"", 25 /* sideeffect mayload maystore attdialect */
; CHECK: INLINEASM &"", 1 /* sideeffect attdialect */
; CHECK: RET_ReallyLR
; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
; CHECK-NEXT: RET_ReallyLR
INLINEASM &"", 25
INLINEASM &"", 1
RET_ReallyLR
Expand All @@ -26,7 +26,7 @@ body: |
bb.1:
; CHECK-LABEL: name: inlineasm_register_clobber
; CHECK: INLINEASM &"", 25 /* sideeffect mayload maystore attdialect */, 12 /* clobber */, implicit-def early-clobber $d0
; CHECK: RET_ReallyLR
; CHECK-NEXT: RET_ReallyLR
INLINEASM &"", 25, 12, implicit-def early-clobber $d0
RET_ReallyLR
...
Expand All @@ -40,9 +40,9 @@ body: |
bb.1:
; CHECK-LABEL: name: inlineasm_phys_reg_output
; CHECK: INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 10 /* regdef */, implicit-def $w0
; CHECK: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
; CHECK: $w0 = COPY [[COPY]](s32)
; CHECK: RET_ReallyLR implicit $w0
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
; CHECK-NEXT: $w0 = COPY [[COPY]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 10 /* regdef */, implicit-def $w0
%0:_(s32) = COPY $w0
$w0 = COPY %0(s32)
Expand All @@ -57,10 +57,10 @@ tracksRegLiveness: true
body: |
bb.1:
; CHECK-LABEL: name: inlineasm_virt_reg_output
; CHECK: INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 1310730 /* regdef:WSeqPairsClass_with_sube32_in_MatrixIndexGPR32_12_15 */, def %0
; CHECK: [[COPY:%[0-9]+]]:gpr(s32) = COPY %0
; CHECK: $w0 = COPY [[COPY]](s32)
; CHECK: RET_ReallyLR implicit $w0
; CHECK: INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 1310730 /* regdef:WSeqPairsClass_with_sube32_in_GPR32arg */, def %0
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr(s32) = COPY %0
; CHECK-NEXT: $w0 = COPY [[COPY]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 1310730 /* regdef:GPR32common */, def %0:gpr32common
%1:_(s32) = COPY %0
$w0 = COPY %1(s32)
Expand All @@ -75,11 +75,11 @@ tracksRegLiveness: true
body: |
bb.1:
; CHECK-LABEL: name: inlineasm_virt_mixed_types
; CHECK: INLINEASM &"mov $0, #0; mov $1, #0", 0 /* attdialect */, 1310730 /* regdef:WSeqPairsClass_with_sube32_in_MatrixIndexGPR32_12_15 */, def %0, 2162698 /* regdef:FIXED_REGS */, def %1
; CHECK: [[COPY:%[0-9]+]]:gpr(s32) = COPY %0
; CHECK: [[COPY1:%[0-9]+]]:fpr(s64) = COPY %1
; CHECK: $d0 = COPY [[COPY1]](s64)
; CHECK: RET_ReallyLR implicit $d0
; CHECK: INLINEASM &"mov $0, #0; mov $1, #0", 0 /* attdialect */, 1310730 /* regdef:WSeqPairsClass_with_sube32_in_GPR32arg */, def %0, 2162698 /* regdef:GPR64arg */, def %1
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr(s32) = COPY %0
; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr(s64) = COPY %1
; CHECK-NEXT: $d0 = COPY [[COPY1]](s64)
; CHECK-NEXT: RET_ReallyLR implicit $d0
INLINEASM &"mov $0, #0; mov $1, #0", 0 /* attdialect */, 1310730 /* regdef:GPR32common */, def %0:gpr32common, 2162698 /* regdef:FPR64 */, def %1:fpr64
%3:_(s32) = COPY %0
%4:_(s64) = COPY %1
Expand Down
22 changes: 22 additions & 0 deletions llvm/test/MC/AArch64/SVE2p1/pext-diagnostics.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s

// --------------------------------------------------------------------------//
// Invalid predicate as counter register

pext p0.h, pn3[0]
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate-as-counter register expected pn8..pn15
// CHECK-NEXT: pext p0.h, pn3[0]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

// --------------------------------------------------------------------------//
// Invalid lane index

pext p0.d, pn8[4]
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
// CHECK-NEXT: pext p0.d, pn8[4]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

pext p0.b, pn8[-1]
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
// CHECK-NEXT: pext p0.b, pn8[-1]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
110 changes: 110 additions & 0 deletions llvm/test/MC/AArch64/SVE2p1/pext.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %s \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
// RUN: | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST

pext p0.h, pn8[0] // 00100101-01100000-01110000-00010000
// CHECK-INST: pext p0.h, pn8[0]
// CHECK-ENCODING: [0x10,0x70,0x60,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25607010 <unknown>

pext p5.h, pn10[1] // 00100101-01100000-01110001-01010101
// CHECK-INST: pext p5.h, pn10[1]
// CHECK-ENCODING: [0x55,0x71,0x60,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25607155 <unknown>

pext p7.h, pn13[1] // 00100101-01100000-01110001-10110111
// CHECK-INST: pext p7.h, pn13[1]
// CHECK-ENCODING: [0xb7,0x71,0x60,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 256071b7 <unknown>

pext p15.h, pn15[3] // 00100101-01100000-01110011-11111111
// CHECK-INST: pext p15.h, pn15[3]
// CHECK-ENCODING: [0xff,0x73,0x60,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 256073ff <unknown>

pext p0.s, pn8[0] // 00100101-10100000-01110000-00010000
// CHECK-INST: pext p0.s, pn8[0]
// CHECK-ENCODING: [0x10,0x70,0xa0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25a07010 <unknown>

pext p5.s, pn10[1] // 00100101-10100000-01110001-01010101
// CHECK-INST: pext p5.s, pn10[1]
// CHECK-ENCODING: [0x55,0x71,0xa0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25a07155 <unknown>

pext p7.s, pn13[1] // 00100101-10100000-01110001-10110111
// CHECK-INST: pext p7.s, pn13[1]
// CHECK-ENCODING: [0xb7,0x71,0xa0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25a071b7 <unknown>

pext p15.s, pn15[3] // 00100101-10100000-01110011-11111111
// CHECK-INST: pext p15.s, pn15[3]
// CHECK-ENCODING: [0xff,0x73,0xa0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25a073ff <unknown>

pext p0.d, pn8[0] // 00100101-11100000-01110000-00010000
// CHECK-INST: pext p0.d, pn8[0]
// CHECK-ENCODING: [0x10,0x70,0xe0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25e07010 <unknown>

pext p5.d, pn10[1] // 00100101-11100000-01110001-01010101
// CHECK-INST: pext p5.d, pn10[1]
// CHECK-ENCODING: [0x55,0x71,0xe0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25e07155 <unknown>

pext p7.d, pn13[1] // 00100101-11100000-01110001-10110111
// CHECK-INST: pext p7.d, pn13[1]
// CHECK-ENCODING: [0xb7,0x71,0xe0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25e071b7 <unknown>

pext p15.d, pn15[3] // 00100101-11100000-01110011-11111111
// CHECK-INST: pext p15.d, pn15[3]
// CHECK-ENCODING: [0xff,0x73,0xe0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25e073ff <unknown>

pext p0.b, pn8[0] // 00100101-00100000-01110000-00010000
// CHECK-INST: pext p0.b, pn8[0]
// CHECK-ENCODING: [0x10,0x70,0x20,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25207010 <unknown>

pext p5.b, pn10[1] // 00100101-00100000-01110001-01010101
// CHECK-INST: pext p5.b, pn10[1]
// CHECK-ENCODING: [0x55,0x71,0x20,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25207155 <unknown>

pext p7.b, pn13[1] // 00100101-00100000-01110001-10110111
// CHECK-INST: pext p7.b, pn13[1]
// CHECK-ENCODING: [0xb7,0x71,0x20,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 252071b7 <unknown>

pext p15.b, pn15[3] // 00100101-00100000-01110011-11111111
// CHECK-INST: pext p15.b, pn15[3]
// CHECK-ENCODING: [0xff,0x73,0x20,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 252073ff <unknown>
18 changes: 18 additions & 0 deletions llvm/test/MC/AArch64/SVE2p1/ptrue-diagnostics.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s

// --------------------------------------------------------------------------//
// Invalid use of predicate as counter register

ptrue pn7.b
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid predicate register, expected PN in range pn8..pn15 with element suffix.
// CHECK-NEXT: ptrue pn7.b
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

// --------------------------------------------------------------------------//
// Invalid use of predicate as counter without suffix

ptrue pn8
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid predicate register, expected PN in range pn8..pn15 with element suffix.
// CHECK-NEXT: ptrue pn8
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

110 changes: 110 additions & 0 deletions llvm/test/MC/AArch64/SVE2p1/ptrue.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %s \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
// RUN: | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST

ptrue pn8.h // 00100101-01100000-01111000-00010000
// CHECK-INST: ptrue pn8.h
// CHECK-ENCODING: [0x10,0x78,0x60,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25607810 <unknown>

ptrue pn13.h // 00100101-01100000-01111000-00010101
// CHECK-INST: ptrue pn13.h
// CHECK-ENCODING: [0x15,0x78,0x60,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25607815 <unknown>

ptrue pn15.h // 00100101-01100000-01111000-00010111
// CHECK-INST: ptrue pn15.h
// CHECK-ENCODING: [0x17,0x78,0x60,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25607817 <unknown>

ptrue pn9.h // 00100101-01100000-01111000-00010001
// CHECK-INST: ptrue pn9.h
// CHECK-ENCODING: [0x11,0x78,0x60,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25607811 <unknown>

ptrue pn8.s // 00100101-10100000-01111000-00010000
// CHECK-INST: ptrue pn8.s
// CHECK-ENCODING: [0x10,0x78,0xa0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25a07810 <unknown>

ptrue pn13.s // 00100101-10100000-01111000-00010101
// CHECK-INST: ptrue pn13.s
// CHECK-ENCODING: [0x15,0x78,0xa0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25a07815 <unknown>

ptrue pn15.s // 00100101-10100000-01111000-00010111
// CHECK-INST: ptrue pn15.s
// CHECK-ENCODING: [0x17,0x78,0xa0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25a07817 <unknown>

ptrue pn9.s // 00100101-10100000-01111000-00010001
// CHECK-INST: ptrue pn9.s
// CHECK-ENCODING: [0x11,0x78,0xa0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25a07811 <unknown>

ptrue pn8.d // 00100101-11100000-01111000-00010000
// CHECK-INST: ptrue pn8.d
// CHECK-ENCODING: [0x10,0x78,0xe0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25e07810 <unknown>

ptrue pn13.d // 00100101-11100000-01111000-00010101
// CHECK-INST: ptrue pn13.d
// CHECK-ENCODING: [0x15,0x78,0xe0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25e07815 <unknown>

ptrue pn15.d // 00100101-11100000-01111000-00010111
// CHECK-INST: ptrue pn15.d
// CHECK-ENCODING: [0x17,0x78,0xe0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25e07817 <unknown>

ptrue pn9.d // 00100101-11100000-01111000-00010001
// CHECK-INST: ptrue pn9.d
// CHECK-ENCODING: [0x11,0x78,0xe0,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25e07811 <unknown>

ptrue pn8.b // 00100101-00100000-01111000-00010000
// CHECK-INST: ptrue pn8.b
// CHECK-ENCODING: [0x10,0x78,0x20,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25207810 <unknown>

ptrue pn13.b // 00100101-00100000-01111000-00010101
// CHECK-INST: ptrue pn13.b
// CHECK-ENCODING: [0x15,0x78,0x20,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25207815 <unknown>

ptrue pn15.b // 00100101-00100000-01111000-00010111
// CHECK-INST: ptrue pn15.b
// CHECK-ENCODING: [0x17,0x78,0x20,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25207817 <unknown>

ptrue pn9.b // 00100101-00100000-01111000-00010001
// CHECK-INST: ptrue pn9.b
// CHECK-ENCODING: [0x11,0x78,0x20,0x25]
// CHECK-ERROR: instruction requires: sme2 or sve2p1
// CHECK-UNKNOWN: 25207811 <unknown>