Skip to content

Commit 77e3075

Browse files
committed
[ARM][MVE] Enable *SHRN* for tail predication
These instructions don't swap lanes so make them valid. Differential Revision: https://reviews.llvm.org/D75667
1 parent 6f12225 commit 77e3075

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

llvm/lib/Target/ARM/ARMInstrMVE.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,6 +2649,7 @@ class MVE_VxSHRN<string iname, string suffix, bit bit_12, bit bit_28,
26492649
let Inst{11-6} = 0b111111;
26502650
let Inst{4} = 0b0;
26512651
let Inst{0} = 0b1;
2652+
let validForTailPredication = 1;
26522653
}
26532654

26542655
def MVE_VRSHRNi16bh : MVE_VxSHRN<"vrshrnb", "i16", 0b0, 0b1, shr_imm8> {
@@ -2690,6 +2691,7 @@ class MVE_VxQRSHRUN<string iname, string suffix, bit bit_28, bit bit_12,
26902691
let Inst{11-6} = 0b111111;
26912692
let Inst{4} = 0b0;
26922693
let Inst{0} = 0b0;
2694+
let validForTailPredication = 1;
26932695
}
26942696

26952697
def MVE_VQRSHRUNs16bh : MVE_VxQRSHRUN<
@@ -2738,6 +2740,7 @@ class MVE_VxQRSHRN<string iname, string suffix, bit bit_0, bit bit_12,
27382740
let Inst{11-6} = 0b111101;
27392741
let Inst{4} = 0b0;
27402742
let Inst{0} = bit_0;
2743+
let validForTailPredication = 1;
27412744
}
27422745

27432746
multiclass MVE_VxQRSHRN_types<string iname, bit bit_0, bit bit_12> {

llvm/unittests/Target/ARM/MachineInstrTest.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,30 @@ TEST(MachineInstrValidTailPredication, IsCorrect) {
354354
case MVE_VQSHL_qru16:
355355
case MVE_VQSHL_qru32:
356356
case MVE_VQSHL_qru8:
357+
case MVE_VQRSHRNbhs16:
358+
case MVE_VQRSHRNbhs32:
359+
case MVE_VQRSHRNbhu16:
360+
case MVE_VQRSHRNbhu32:
361+
case MVE_VQRSHRNths16:
362+
case MVE_VQRSHRNths32:
363+
case MVE_VQRSHRNthu16:
364+
case MVE_VQRSHRNthu32:
365+
case MVE_VQRSHRUNs16bh:
366+
case MVE_VQRSHRUNs16th:
367+
case MVE_VQRSHRUNs32bh:
368+
case MVE_VQRSHRUNs32th:
369+
case MVE_VQSHRNbhs16:
370+
case MVE_VQSHRNbhs32:
371+
case MVE_VQSHRNbhu16:
372+
case MVE_VQSHRNbhu32:
373+
case MVE_VQSHRNths16:
374+
case MVE_VQSHRNths32:
375+
case MVE_VQSHRNthu16:
376+
case MVE_VQSHRNthu32:
377+
case MVE_VQSHRUNs16bh:
378+
case MVE_VQSHRUNs16th:
379+
case MVE_VQSHRUNs32bh:
380+
case MVE_VQSHRUNs32th:
357381
case MVE_VQSUB_qr_s16:
358382
case MVE_VQSUB_qr_s32:
359383
case MVE_VQSUB_qr_s8:
@@ -402,6 +426,10 @@ TEST(MachineInstrValidTailPredication, IsCorrect) {
402426
case MVE_VRSHR_immu16:
403427
case MVE_VRSHR_immu32:
404428
case MVE_VRSHR_immu8:
429+
case MVE_VRSHRNi16bh:
430+
case MVE_VRSHRNi16th:
431+
case MVE_VRSHRNi32bh:
432+
case MVE_VRSHRNi32th:
405433
case MVE_VSHL_by_vecs16:
406434
case MVE_VSHL_by_vecs32:
407435
case MVE_VSHL_by_vecs8:
@@ -423,6 +451,10 @@ TEST(MachineInstrValidTailPredication, IsCorrect) {
423451
case MVE_VSHR_immu16:
424452
case MVE_VSHR_immu32:
425453
case MVE_VSHR_immu8:
454+
case MVE_VSHRNi16bh:
455+
case MVE_VSHRNi16th:
456+
case MVE_VSHRNi32bh:
457+
case MVE_VSHRNi32th:
426458
case MVE_VSLIimm16:
427459
case MVE_VSLIimm32:
428460
case MVE_VSLIimm8:

0 commit comments

Comments
 (0)