1 #include "ARMBaseInstrInfo.h"
2 #include "ARMSubtarget.h"
3 #include "ARMTargetMachine.h"
4 #include "llvm/MC/TargetRegistry.h"
5 #include "llvm/Support/TargetSelect.h"
6 #include "llvm/Target/TargetMachine.h"
7 #include "llvm/Target/TargetOptions.h"
9 #include "gtest/gtest.h"
13 TEST(MachineInstructionDoubleWidthResult
, IsCorrect
) {
16 auto DoubleWidthResult
= [](unsigned Opcode
) {
36 case MVE_VQDMULL_qr_s16bh
:
37 case MVE_VQDMULL_qr_s16th
:
38 case MVE_VQDMULL_qr_s32bh
:
39 case MVE_VQDMULL_qr_s32th
:
40 case MVE_VQDMULLs16bh
:
41 case MVE_VQDMULLs16th
:
42 case MVE_VQDMULLs32bh
:
43 case MVE_VQDMULLs32th
:
52 case MVE_VSHLL_imms16bh
:
53 case MVE_VSHLL_imms16th
:
54 case MVE_VSHLL_imms8bh
:
55 case MVE_VSHLL_imms8th
:
56 case MVE_VSHLL_immu16bh
:
57 case MVE_VSHLL_immu16th
:
58 case MVE_VSHLL_immu8bh
:
59 case MVE_VSHLL_immu8th
:
60 case MVE_VSHLL_lws16bh
:
61 case MVE_VSHLL_lws16th
:
62 case MVE_VSHLL_lws8bh
:
63 case MVE_VSHLL_lws8th
:
64 case MVE_VSHLL_lwu16bh
:
65 case MVE_VSHLL_lwu16th
:
66 case MVE_VSHLL_lwu8bh
:
67 case MVE_VSHLL_lwu8th
:
73 LLVMInitializeARMTargetInfo();
74 LLVMInitializeARMTarget();
75 LLVMInitializeARMTargetMC();
77 auto TT(Triple::normalize("thumbv8.1m.main-none-none-eabi"));
79 const Target
*T
= TargetRegistry::lookupTarget(TT
, Error
);
85 TargetOptions Options
;
86 auto TM
= std::unique_ptr
<TargetMachine
>(
87 T
->createTargetMachine(TT
, "generic", "", Options
, std::nullopt
,
88 std::nullopt
, CodeGenOptLevel::Default
));
89 ARMSubtarget
ST(TM
->getTargetTriple(), std::string(TM
->getTargetCPU()),
90 std::string(TM
->getTargetFeatureString()),
91 *static_cast<const ARMBaseTargetMachine
*>(TM
.get()), false);
92 const ARMBaseInstrInfo
*TII
= ST
.getInstrInfo();
93 auto MII
= TM
->getMCInstrInfo();
95 for (unsigned i
= 0; i
< ARM::INSTRUCTION_LIST_END
; ++i
) {
96 const MCInstrDesc
&Desc
= TII
->get(i
);
98 uint64_t Flags
= Desc
.TSFlags
;
99 if ((Flags
& ARMII::DomainMask
) != ARMII::DomainMVE
)
102 bool Valid
= (Flags
& ARMII::DoubleWidthResult
) != 0;
103 ASSERT_EQ(DoubleWidthResult(i
), Valid
)
105 << ": mismatched expectation for tail-predicated safety\n";
109 TEST(MachineInstructionHorizontalReduction
, IsCorrect
) {
112 auto HorizontalReduction
= [](unsigned Opcode
) {
122 case MVE_VADDLVs32acc
:
123 case MVE_VADDLVs32no_acc
:
124 case MVE_VADDLVu32acc
:
125 case MVE_VADDLVu32no_acc
:
126 case MVE_VADDVs16acc
:
127 case MVE_VADDVs16no_acc
:
128 case MVE_VADDVs32acc
:
129 case MVE_VADDVs32no_acc
:
131 case MVE_VADDVs8no_acc
:
132 case MVE_VADDVu16acc
:
133 case MVE_VADDVu16no_acc
:
134 case MVE_VADDVu32acc
:
135 case MVE_VADDVu32no_acc
:
137 case MVE_VADDVu8no_acc
:
141 case MVE_VMAXNMAVf16
:
142 case MVE_VMAXNMAVf32
:
154 case MVE_VMINNMAVf16
:
155 case MVE_VMINNMAVf32
:
164 case MVE_VMLADAVas16
:
165 case MVE_VMLADAVas32
:
167 case MVE_VMLADAVau16
:
168 case MVE_VMLADAVau32
:
170 case MVE_VMLADAVaxs16
:
171 case MVE_VMLADAVaxs32
:
172 case MVE_VMLADAVaxs8
:
179 case MVE_VMLADAVxs16
:
180 case MVE_VMLADAVxs32
:
182 case MVE_VMLALDAVas16
:
183 case MVE_VMLALDAVas32
:
184 case MVE_VMLALDAVau16
:
185 case MVE_VMLALDAVau32
:
186 case MVE_VMLALDAVaxs16
:
187 case MVE_VMLALDAVaxs32
:
188 case MVE_VMLALDAVs16
:
189 case MVE_VMLALDAVs32
:
190 case MVE_VMLALDAVu16
:
191 case MVE_VMLALDAVu32
:
192 case MVE_VMLALDAVxs16
:
193 case MVE_VMLALDAVxs32
:
194 case MVE_VMLSDAVas16
:
195 case MVE_VMLSDAVas32
:
197 case MVE_VMLSDAVaxs16
:
198 case MVE_VMLSDAVaxs32
:
199 case MVE_VMLSDAVaxs8
:
203 case MVE_VMLSDAVxs16
:
204 case MVE_VMLSDAVxs32
:
206 case MVE_VMLSLDAVas16
:
207 case MVE_VMLSLDAVas32
:
208 case MVE_VMLSLDAVaxs16
:
209 case MVE_VMLSLDAVaxs32
:
210 case MVE_VMLSLDAVs16
:
211 case MVE_VMLSLDAVs32
:
212 case MVE_VMLSLDAVxs16
:
213 case MVE_VMLSLDAVxs32
:
214 case MVE_VRMLALDAVHas32
:
215 case MVE_VRMLALDAVHau32
:
216 case MVE_VRMLALDAVHaxs32
:
217 case MVE_VRMLALDAVHs32
:
218 case MVE_VRMLALDAVHu32
:
219 case MVE_VRMLALDAVHxs32
:
220 case MVE_VRMLSLDAVHas32
:
221 case MVE_VRMLSLDAVHaxs32
:
222 case MVE_VRMLSLDAVHs32
:
223 case MVE_VRMLSLDAVHxs32
:
229 LLVMInitializeARMTargetInfo();
230 LLVMInitializeARMTarget();
231 LLVMInitializeARMTargetMC();
233 auto TT(Triple::normalize("thumbv8.1m.main-none-none-eabi"));
235 const Target
*T
= TargetRegistry::lookupTarget(TT
, Error
);
241 TargetOptions Options
;
242 auto TM
= std::unique_ptr
<TargetMachine
>(
243 T
->createTargetMachine(TT
, "generic", "", Options
, std::nullopt
,
244 std::nullopt
, CodeGenOptLevel::Default
));
245 ARMSubtarget
ST(TM
->getTargetTriple(), std::string(TM
->getTargetCPU()),
246 std::string(TM
->getTargetFeatureString()),
247 *static_cast<const ARMBaseTargetMachine
*>(TM
.get()), false);
248 const ARMBaseInstrInfo
*TII
= ST
.getInstrInfo();
249 auto MII
= TM
->getMCInstrInfo();
251 for (unsigned i
= 0; i
< ARM::INSTRUCTION_LIST_END
; ++i
) {
252 const MCInstrDesc
&Desc
= TII
->get(i
);
254 uint64_t Flags
= Desc
.TSFlags
;
255 if ((Flags
& ARMII::DomainMask
) != ARMII::DomainMVE
)
257 bool Valid
= (Flags
& ARMII::HorizontalReduction
) != 0;
258 ASSERT_EQ(HorizontalReduction(i
), Valid
)
260 << ": mismatched expectation for tail-predicated safety\n";
264 TEST(MachineInstructionRetainsPreviousHalfElement
, IsCorrect
) {
267 auto RetainsPreviousHalfElement
= [](unsigned Opcode
) {
275 case MVE_VQMOVNs16bh
:
276 case MVE_VQMOVNs16th
:
277 case MVE_VQMOVNs32bh
:
278 case MVE_VQMOVNs32th
:
279 case MVE_VQMOVNu16bh
:
280 case MVE_VQMOVNu16th
:
281 case MVE_VQMOVNu32bh
:
282 case MVE_VQMOVNu32th
:
283 case MVE_VQMOVUNs16bh
:
284 case MVE_VQMOVUNs16th
:
285 case MVE_VQMOVUNs32bh
:
286 case MVE_VQMOVUNs32th
:
287 case MVE_VQRSHRNbhs16
:
288 case MVE_VQRSHRNbhs32
:
289 case MVE_VQRSHRNbhu16
:
290 case MVE_VQRSHRNbhu32
:
291 case MVE_VQRSHRNths16
:
292 case MVE_VQRSHRNths32
:
293 case MVE_VQRSHRNthu16
:
294 case MVE_VQRSHRNthu32
:
295 case MVE_VQRSHRUNs16bh
:
296 case MVE_VQRSHRUNs16th
:
297 case MVE_VQRSHRUNs32bh
:
298 case MVE_VQRSHRUNs32th
:
299 case MVE_VQSHRNbhs16
:
300 case MVE_VQSHRNbhs32
:
301 case MVE_VQSHRNbhu16
:
302 case MVE_VQSHRNbhu32
:
303 case MVE_VQSHRNths16
:
304 case MVE_VQSHRNths32
:
305 case MVE_VQSHRNthu16
:
306 case MVE_VQSHRNthu32
:
307 case MVE_VQSHRUNs16bh
:
308 case MVE_VQSHRUNs16th
:
309 case MVE_VQSHRUNs32bh
:
310 case MVE_VQSHRUNs32th
:
311 case MVE_VRSHRNi16bh
:
312 case MVE_VRSHRNi16th
:
313 case MVE_VRSHRNi32bh
:
314 case MVE_VRSHRNi32th
:
319 case MVE_VCVTf16f32bh
:
320 case MVE_VCVTf16f32th
:
321 case MVE_VCVTf32f16bh
:
322 case MVE_VCVTf32f16th
:
328 LLVMInitializeARMTargetInfo();
329 LLVMInitializeARMTarget();
330 LLVMInitializeARMTargetMC();
332 auto TT(Triple::normalize("thumbv8.1m.main-none-none-eabi"));
334 const Target
*T
= TargetRegistry::lookupTarget(TT
, Error
);
340 TargetOptions Options
;
341 auto TM
= std::unique_ptr
<TargetMachine
>(
342 T
->createTargetMachine(TT
, "generic", "", Options
, std::nullopt
,
343 std::nullopt
, CodeGenOptLevel::Default
));
344 ARMSubtarget
ST(TM
->getTargetTriple(), std::string(TM
->getTargetCPU()),
345 std::string(TM
->getTargetFeatureString()),
346 *static_cast<const ARMBaseTargetMachine
*>(TM
.get()), false);
347 const ARMBaseInstrInfo
*TII
= ST
.getInstrInfo();
348 auto MII
= TM
->getMCInstrInfo();
350 for (unsigned i
= 0; i
< ARM::INSTRUCTION_LIST_END
; ++i
) {
351 const MCInstrDesc
&Desc
= TII
->get(i
);
353 uint64_t Flags
= Desc
.TSFlags
;
354 if ((Flags
& ARMII::DomainMask
) != ARMII::DomainMVE
)
357 bool Valid
= (Flags
& ARMII::RetainsPreviousHalfElement
) != 0;
358 ASSERT_EQ(RetainsPreviousHalfElement(i
), Valid
)
360 << ": mismatched expectation for tail-predicated safety\n";
363 // Test for instructions that aren't immediately obviously valid within a
364 // tail-predicated loop. This should be marked up in their tablegen
365 // descriptions. Currently we, conservatively, disallow:
366 // - cross beat carries.
367 // - complex operations.
368 // - horizontal operations with exchange.
370 // - interleaved memory instructions.
371 // TODO: Add to this list once we can handle them safely.
372 TEST(MachineInstrValidTailPredication
, IsCorrect
) {
376 auto IsValidTPOpcode
= [](unsigned Opcode
) {
410 case MVE_VADD_qr_f16
:
411 case MVE_VADD_qr_f32
:
412 case MVE_VADD_qr_i16
:
413 case MVE_VADD_qr_i32
:
415 case MVE_VADDVs16acc
:
416 case MVE_VADDVs16no_acc
:
417 case MVE_VADDVs32acc
:
418 case MVE_VADDVs32no_acc
:
420 case MVE_VADDVs8no_acc
:
421 case MVE_VADDVu16acc
:
422 case MVE_VADDVu16no_acc
:
423 case MVE_VADDVu32acc
:
424 case MVE_VADDVu32no_acc
:
426 case MVE_VADDVu8no_acc
:
471 case MVE_VCVTf16s16_fix
:
472 case MVE_VCVTf16s16n
:
473 case MVE_VCVTf16u16_fix
:
474 case MVE_VCVTf16u16n
:
475 case MVE_VCVTf32s32_fix
:
476 case MVE_VCVTf32s32n
:
477 case MVE_VCVTf32u32_fix
:
478 case MVE_VCVTf32u32n
:
479 case MVE_VCVTs16f16_fix
:
480 case MVE_VCVTs16f16a
:
481 case MVE_VCVTs16f16m
:
482 case MVE_VCVTs16f16n
:
483 case MVE_VCVTs16f16p
:
484 case MVE_VCVTs16f16z
:
485 case MVE_VCVTs32f32_fix
:
486 case MVE_VCVTs32f32a
:
487 case MVE_VCVTs32f32m
:
488 case MVE_VCVTs32f32n
:
489 case MVE_VCVTs32f32p
:
490 case MVE_VCVTs32f32z
:
491 case MVE_VCVTu16f16_fix
:
492 case MVE_VCVTu16f16a
:
493 case MVE_VCVTu16f16m
:
494 case MVE_VCVTu16f16n
:
495 case MVE_VCVTu16f16p
:
496 case MVE_VCVTu16f16z
:
497 case MVE_VCVTu32f32_fix
:
498 case MVE_VCVTu32f32a
:
499 case MVE_VCVTu32f32m
:
500 case MVE_VCVTu32f32n
:
501 case MVE_VCVTu32f32p
:
502 case MVE_VCVTu32f32z
:
513 case MVE_VFMA_qr_Sf16
:
514 case MVE_VFMA_qr_Sf32
:
515 case MVE_VFMA_qr_f16
:
516 case MVE_VFMA_qr_f32
:
547 case MVE_VMLADAVas16
:
548 case MVE_VMLADAVas32
:
550 case MVE_VMLADAVau16
:
551 case MVE_VMLADAVau32
:
559 case MVE_VMLALDAVs16
:
560 case MVE_VMLALDAVs32
:
561 case MVE_VMLALDAVu16
:
562 case MVE_VMLALDAVu32
:
563 case MVE_VMLALDAVas16
:
564 case MVE_VMLALDAVas32
:
565 case MVE_VMLALDAVau16
:
566 case MVE_VMLALDAVau32
:
567 case MVE_VMLSDAVas16
:
568 case MVE_VMLSDAVas32
:
573 case MVE_VMLSLDAVas16
:
574 case MVE_VMLSLDAVas32
:
575 case MVE_VMLSLDAVs16
:
576 case MVE_VMLSLDAVs32
:
577 case MVE_VRMLALDAVHas32
:
578 case MVE_VRMLALDAVHau32
:
579 case MVE_VRMLALDAVHs32
:
580 case MVE_VRMLALDAVHu32
:
581 case MVE_VRMLSLDAVHas32
:
582 case MVE_VRMLSLDAVHs32
:
583 case MVE_VMLAS_qr_i16
:
584 case MVE_VMLAS_qr_i32
:
585 case MVE_VMLAS_qr_i8
:
586 case MVE_VMLA_qr_i16
:
587 case MVE_VMLA_qr_i32
:
589 case MVE_VHADD_qr_s16
:
590 case MVE_VHADD_qr_s32
:
591 case MVE_VHADD_qr_s8
:
592 case MVE_VHADD_qr_u16
:
593 case MVE_VHADD_qr_u32
:
594 case MVE_VHADD_qr_u8
:
601 case MVE_VHSUB_qr_s16
:
602 case MVE_VHSUB_qr_s32
:
603 case MVE_VHSUB_qr_s8
:
604 case MVE_VHSUB_qr_u16
:
605 case MVE_VHSUB_qr_u32
:
606 case MVE_VHSUB_qr_u8
:
627 case MVE_VLD20_16_wb
:
628 case MVE_VLD21_16_wb
:
629 case MVE_VLD20_32_wb
:
630 case MVE_VLD21_32_wb
:
647 case MVE_VLD40_16_wb
:
648 case MVE_VLD41_16_wb
:
649 case MVE_VLD42_16_wb
:
650 case MVE_VLD43_16_wb
:
651 case MVE_VLD40_32_wb
:
652 case MVE_VLD41_32_wb
:
653 case MVE_VLD42_32_wb
:
654 case MVE_VLD43_32_wb
:
656 case MVE_VLDRBS16_post
:
657 case MVE_VLDRBS16_pre
:
658 case MVE_VLDRBS16_rq
:
660 case MVE_VLDRBS32_post
:
661 case MVE_VLDRBS32_pre
:
662 case MVE_VLDRBS32_rq
:
664 case MVE_VLDRBU16_post
:
665 case MVE_VLDRBU16_pre
:
666 case MVE_VLDRBU16_rq
:
668 case MVE_VLDRBU32_post
:
669 case MVE_VLDRBU32_pre
:
670 case MVE_VLDRBU32_rq
:
672 case MVE_VLDRBU8_post
:
673 case MVE_VLDRBU8_pre
:
675 case MVE_VLDRDU64_qi
:
676 case MVE_VLDRDU64_qi_pre
:
677 case MVE_VLDRDU64_rq
:
678 case MVE_VLDRDU64_rq_u
:
680 case MVE_VLDRHS32_post
:
681 case MVE_VLDRHS32_pre
:
682 case MVE_VLDRHS32_rq
:
683 case MVE_VLDRHS32_rq_u
:
685 case MVE_VLDRHU16_post
:
686 case MVE_VLDRHU16_pre
:
687 case MVE_VLDRHU16_rq
:
688 case MVE_VLDRHU16_rq_u
:
690 case MVE_VLDRHU32_post
:
691 case MVE_VLDRHU32_pre
:
692 case MVE_VLDRHU32_rq
:
693 case MVE_VLDRHU32_rq_u
:
695 case MVE_VLDRWU32_post
:
696 case MVE_VLDRWU32_pre
:
697 case MVE_VLDRWU32_qi
:
698 case MVE_VLDRWU32_qi_pre
:
699 case MVE_VLDRWU32_rq
:
700 case MVE_VLDRWU32_rq_u
:
726 case MVE_VMUL_qr_f16
:
727 case MVE_VMUL_qr_f32
:
728 case MVE_VMUL_qr_i16
:
729 case MVE_VMUL_qr_i32
:
780 case MVE_VQADD_qr_s16
:
781 case MVE_VQADD_qr_s32
:
782 case MVE_VQADD_qr_s8
:
783 case MVE_VQADD_qr_u16
:
784 case MVE_VQADD_qr_u32
:
785 case MVE_VQADD_qr_u8
:
792 case MVE_VQDMULH_qr_s16
:
793 case MVE_VQDMULH_qr_s32
:
794 case MVE_VQDMULH_qr_s8
:
798 case MVE_VQDMULL_qr_s16bh
:
799 case MVE_VQDMULL_qr_s16th
:
800 case MVE_VQDMULL_qr_s32bh
:
801 case MVE_VQDMULL_qr_s32th
:
802 case MVE_VQDMULLs16bh
:
803 case MVE_VQDMULLs16th
:
804 case MVE_VQDMULLs32bh
:
805 case MVE_VQDMULLs32th
:
806 case MVE_VQRDMULH_qr_s16
:
807 case MVE_VQRDMULH_qr_s32
:
808 case MVE_VQRDMULH_qr_s8
:
809 case MVE_VQRDMULHi16
:
810 case MVE_VQRDMULHi32
:
815 case MVE_VQMOVNs16bh
:
816 case MVE_VQMOVNs16th
:
817 case MVE_VQMOVNs32bh
:
818 case MVE_VQMOVNs32th
:
819 case MVE_VQMOVNu16bh
:
820 case MVE_VQMOVNu16th
:
821 case MVE_VQMOVNu32bh
:
822 case MVE_VQMOVNu32th
:
823 case MVE_VQMOVUNs16bh
:
824 case MVE_VQMOVUNs16th
:
825 case MVE_VQMOVUNs32bh
:
826 case MVE_VQMOVUNs32th
:
827 case MVE_VQRSHL_by_vecs16
:
828 case MVE_VQRSHL_by_vecs32
:
829 case MVE_VQRSHL_by_vecs8
:
830 case MVE_VQRSHL_by_vecu16
:
831 case MVE_VQRSHL_by_vecu32
:
832 case MVE_VQRSHL_by_vecu8
:
833 case MVE_VQRSHL_qrs16
:
834 case MVE_VQRSHL_qrs32
:
835 case MVE_VQRSHL_qrs8
:
836 case MVE_VQRSHL_qru16
:
837 case MVE_VQRSHL_qru8
:
838 case MVE_VQRSHL_qru32
:
839 case MVE_VQSHLU_imms16
:
840 case MVE_VQSHLU_imms32
:
841 case MVE_VQSHLU_imms8
:
842 case MVE_VQSHLimms16
:
843 case MVE_VQSHLimms32
:
845 case MVE_VQSHLimmu16
:
846 case MVE_VQSHLimmu32
:
848 case MVE_VQSHL_by_vecs16
:
849 case MVE_VQSHL_by_vecs32
:
850 case MVE_VQSHL_by_vecs8
:
851 case MVE_VQSHL_by_vecu16
:
852 case MVE_VQSHL_by_vecu32
:
853 case MVE_VQSHL_by_vecu8
:
854 case MVE_VQSHL_qrs16
:
855 case MVE_VQSHL_qrs32
:
857 case MVE_VQSHL_qru16
:
858 case MVE_VQSHL_qru32
:
860 case MVE_VQRSHRNbhs16
:
861 case MVE_VQRSHRNbhs32
:
862 case MVE_VQRSHRNbhu16
:
863 case MVE_VQRSHRNbhu32
:
864 case MVE_VQRSHRNths16
:
865 case MVE_VQRSHRNths32
:
866 case MVE_VQRSHRNthu16
:
867 case MVE_VQRSHRNthu32
:
868 case MVE_VQRSHRUNs16bh
:
869 case MVE_VQRSHRUNs16th
:
870 case MVE_VQRSHRUNs32bh
:
871 case MVE_VQRSHRUNs32th
:
872 case MVE_VQSHRNbhs16
:
873 case MVE_VQSHRNbhs32
:
874 case MVE_VQSHRNbhu16
:
875 case MVE_VQSHRNbhu32
:
876 case MVE_VQSHRNths16
:
877 case MVE_VQSHRNths32
:
878 case MVE_VQSHRNthu16
:
879 case MVE_VQSHRNthu32
:
880 case MVE_VQSHRUNs16bh
:
881 case MVE_VQSHRUNs16th
:
882 case MVE_VQSHRUNs32bh
:
883 case MVE_VQSHRUNs32th
:
884 case MVE_VQSUB_qr_s16
:
885 case MVE_VQSUB_qr_s32
:
886 case MVE_VQSUB_qr_s8
:
887 case MVE_VQSUB_qr_u16
:
888 case MVE_VQSUB_qr_u32
:
889 case MVE_VQSUB_qr_u8
:
920 case MVE_VRSHL_by_vecs16
:
921 case MVE_VRSHL_by_vecs32
:
922 case MVE_VRSHL_by_vecs8
:
923 case MVE_VRSHL_by_vecu16
:
924 case MVE_VRSHL_by_vecu32
:
925 case MVE_VRSHL_by_vecu8
:
926 case MVE_VRSHL_qrs16
:
927 case MVE_VRSHL_qrs32
:
929 case MVE_VRSHL_qru16
:
930 case MVE_VRSHL_qru32
:
932 case MVE_VRSHR_imms16
:
933 case MVE_VRSHR_imms32
:
934 case MVE_VRSHR_imms8
:
935 case MVE_VRSHR_immu16
:
936 case MVE_VRSHR_immu32
:
937 case MVE_VRSHR_immu8
:
938 case MVE_VRSHRNi16bh
:
939 case MVE_VRSHRNi16th
:
940 case MVE_VRSHRNi32bh
:
941 case MVE_VRSHRNi32th
:
942 case MVE_VSHL_by_vecs16
:
943 case MVE_VSHL_by_vecs32
:
944 case MVE_VSHL_by_vecs8
:
945 case MVE_VSHL_by_vecu16
:
946 case MVE_VSHL_by_vecu32
:
947 case MVE_VSHL_by_vecu8
:
948 case MVE_VSHL_immi16
:
949 case MVE_VSHL_immi32
:
957 case MVE_VSHR_imms16
:
958 case MVE_VSHR_imms32
:
960 case MVE_VSHR_immu16
:
961 case MVE_VSHR_immu32
:
974 case MVE_VSTRB16_post
:
975 case MVE_VSTRB16_pre
:
978 case MVE_VSTRB32_post
:
979 case MVE_VSTRB32_pre
:
983 case MVE_VSTRBU8_post
:
984 case MVE_VSTRBU8_pre
:
986 case MVE_VSTRD64_qi_pre
:
988 case MVE_VSTRD64_rq_u
:
990 case MVE_VSTRH16_rq_u
:
992 case MVE_VSTRH32_post
:
993 case MVE_VSTRH32_pre
:
995 case MVE_VSTRH32_rq_u
:
997 case MVE_VSTRHU16_post
:
998 case MVE_VSTRHU16_pre
:
1000 case MVE_VSTRW32_qi_pre
:
1001 case MVE_VSTRW32_rq
:
1002 case MVE_VSTRW32_rq_u
:
1004 case MVE_VSTRWU32_post
:
1005 case MVE_VSTRWU32_pre
:
1006 case MVE_VSUB_qr_f16
:
1007 case MVE_VSUB_qr_f32
:
1008 case MVE_VSUB_qr_i16
:
1009 case MVE_VSUB_qr_i32
:
1010 case MVE_VSUB_qr_i8
:
1034 LLVMInitializeARMTargetInfo();
1035 LLVMInitializeARMTarget();
1036 LLVMInitializeARMTargetMC();
1038 auto TT(Triple::normalize("thumbv8.1m.main-none-none-eabi"));
1040 const Target
*T
= TargetRegistry::lookupTarget(TT
, Error
);
1046 TargetOptions Options
;
1047 auto TM
= std::unique_ptr
<TargetMachine
>(
1048 T
->createTargetMachine(TT
, "generic", "", Options
, std::nullopt
,
1049 std::nullopt
, CodeGenOptLevel::Default
));
1050 ARMSubtarget
ST(TM
->getTargetTriple(), std::string(TM
->getTargetCPU()),
1051 std::string(TM
->getTargetFeatureString()),
1052 *static_cast<const ARMBaseTargetMachine
*>(TM
.get()), false);
1054 auto MII
= TM
->getMCInstrInfo();
1055 for (unsigned i
= 0; i
< ARM::INSTRUCTION_LIST_END
; ++i
) {
1056 uint64_t Flags
= MII
->get(i
).TSFlags
;
1057 if ((Flags
& ARMII::DomainMask
) != ARMII::DomainMVE
)
1059 bool Valid
= (Flags
& ARMII::ValidForTailPredication
) != 0;
1060 ASSERT_EQ(IsValidTPOpcode(i
), Valid
)
1062 << ": mismatched expectation for tail-predicated safety\n";
1066 TEST(MachineInstr
, HasSideEffects
) {
1067 using namespace ARM
;
1068 std::set
<unsigned> UnpredictableOpcodes
= {
1116 VLDR_FPSCR_NZCVQC_off
,
1117 VLDR_FPSCR_NZCVQC_post
,
1118 VLDR_FPSCR_NZCVQC_pre
,
1163 VSTR_FPSCR_NZCVQC_off
,
1164 VSTR_FPSCR_NZCVQC_post
,
1165 VSTR_FPSCR_NZCVQC_pre
,
1177 LLVMInitializeARMTargetInfo();
1178 LLVMInitializeARMTarget();
1179 LLVMInitializeARMTargetMC();
1181 auto TT(Triple::normalize("thumbv8.1m.main-none-none-eabi"));
1183 const Target
*T
= TargetRegistry::lookupTarget(TT
, Error
);
1189 TargetOptions Options
;
1190 auto TM
= std::unique_ptr
<TargetMachine
>(
1191 T
->createTargetMachine(TT
, "generic", "", Options
, std::nullopt
,
1192 std::nullopt
, CodeGenOptLevel::Default
));
1193 ARMSubtarget
ST(TM
->getTargetTriple(), std::string(TM
->getTargetCPU()),
1194 std::string(TM
->getTargetFeatureString()),
1195 *static_cast<const ARMBaseTargetMachine
*>(TM
.get()), false);
1196 const ARMBaseInstrInfo
*TII
= ST
.getInstrInfo();
1197 auto MII
= TM
->getMCInstrInfo();
1199 for (unsigned Op
= 0; Op
< ARM::INSTRUCTION_LIST_END
; ++Op
) {
1200 const MCInstrDesc
&Desc
= TII
->get(Op
);
1202 (ARMII::DomainMVE
| ARMII::DomainVFP
| ARMII::DomainNEONA8
)) == 0)
1204 if (UnpredictableOpcodes
.count(Op
))
1207 ASSERT_FALSE(Desc
.hasUnmodeledSideEffects())
1208 << MII
->getName(Op
) << " has unexpected side effects";
1212 TEST(MachineInstr
, MVEVecSize
) {
1213 using namespace ARM
;
1214 auto MVEVecSize
= [](unsigned Opcode
) {
1217 dbgs() << Opcode
<< "\n";
1218 llvm_unreachable("Unexpected MVE instruction!");
1241 case MVE_VADDVs8acc
:
1242 case MVE_VADDVs8no_acc
:
1243 case MVE_VADDVu8acc
:
1244 case MVE_VADDVu8no_acc
:
1245 case MVE_VADD_qr_i8
:
1261 case MVE_VHADD_qr_s8
:
1262 case MVE_VHADD_qr_u8
:
1266 case MVE_VHSUB_qr_s8
:
1267 case MVE_VHSUB_qr_u8
:
1273 case MVE_VLD20_8_wb
:
1275 case MVE_VLD21_8_wb
:
1277 case MVE_VLD40_8_wb
:
1279 case MVE_VLD41_8_wb
:
1281 case MVE_VLD42_8_wb
:
1283 case MVE_VLD43_8_wb
:
1285 case MVE_VLDRBU8_post
:
1286 case MVE_VLDRBU8_pre
:
1287 case MVE_VLDRBU8_rq
:
1300 case MVE_VMLADAVas8
:
1301 case MVE_VMLADAVau8
:
1302 case MVE_VMLADAVaxs8
:
1305 case MVE_VMLADAVxs8
:
1306 case MVE_VMLAS_qr_i8
:
1307 case MVE_VMLA_qr_i8
:
1308 case MVE_VMLSDAVas8
:
1309 case MVE_VMLSDAVaxs8
:
1311 case MVE_VMLSDAVxs8
:
1312 case MVE_VMOV_from_lane_s8
:
1313 case MVE_VMOV_from_lane_u8
:
1314 case MVE_VMOV_to_lane_8
:
1318 case MVE_VMUL_qr_i8
:
1328 case MVE_VQADD_qr_s8
:
1329 case MVE_VQADD_qr_u8
:
1332 case MVE_VQDMLADHXs8
:
1333 case MVE_VQDMLADHs8
:
1334 case MVE_VQDMLAH_qrs8
:
1335 case MVE_VQDMLASH_qrs8
:
1336 case MVE_VQDMLSDHXs8
:
1337 case MVE_VQDMLSDHs8
:
1338 case MVE_VQDMULH_qr_s8
:
1341 case MVE_VQRDMLADHXs8
:
1342 case MVE_VQRDMLADHs8
:
1343 case MVE_VQRDMLAH_qrs8
:
1344 case MVE_VQRDMLASH_qrs8
:
1345 case MVE_VQRDMLSDHXs8
:
1346 case MVE_VQRDMLSDHs8
:
1347 case MVE_VQRDMULH_qr_s8
:
1348 case MVE_VQRDMULHi8
:
1349 case MVE_VQRSHL_by_vecs8
:
1350 case MVE_VQRSHL_by_vecu8
:
1351 case MVE_VQRSHL_qrs8
:
1352 case MVE_VQRSHL_qru8
:
1353 case MVE_VQSHLU_imms8
:
1354 case MVE_VQSHL_by_vecs8
:
1355 case MVE_VQSHL_by_vecu8
:
1356 case MVE_VQSHL_qrs8
:
1357 case MVE_VQSHL_qru8
:
1358 case MVE_VQSHLimms8
:
1359 case MVE_VQSHLimmu8
:
1360 case MVE_VQSUB_qr_s8
:
1361 case MVE_VQSUB_qr_u8
:
1368 case MVE_VRSHL_by_vecs8
:
1369 case MVE_VRSHL_by_vecu8
:
1370 case MVE_VRSHL_qrs8
:
1371 case MVE_VRSHL_qru8
:
1372 case MVE_VRSHR_imms8
:
1373 case MVE_VRSHR_immu8
:
1374 case MVE_VSHL_by_vecs8
:
1375 case MVE_VSHL_by_vecu8
:
1376 case MVE_VSHL_immi8
:
1379 case MVE_VSHR_imms8
:
1380 case MVE_VSHR_immu8
:
1384 case MVE_VST20_8_wb
:
1386 case MVE_VST21_8_wb
:
1388 case MVE_VST40_8_wb
:
1390 case MVE_VST41_8_wb
:
1392 case MVE_VST42_8_wb
:
1394 case MVE_VST43_8_wb
:
1397 case MVE_VSTRBU8_post
:
1398 case MVE_VSTRBU8_pre
:
1399 case MVE_VSUB_qr_i8
:
1419 case MVE_VADDVs16acc
:
1420 case MVE_VADDVs16no_acc
:
1421 case MVE_VADDVu16acc
:
1422 case MVE_VADDVu16no_acc
:
1423 case MVE_VADD_qr_f16
:
1424 case MVE_VADD_qr_i16
:
1427 case MVE_VBICimmi16
:
1444 case MVE_VCVTf16s16_fix
:
1445 case MVE_VCVTf16s16n
:
1446 case MVE_VCVTf16u16_fix
:
1447 case MVE_VCVTf16u16n
:
1448 case MVE_VCVTs16f16_fix
:
1449 case MVE_VCVTs16f16a
:
1450 case MVE_VCVTs16f16m
:
1451 case MVE_VCVTs16f16n
:
1452 case MVE_VCVTs16f16p
:
1453 case MVE_VCVTs16f16z
:
1454 case MVE_VCVTu16f16_fix
:
1455 case MVE_VCVTu16f16a
:
1456 case MVE_VCVTu16f16m
:
1457 case MVE_VCVTu16f16n
:
1458 case MVE_VCVTu16f16p
:
1459 case MVE_VCVTu16f16z
:
1463 case MVE_VFMA_qr_Sf16
:
1464 case MVE_VFMA_qr_f16
:
1467 case MVE_VHADD_qr_s16
:
1468 case MVE_VHADD_qr_u16
:
1472 case MVE_VHSUB_qr_s16
:
1473 case MVE_VHSUB_qr_u16
:
1479 case MVE_VLD20_16_wb
:
1481 case MVE_VLD21_16_wb
:
1483 case MVE_VLD40_16_wb
:
1485 case MVE_VLD41_16_wb
:
1487 case MVE_VLD42_16_wb
:
1489 case MVE_VLD43_16_wb
:
1491 case MVE_VLDRBS16_post
:
1492 case MVE_VLDRBS16_pre
:
1493 case MVE_VLDRBS16_rq
:
1495 case MVE_VLDRBU16_post
:
1496 case MVE_VLDRBU16_pre
:
1497 case MVE_VLDRBU16_rq
:
1499 case MVE_VLDRHU16_post
:
1500 case MVE_VLDRHU16_pre
:
1501 case MVE_VLDRHU16_rq
:
1502 case MVE_VLDRHU16_rq_u
:
1505 case MVE_VMAXNMAVf16
:
1506 case MVE_VMAXNMAf16
:
1507 case MVE_VMAXNMVf16
:
1515 case MVE_VMINNMAVf16
:
1516 case MVE_VMINNMAf16
:
1517 case MVE_VMINNMVf16
:
1523 case MVE_VMLADAVas16
:
1524 case MVE_VMLADAVau16
:
1525 case MVE_VMLADAVaxs16
:
1526 case MVE_VMLADAVs16
:
1527 case MVE_VMLADAVu16
:
1528 case MVE_VMLADAVxs16
:
1529 case MVE_VMLALDAVas16
:
1530 case MVE_VMLALDAVau16
:
1531 case MVE_VMLALDAVaxs16
:
1532 case MVE_VMLALDAVs16
:
1533 case MVE_VMLALDAVu16
:
1534 case MVE_VMLALDAVxs16
:
1535 case MVE_VMLAS_qr_i16
:
1536 case MVE_VMLA_qr_i16
:
1537 case MVE_VMLSDAVas16
:
1538 case MVE_VMLSDAVaxs16
:
1539 case MVE_VMLSDAVs16
:
1540 case MVE_VMLSDAVxs16
:
1541 case MVE_VMLSLDAVas16
:
1542 case MVE_VMLSLDAVaxs16
:
1543 case MVE_VMLSLDAVs16
:
1544 case MVE_VMLSLDAVxs16
:
1545 case MVE_VMOVNi16bh
:
1546 case MVE_VMOVNi16th
:
1547 case MVE_VMOV_from_lane_s16
:
1548 case MVE_VMOV_from_lane_u16
:
1549 case MVE_VMOV_to_lane_16
:
1550 case MVE_VMOVimmi16
:
1563 case MVE_VMUL_qr_f16
:
1564 case MVE_VMUL_qr_i16
:
1567 case MVE_VMVNimmi16
:
1570 case MVE_VORRimmi16
:
1580 case MVE_VQADD_qr_s16
:
1581 case MVE_VQADD_qr_u16
:
1584 case MVE_VQDMLADHXs16
:
1585 case MVE_VQDMLADHs16
:
1586 case MVE_VQDMLAH_qrs16
:
1587 case MVE_VQDMLASH_qrs16
:
1588 case MVE_VQDMLSDHXs16
:
1589 case MVE_VQDMLSDHs16
:
1590 case MVE_VQDMULH_qr_s16
:
1591 case MVE_VQDMULHi16
:
1592 case MVE_VQDMULL_qr_s16bh
:
1593 case MVE_VQDMULL_qr_s16th
:
1594 case MVE_VQDMULLs16bh
:
1595 case MVE_VQDMULLs16th
:
1596 case MVE_VQMOVNs16bh
:
1597 case MVE_VQMOVNs16th
:
1598 case MVE_VQMOVNu16bh
:
1599 case MVE_VQMOVNu16th
:
1600 case MVE_VQMOVUNs16bh
:
1601 case MVE_VQMOVUNs16th
:
1603 case MVE_VQRDMLADHXs16
:
1604 case MVE_VQRDMLADHs16
:
1605 case MVE_VQRDMLAH_qrs16
:
1606 case MVE_VQRDMLASH_qrs16
:
1607 case MVE_VQRDMLSDHXs16
:
1608 case MVE_VQRDMLSDHs16
:
1609 case MVE_VQRDMULH_qr_s16
:
1610 case MVE_VQRDMULHi16
:
1611 case MVE_VQRSHL_by_vecs16
:
1612 case MVE_VQRSHL_by_vecu16
:
1613 case MVE_VQRSHL_qrs16
:
1614 case MVE_VQRSHL_qru16
:
1615 case MVE_VQRSHRNbhs16
:
1616 case MVE_VQRSHRNbhu16
:
1617 case MVE_VQRSHRNths16
:
1618 case MVE_VQRSHRNthu16
:
1619 case MVE_VQRSHRUNs16bh
:
1620 case MVE_VQRSHRUNs16th
:
1621 case MVE_VQSHLU_imms16
:
1622 case MVE_VQSHL_by_vecs16
:
1623 case MVE_VQSHL_by_vecu16
:
1624 case MVE_VQSHL_qrs16
:
1625 case MVE_VQSHL_qru16
:
1626 case MVE_VQSHLimms16
:
1627 case MVE_VQSHLimmu16
:
1628 case MVE_VQSHRNbhs16
:
1629 case MVE_VQSHRNbhu16
:
1630 case MVE_VQSHRNths16
:
1631 case MVE_VQSHRNthu16
:
1632 case MVE_VQSHRUNs16bh
:
1633 case MVE_VQSHRUNs16th
:
1634 case MVE_VQSUB_qr_s16
:
1635 case MVE_VQSUB_qr_u16
:
1649 case MVE_VRSHL_by_vecs16
:
1650 case MVE_VRSHL_by_vecu16
:
1651 case MVE_VRSHL_qrs16
:
1652 case MVE_VRSHL_qru16
:
1653 case MVE_VRSHRNi16bh
:
1654 case MVE_VRSHRNi16th
:
1655 case MVE_VRSHR_imms16
:
1656 case MVE_VRSHR_immu16
:
1657 case MVE_VSHLL_imms8bh
:
1658 case MVE_VSHLL_imms8th
:
1659 case MVE_VSHLL_immu8bh
:
1660 case MVE_VSHLL_immu8th
:
1661 case MVE_VSHLL_lws8bh
:
1662 case MVE_VSHLL_lws8th
:
1663 case MVE_VSHLL_lwu8bh
:
1664 case MVE_VSHLL_lwu8th
:
1665 case MVE_VSHL_by_vecs16
:
1666 case MVE_VSHL_by_vecu16
:
1667 case MVE_VSHL_immi16
:
1668 case MVE_VSHL_qrs16
:
1669 case MVE_VSHL_qru16
:
1670 case MVE_VSHRNi16bh
:
1671 case MVE_VSHRNi16th
:
1672 case MVE_VSHR_imms16
:
1673 case MVE_VSHR_immu16
:
1677 case MVE_VST20_16_wb
:
1679 case MVE_VST21_16_wb
:
1681 case MVE_VST40_16_wb
:
1683 case MVE_VST41_16_wb
:
1685 case MVE_VST42_16_wb
:
1687 case MVE_VST43_16_wb
:
1689 case MVE_VSTRB16_post
:
1690 case MVE_VSTRB16_pre
:
1691 case MVE_VSTRB16_rq
:
1692 case MVE_VSTRH16_rq
:
1693 case MVE_VSTRH16_rq_u
:
1695 case MVE_VSTRHU16_post
:
1696 case MVE_VSTRHU16_pre
:
1697 case MVE_VSUB_qr_f16
:
1698 case MVE_VSUB_qr_i16
:
1711 case MVE_VADDLVs32acc
:
1712 case MVE_VADDLVs32no_acc
:
1713 case MVE_VADDLVu32acc
:
1714 case MVE_VADDLVu32no_acc
:
1715 case MVE_VADDVs32acc
:
1716 case MVE_VADDVs32no_acc
:
1717 case MVE_VADDVu32acc
:
1718 case MVE_VADDVu32no_acc
:
1719 case MVE_VADD_qr_f32
:
1720 case MVE_VADD_qr_i32
:
1723 case MVE_VBICimmi32
:
1740 case MVE_VCVTf16f32bh
:
1741 case MVE_VCVTf16f32th
:
1742 case MVE_VCVTf32f16bh
:
1743 case MVE_VCVTf32f16th
:
1744 case MVE_VCVTf32s32_fix
:
1745 case MVE_VCVTf32s32n
:
1746 case MVE_VCVTf32u32_fix
:
1747 case MVE_VCVTf32u32n
:
1748 case MVE_VCVTs32f32_fix
:
1749 case MVE_VCVTs32f32a
:
1750 case MVE_VCVTs32f32m
:
1751 case MVE_VCVTs32f32n
:
1752 case MVE_VCVTs32f32p
:
1753 case MVE_VCVTs32f32z
:
1754 case MVE_VCVTu32f32_fix
:
1755 case MVE_VCVTu32f32a
:
1756 case MVE_VCVTu32f32m
:
1757 case MVE_VCVTu32f32n
:
1758 case MVE_VCVTu32f32p
:
1759 case MVE_VCVTu32f32z
:
1763 case MVE_VFMA_qr_Sf32
:
1764 case MVE_VFMA_qr_f32
:
1767 case MVE_VHADD_qr_s32
:
1768 case MVE_VHADD_qr_u32
:
1772 case MVE_VHSUB_qr_s32
:
1773 case MVE_VHSUB_qr_u32
:
1779 case MVE_VLD20_32_wb
:
1781 case MVE_VLD21_32_wb
:
1783 case MVE_VLD40_32_wb
:
1785 case MVE_VLD41_32_wb
:
1787 case MVE_VLD42_32_wb
:
1789 case MVE_VLD43_32_wb
:
1791 case MVE_VLDRBS32_post
:
1792 case MVE_VLDRBS32_pre
:
1793 case MVE_VLDRBS32_rq
:
1795 case MVE_VLDRBU32_post
:
1796 case MVE_VLDRBU32_pre
:
1797 case MVE_VLDRBU32_rq
:
1799 case MVE_VLDRHS32_post
:
1800 case MVE_VLDRHS32_pre
:
1801 case MVE_VLDRHS32_rq
:
1802 case MVE_VLDRHS32_rq_u
:
1804 case MVE_VLDRHU32_post
:
1805 case MVE_VLDRHU32_pre
:
1806 case MVE_VLDRHU32_rq
:
1807 case MVE_VLDRHU32_rq_u
:
1809 case MVE_VLDRWU32_post
:
1810 case MVE_VLDRWU32_pre
:
1811 case MVE_VLDRWU32_qi
:
1812 case MVE_VLDRWU32_qi_pre
:
1813 case MVE_VLDRWU32_rq
:
1814 case MVE_VLDRWU32_rq_u
:
1817 case MVE_VMAXNMAVf32
:
1818 case MVE_VMAXNMAf32
:
1819 case MVE_VMAXNMVf32
:
1827 case MVE_VMINNMAVf32
:
1828 case MVE_VMINNMAf32
:
1829 case MVE_VMINNMVf32
:
1835 case MVE_VMLADAVas32
:
1836 case MVE_VMLADAVau32
:
1837 case MVE_VMLADAVaxs32
:
1838 case MVE_VMLADAVs32
:
1839 case MVE_VMLADAVu32
:
1840 case MVE_VMLADAVxs32
:
1841 case MVE_VMLALDAVas32
:
1842 case MVE_VMLALDAVau32
:
1843 case MVE_VMLALDAVaxs32
:
1844 case MVE_VMLALDAVs32
:
1845 case MVE_VMLALDAVu32
:
1846 case MVE_VMLALDAVxs32
:
1847 case MVE_VMLAS_qr_i32
:
1848 case MVE_VMLA_qr_i32
:
1849 case MVE_VMLSDAVas32
:
1850 case MVE_VMLSDAVaxs32
:
1851 case MVE_VMLSDAVs32
:
1852 case MVE_VMLSDAVxs32
:
1853 case MVE_VMLSLDAVas32
:
1854 case MVE_VMLSLDAVaxs32
:
1855 case MVE_VMLSLDAVs32
:
1856 case MVE_VMLSLDAVxs32
:
1857 case MVE_VMOVNi32bh
:
1858 case MVE_VMOVNi32th
:
1859 case MVE_VMOV_from_lane_32
:
1862 case MVE_VMOV_to_lane_32
:
1863 case MVE_VMOVimmf32
:
1864 case MVE_VMOVimmi32
:
1865 case MVE_VMOVLs16bh
:
1866 case MVE_VMOVLs16th
:
1867 case MVE_VMOVLu16bh
:
1868 case MVE_VMOVLu16th
:
1877 case MVE_VMUL_qr_f32
:
1878 case MVE_VMUL_qr_i32
:
1881 case MVE_VMVNimmi32
:
1884 case MVE_VORRimmi32
:
1894 case MVE_VQADD_qr_s32
:
1895 case MVE_VQADD_qr_u32
:
1898 case MVE_VQDMLADHXs32
:
1899 case MVE_VQDMLADHs32
:
1900 case MVE_VQDMLAH_qrs32
:
1901 case MVE_VQDMLASH_qrs32
:
1902 case MVE_VQDMLSDHXs32
:
1903 case MVE_VQDMLSDHs32
:
1904 case MVE_VQDMULH_qr_s32
:
1905 case MVE_VQDMULHi32
:
1906 case MVE_VQDMULL_qr_s32bh
:
1907 case MVE_VQDMULL_qr_s32th
:
1908 case MVE_VQDMULLs32bh
:
1909 case MVE_VQDMULLs32th
:
1910 case MVE_VQMOVNs32bh
:
1911 case MVE_VQMOVNs32th
:
1912 case MVE_VQMOVNu32bh
:
1913 case MVE_VQMOVNu32th
:
1914 case MVE_VQMOVUNs32bh
:
1915 case MVE_VQMOVUNs32th
:
1917 case MVE_VQRDMLADHXs32
:
1918 case MVE_VQRDMLADHs32
:
1919 case MVE_VQRDMLAH_qrs32
:
1920 case MVE_VQRDMLASH_qrs32
:
1921 case MVE_VQRDMLSDHXs32
:
1922 case MVE_VQRDMLSDHs32
:
1923 case MVE_VQRDMULH_qr_s32
:
1924 case MVE_VQRDMULHi32
:
1925 case MVE_VQRSHL_by_vecs32
:
1926 case MVE_VQRSHL_by_vecu32
:
1927 case MVE_VQRSHL_qrs32
:
1928 case MVE_VQRSHL_qru32
:
1929 case MVE_VQRSHRNbhs32
:
1930 case MVE_VQRSHRNbhu32
:
1931 case MVE_VQRSHRNths32
:
1932 case MVE_VQRSHRNthu32
:
1933 case MVE_VQRSHRUNs32bh
:
1934 case MVE_VQRSHRUNs32th
:
1935 case MVE_VQSHLU_imms32
:
1936 case MVE_VQSHL_by_vecs32
:
1937 case MVE_VQSHL_by_vecu32
:
1938 case MVE_VQSHL_qrs32
:
1939 case MVE_VQSHL_qru32
:
1940 case MVE_VQSHLimms32
:
1941 case MVE_VQSHLimmu32
:
1942 case MVE_VQSHRNbhs32
:
1943 case MVE_VQSHRNbhu32
:
1944 case MVE_VQSHRNths32
:
1945 case MVE_VQSHRNthu32
:
1946 case MVE_VQSHRUNs32bh
:
1947 case MVE_VQSHRUNs32th
:
1948 case MVE_VQSUB_qr_s32
:
1949 case MVE_VQSUB_qr_u32
:
1962 case MVE_VRMLALDAVHas32
:
1963 case MVE_VRMLALDAVHau32
:
1964 case MVE_VRMLALDAVHaxs32
:
1965 case MVE_VRMLALDAVHs32
:
1966 case MVE_VRMLALDAVHu32
:
1967 case MVE_VRMLALDAVHxs32
:
1968 case MVE_VRMLSLDAVHas32
:
1969 case MVE_VRMLSLDAVHaxs32
:
1970 case MVE_VRMLSLDAVHs32
:
1971 case MVE_VRMLSLDAVHxs32
:
1974 case MVE_VRSHL_by_vecs32
:
1975 case MVE_VRSHL_by_vecu32
:
1976 case MVE_VRSHL_qrs32
:
1977 case MVE_VRSHL_qru32
:
1978 case MVE_VRSHRNi32bh
:
1979 case MVE_VRSHRNi32th
:
1980 case MVE_VRSHR_imms32
:
1981 case MVE_VRSHR_immu32
:
1985 case MVE_VSHLL_imms16bh
:
1986 case MVE_VSHLL_imms16th
:
1987 case MVE_VSHLL_immu16bh
:
1988 case MVE_VSHLL_immu16th
:
1989 case MVE_VSHLL_lws16bh
:
1990 case MVE_VSHLL_lws16th
:
1991 case MVE_VSHLL_lwu16bh
:
1992 case MVE_VSHLL_lwu16th
:
1993 case MVE_VSHL_by_vecs32
:
1994 case MVE_VSHL_by_vecu32
:
1995 case MVE_VSHL_immi32
:
1996 case MVE_VSHL_qrs32
:
1997 case MVE_VSHL_qru32
:
1998 case MVE_VSHRNi32bh
:
1999 case MVE_VSHRNi32th
:
2000 case MVE_VSHR_imms32
:
2001 case MVE_VSHR_immu32
:
2005 case MVE_VST20_32_wb
:
2007 case MVE_VST21_32_wb
:
2009 case MVE_VST40_32_wb
:
2011 case MVE_VST41_32_wb
:
2013 case MVE_VST42_32_wb
:
2015 case MVE_VST43_32_wb
:
2017 case MVE_VSTRB32_post
:
2018 case MVE_VSTRB32_pre
:
2019 case MVE_VSTRB32_rq
:
2021 case MVE_VSTRH32_post
:
2022 case MVE_VSTRH32_pre
:
2023 case MVE_VSTRH32_rq
:
2024 case MVE_VSTRH32_rq_u
:
2025 case MVE_VSTRW32_qi
:
2026 case MVE_VSTRW32_qi_pre
:
2027 case MVE_VSTRW32_rq
:
2028 case MVE_VSTRW32_rq_u
:
2030 case MVE_VSTRWU32_post
:
2031 case MVE_VSTRWU32_pre
:
2032 case MVE_VSUB_qr_f32
:
2033 case MVE_VSUB_qr_i32
:
2038 case MVE_VLDRDU64_qi
:
2039 case MVE_VLDRDU64_qi_pre
:
2040 case MVE_VLDRDU64_rq
:
2041 case MVE_VLDRDU64_rq_u
:
2046 case MVE_VMOVimmi64
:
2050 case MVE_VSTRD64_qi
:
2051 case MVE_VSTRD64_qi_pre
:
2052 case MVE_VSTRD64_rq
:
2053 case MVE_VSTRD64_rq_u
:
2057 LLVMInitializeARMTargetInfo();
2058 LLVMInitializeARMTarget();
2059 LLVMInitializeARMTargetMC();
2061 auto TT(Triple::normalize("thumbv8.1m.main-none-none-eabi"));
2063 const Target
*T
= TargetRegistry::lookupTarget(TT
, Error
);
2069 TargetOptions Options
;
2070 auto TM
= std::unique_ptr
<TargetMachine
>(
2071 T
->createTargetMachine(TT
, "generic", "", Options
, std::nullopt
,
2072 std::nullopt
, CodeGenOptLevel::Default
));
2073 ARMSubtarget
ST(TM
->getTargetTriple(), std::string(TM
->getTargetCPU()),
2074 std::string(TM
->getTargetFeatureString()),
2075 *static_cast<const ARMBaseTargetMachine
*>(TM
.get()), false);
2077 auto MII
= TM
->getMCInstrInfo();
2078 for (unsigned i
= 0; i
< ARM::INSTRUCTION_LIST_END
; ++i
) {
2079 uint64_t Flags
= MII
->get(i
).TSFlags
;
2080 if ((Flags
& ARMII::DomainMask
) != ARMII::DomainMVE
)
2082 int Size
= (Flags
& ARMII::VecSize
) >> ARMII::VecSizeShift
;
2083 ASSERT_EQ(MVEVecSize(i
), Size
)
2085 << ": mismatched expectation for MVE vec size\n";