1
1
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2
+ // RUN: %clang_cc1 -ffreestanding -triple armv8a-none-eabi -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch32
2
3
// RUN: %clang_cc1 -ffreestanding -triple armv8a-none-eabi -target-feature +crc -target-feature +dsp -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch32
3
4
// RUN: %clang_cc1 -ffreestanding -Wno-error=implicit-function-declaration -triple aarch64-none-elf -target-feature +neon -target-feature +crc -target-feature +crypto -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch64
4
5
// RUN: %clang_cc1 -ffreestanding -triple aarch64-none-elf -target-feature +v8.3a -target-feature +crc -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch64,AArch6483
@@ -638,12 +639,15 @@ uint32_t test_usat(int32_t t) {
638
639
#endif
639
640
640
641
/* 9.4.2 Saturating addition and subtraction intrinsics */
641
- #ifdef __ARM_FEATURE_DSP
642
+ #ifdef __ARM_32BIT_STATE
642
643
// AArch32-LABEL: @test_qadd(
643
644
// AArch32-NEXT: entry:
644
645
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qadd(i32 [[A:%.*]], i32 [[B:%.*]])
645
646
// AArch32-NEXT: ret i32 [[TMP0]]
646
647
//
648
+ #ifndef __ARM_FEATURE_DSP
649
+ __attribute__((target ("dsp" )))
650
+ #endif
647
651
int32_t test_qadd (int32_t a , int32_t b ) {
648
652
return __qadd (a , b );
649
653
}
@@ -653,6 +657,9 @@ int32_t test_qadd(int32_t a, int32_t b) {
653
657
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qsub(i32 [[A:%.*]], i32 [[B:%.*]])
654
658
// AArch32-NEXT: ret i32 [[TMP0]]
655
659
//
660
+ #ifndef __ARM_FEATURE_DSP
661
+ __attribute__((target ("dsp" )))
662
+ #endif
656
663
int32_t test_qsub (int32_t a , int32_t b ) {
657
664
return __qsub (a , b );
658
665
}
@@ -664,6 +671,9 @@ extern int32_t f();
664
671
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qadd(i32 [[CALL]], i32 [[CALL]])
665
672
// AArch32-NEXT: ret i32 [[TMP0]]
666
673
//
674
+ #ifndef __ARM_FEATURE_DSP
675
+ __attribute__((target ("dsp" )))
676
+ #endif
667
677
int32_t test_qdbl () {
668
678
return __qdbl (f ());
669
679
}
@@ -672,12 +682,15 @@ int32_t test_qdbl() {
672
682
/*
673
683
* 9.3 16-bit multiplications
674
684
*/
675
- #if __ARM_FEATURE_DSP
685
+ #ifdef __ARM_32BIT_STATE
676
686
// AArch32-LABEL: @test_smulbb(
677
687
// AArch32-NEXT: entry:
678
688
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smulbb(i32 [[A:%.*]], i32 [[B:%.*]])
679
689
// AArch32-NEXT: ret i32 [[TMP0]]
680
690
//
691
+ #ifndef __ARM_FEATURE_DSP
692
+ __attribute__((target ("dsp" )))
693
+ #endif
681
694
int32_t test_smulbb (int32_t a , int32_t b ) {
682
695
return __smulbb (a , b );
683
696
}
@@ -687,6 +700,9 @@ int32_t test_smulbb(int32_t a, int32_t b) {
687
700
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smulbt(i32 [[A:%.*]], i32 [[B:%.*]])
688
701
// AArch32-NEXT: ret i32 [[TMP0]]
689
702
//
703
+ #ifndef __ARM_FEATURE_DSP
704
+ __attribute__((target ("dsp" )))
705
+ #endif
690
706
int32_t test_smulbt (int32_t a , int32_t b ) {
691
707
return __smulbt (a , b );
692
708
}
@@ -696,6 +712,9 @@ int32_t test_smulbt(int32_t a, int32_t b) {
696
712
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smultb(i32 [[A:%.*]], i32 [[B:%.*]])
697
713
// AArch32-NEXT: ret i32 [[TMP0]]
698
714
//
715
+ #ifndef __ARM_FEATURE_DSP
716
+ __attribute__((target ("dsp" )))
717
+ #endif
699
718
int32_t test_smultb (int32_t a , int32_t b ) {
700
719
return __smultb (a , b );
701
720
}
@@ -705,6 +724,9 @@ int32_t test_smultb(int32_t a, int32_t b) {
705
724
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smultt(i32 [[A:%.*]], i32 [[B:%.*]])
706
725
// AArch32-NEXT: ret i32 [[TMP0]]
707
726
//
727
+ #ifndef __ARM_FEATURE_DSP
728
+ __attribute__((target ("dsp" )))
729
+ #endif
708
730
int32_t test_smultt (int32_t a , int32_t b ) {
709
731
return __smultt (a , b );
710
732
}
@@ -714,6 +736,9 @@ int32_t test_smultt(int32_t a, int32_t b) {
714
736
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smulwb(i32 [[A:%.*]], i32 [[B:%.*]])
715
737
// AArch32-NEXT: ret i32 [[TMP0]]
716
738
//
739
+ #ifndef __ARM_FEATURE_DSP
740
+ __attribute__((target ("dsp" )))
741
+ #endif
717
742
int32_t test_smulwb (int32_t a , int32_t b ) {
718
743
return __smulwb (a , b );
719
744
}
@@ -723,18 +748,24 @@ int32_t test_smulwb(int32_t a, int32_t b) {
723
748
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smulwt(i32 [[A:%.*]], i32 [[B:%.*]])
724
749
// AArch32-NEXT: ret i32 [[TMP0]]
725
750
//
751
+ #ifndef __ARM_FEATURE_DSP
752
+ __attribute__((target ("dsp" )))
753
+ #endif
726
754
int32_t test_smulwt (int32_t a , int32_t b ) {
727
755
return __smulwt (a , b );
728
756
}
729
757
#endif
730
758
731
759
/* 9.4.3 Accumultating multiplications */
732
- #if __ARM_FEATURE_DSP
760
+ #ifdef __ARM_32BIT_STATE
733
761
// AArch32-LABEL: @test_smlabb(
734
762
// AArch32-NEXT: entry:
735
763
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlabb(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]])
736
764
// AArch32-NEXT: ret i32 [[TMP0]]
737
765
//
766
+ #ifndef __ARM_FEATURE_DSP
767
+ __attribute__((target ("dsp" )))
768
+ #endif
738
769
int32_t test_smlabb (int32_t a , int32_t b , int32_t c ) {
739
770
return __smlabb (a , b , c );
740
771
}
@@ -744,6 +775,9 @@ int32_t test_smlabb(int32_t a, int32_t b, int32_t c) {
744
775
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlabt(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]])
745
776
// AArch32-NEXT: ret i32 [[TMP0]]
746
777
//
778
+ #ifndef __ARM_FEATURE_DSP
779
+ __attribute__((target ("dsp" )))
780
+ #endif
747
781
int32_t test_smlabt (int32_t a , int32_t b , int32_t c ) {
748
782
return __smlabt (a , b , c );
749
783
}
@@ -753,6 +787,9 @@ int32_t test_smlabt(int32_t a, int32_t b, int32_t c) {
753
787
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlatb(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]])
754
788
// AArch32-NEXT: ret i32 [[TMP0]]
755
789
//
790
+ #ifndef __ARM_FEATURE_DSP
791
+ __attribute__((target ("dsp" )))
792
+ #endif
756
793
int32_t test_smlatb (int32_t a , int32_t b , int32_t c ) {
757
794
return __smlatb (a , b , c );
758
795
}
@@ -762,6 +799,9 @@ int32_t test_smlatb(int32_t a, int32_t b, int32_t c) {
762
799
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlatt(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]])
763
800
// AArch32-NEXT: ret i32 [[TMP0]]
764
801
//
802
+ #ifndef __ARM_FEATURE_DSP
803
+ __attribute__((target ("dsp" )))
804
+ #endif
765
805
int32_t test_smlatt (int32_t a , int32_t b , int32_t c ) {
766
806
return __smlatt (a , b , c );
767
807
}
@@ -771,6 +811,9 @@ int32_t test_smlatt(int32_t a, int32_t b, int32_t c) {
771
811
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlawb(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]])
772
812
// AArch32-NEXT: ret i32 [[TMP0]]
773
813
//
814
+ #ifndef __ARM_FEATURE_DSP
815
+ __attribute__((target ("dsp" )))
816
+ #endif
774
817
int32_t test_smlawb (int32_t a , int32_t b , int32_t c ) {
775
818
return __smlawb (a , b , c );
776
819
}
@@ -780,6 +823,9 @@ int32_t test_smlawb(int32_t a, int32_t b, int32_t c) {
780
823
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlawt(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]])
781
824
// AArch32-NEXT: ret i32 [[TMP0]]
782
825
//
826
+ #ifndef __ARM_FEATURE_DSP
827
+ __attribute__((target ("dsp" )))
828
+ #endif
783
829
int32_t test_smlawt (int32_t a , int32_t b , int32_t c ) {
784
830
return __smlawt (a , b , c );
785
831
}
@@ -1335,6 +1381,9 @@ int32_t test_smusdx(int16x2_t a, int16x2_t b) {
1335
1381
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.aarch64.crc32b(i32 [[A:%.*]], i32 [[TMP0]])
1336
1382
// AArch64-NEXT: ret i32 [[TMP1]]
1337
1383
//
1384
+ #ifndef __ARM_FEATURE_CRC32
1385
+ __attribute__((target ("crc" )))
1386
+ #endif
1338
1387
uint32_t test_crc32b (uint32_t a , uint8_t b ) {
1339
1388
return __crc32b (a , b );
1340
1389
}
@@ -1351,6 +1400,9 @@ uint32_t test_crc32b(uint32_t a, uint8_t b) {
1351
1400
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.aarch64.crc32h(i32 [[A:%.*]], i32 [[TMP0]])
1352
1401
// AArch64-NEXT: ret i32 [[TMP1]]
1353
1402
//
1403
+ #ifndef __ARM_FEATURE_CRC32
1404
+ __attribute__((target ("crc" )))
1405
+ #endif
1354
1406
uint32_t test_crc32h (uint32_t a , uint16_t b ) {
1355
1407
return __crc32h (a , b );
1356
1408
}
@@ -1365,6 +1417,9 @@ uint32_t test_crc32h(uint32_t a, uint16_t b) {
1365
1417
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.crc32w(i32 [[A:%.*]], i32 [[B:%.*]])
1366
1418
// AArch64-NEXT: ret i32 [[TMP0]]
1367
1419
//
1420
+ #ifndef __ARM_FEATURE_CRC32
1421
+ __attribute__((target ("crc" )))
1422
+ #endif
1368
1423
uint32_t test_crc32w (uint32_t a , uint32_t b ) {
1369
1424
return __crc32w (a , b );
1370
1425
}
@@ -1383,6 +1438,9 @@ uint32_t test_crc32w(uint32_t a, uint32_t b) {
1383
1438
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.crc32x(i32 [[A:%.*]], i64 [[B:%.*]])
1384
1439
// AArch64-NEXT: ret i32 [[TMP0]]
1385
1440
//
1441
+ #ifndef __ARM_FEATURE_CRC32
1442
+ __attribute__((target ("crc" )))
1443
+ #endif
1386
1444
uint32_t test_crc32d (uint32_t a , uint64_t b ) {
1387
1445
return __crc32d (a , b );
1388
1446
}
@@ -1399,6 +1457,9 @@ uint32_t test_crc32d(uint32_t a, uint64_t b) {
1399
1457
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.aarch64.crc32cb(i32 [[A:%.*]], i32 [[TMP0]])
1400
1458
// AArch64-NEXT: ret i32 [[TMP1]]
1401
1459
//
1460
+ #ifndef __ARM_FEATURE_CRC32
1461
+ __attribute__((target ("crc" )))
1462
+ #endif
1402
1463
uint32_t test_crc32cb (uint32_t a , uint8_t b ) {
1403
1464
return __crc32cb (a , b );
1404
1465
}
@@ -1415,6 +1476,9 @@ uint32_t test_crc32cb(uint32_t a, uint8_t b) {
1415
1476
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.aarch64.crc32ch(i32 [[A:%.*]], i32 [[TMP0]])
1416
1477
// AArch64-NEXT: ret i32 [[TMP1]]
1417
1478
//
1479
+ #ifndef __ARM_FEATURE_CRC32
1480
+ __attribute__((target ("crc" )))
1481
+ #endif
1418
1482
uint32_t test_crc32ch (uint32_t a , uint16_t b ) {
1419
1483
return __crc32ch (a , b );
1420
1484
}
@@ -1429,6 +1493,9 @@ uint32_t test_crc32ch(uint32_t a, uint16_t b) {
1429
1493
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.crc32cw(i32 [[A:%.*]], i32 [[B:%.*]])
1430
1494
// AArch64-NEXT: ret i32 [[TMP0]]
1431
1495
//
1496
+ #ifndef __ARM_FEATURE_CRC32
1497
+ __attribute__((target ("crc" )))
1498
+ #endif
1432
1499
uint32_t test_crc32cw (uint32_t a , uint32_t b ) {
1433
1500
return __crc32cw (a , b );
1434
1501
}
@@ -1447,6 +1514,9 @@ uint32_t test_crc32cw(uint32_t a, uint32_t b) {
1447
1514
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.crc32cx(i32 [[A:%.*]], i64 [[B:%.*]])
1448
1515
// AArch64-NEXT: ret i32 [[TMP0]]
1449
1516
//
1517
+ #ifndef __ARM_FEATURE_CRC32
1518
+ __attribute__((target ("crc" )))
1519
+ #endif
1450
1520
uint32_t test_crc32cd (uint32_t a , uint64_t b ) {
1451
1521
return __crc32cd (a , b );
1452
1522
}
0 commit comments