Skip to content

Commit 21eedc0

Browse files
MartinWehkingmahesh-attarde
authored andcommitted
Fix implicit vector conversion (llvm#149970)
Previously, the unsigned NEON intrinsic variants of 'vqshrun_high_n' and 'vqrshrun_high_n' were using signed integer types for their first argument and return values. These should be unsigned according to developer.arm.com, however. Adjust the test cases accordingly.
1 parent 39a5f26 commit 21eedc0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

clang/include/clang/Basic/arm_neon.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,11 +964,11 @@ def SLI_N : WInst<"vsli_n", "...I", "PlQPl", [ImmCheck<2, ImmCheckShiftLeft, 0>]
964964
// Right shift narrow high
965965
def SHRN_HIGH_N : IOpInst<"vshrn_high_n", "<(<q).I",
966966
"HsHiHlHUsHUiHUl", OP_NARROW_HI>;
967-
def QSHRUN_HIGH_N : SOpInst<"vqshrun_high_n", "<(<q).I",
967+
def QSHRUN_HIGH_N : SOpInst<"vqshrun_high_n", "(<U)(<Uq).I",
968968
"HsHiHl", OP_NARROW_HI>;
969969
def RSHRN_HIGH_N : IOpInst<"vrshrn_high_n", "<(<q).I",
970970
"HsHiHlHUsHUiHUl", OP_NARROW_HI>;
971-
def QRSHRUN_HIGH_N : SOpInst<"vqrshrun_high_n", "<(<q).I",
971+
def QRSHRUN_HIGH_N : SOpInst<"vqrshrun_high_n", "(<U)(<Uq).I",
972972
"HsHiHl", OP_NARROW_HI>;
973973
def QSHRN_HIGH_N : SOpInst<"vqshrn_high_n", "<(<q).I",
974974
"HsHiHlHUsHUiHUl", OP_NARROW_HI>;

clang/test/CodeGen/AArch64/neon-intrinsics.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8585,7 +8585,7 @@ uint32x2_t test_vqshrun_n_s64(int64x2_t a) {
85858585
// CHECK-NEXT: [[SHUFFLE_I:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[VQSHRUN_N3]], <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
85868586
// CHECK-NEXT: ret <16 x i8> [[SHUFFLE_I]]
85878587
//
8588-
int8x16_t test_vqshrun_high_n_s16(int8x8_t a, int16x8_t b) {
8588+
uint8x16_t test_vqshrun_high_n_s16(uint8x8_t a, int16x8_t b) {
85898589
return vqshrun_high_n_s16(a, b, 3);
85908590
}
85918591

@@ -8598,7 +8598,7 @@ int8x16_t test_vqshrun_high_n_s16(int8x8_t a, int16x8_t b) {
85988598
// CHECK-NEXT: [[SHUFFLE_I:%.*]] = shufflevector <4 x i16> [[A]], <4 x i16> [[VQSHRUN_N3]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
85998599
// CHECK-NEXT: ret <8 x i16> [[SHUFFLE_I]]
86008600
//
8601-
int16x8_t test_vqshrun_high_n_s32(int16x4_t a, int32x4_t b) {
8601+
uint16x8_t test_vqshrun_high_n_s32(uint16x4_t a, int32x4_t b) {
86028602
return vqshrun_high_n_s32(a, b, 9);
86038603
}
86048604

@@ -8611,7 +8611,7 @@ int16x8_t test_vqshrun_high_n_s32(int16x4_t a, int32x4_t b) {
86118611
// CHECK-NEXT: [[SHUFFLE_I:%.*]] = shufflevector <2 x i32> [[A]], <2 x i32> [[VQSHRUN_N3]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
86128612
// CHECK-NEXT: ret <4 x i32> [[SHUFFLE_I]]
86138613
//
8614-
int32x4_t test_vqshrun_high_n_s64(int32x2_t a, int64x2_t b) {
8614+
uint32x4_t test_vqshrun_high_n_s64(uint32x2_t a, int64x2_t b) {
86158615
return vqshrun_high_n_s64(a, b, 19);
86168616
}
86178617

@@ -8810,7 +8810,7 @@ uint32x2_t test_vqrshrun_n_s64(int64x2_t a) {
88108810
// CHECK-NEXT: [[SHUFFLE_I:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[VQRSHRUN_N3]], <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
88118811
// CHECK-NEXT: ret <16 x i8> [[SHUFFLE_I]]
88128812
//
8813-
int8x16_t test_vqrshrun_high_n_s16(int8x8_t a, int16x8_t b) {
8813+
uint8x16_t test_vqrshrun_high_n_s16(uint8x8_t a, int16x8_t b) {
88148814
return vqrshrun_high_n_s16(a, b, 3);
88158815
}
88168816

@@ -8823,7 +8823,7 @@ int8x16_t test_vqrshrun_high_n_s16(int8x8_t a, int16x8_t b) {
88238823
// CHECK-NEXT: [[SHUFFLE_I:%.*]] = shufflevector <4 x i16> [[A]], <4 x i16> [[VQRSHRUN_N3]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
88248824
// CHECK-NEXT: ret <8 x i16> [[SHUFFLE_I]]
88258825
//
8826-
int16x8_t test_vqrshrun_high_n_s32(int16x4_t a, int32x4_t b) {
8826+
uint16x8_t test_vqrshrun_high_n_s32(uint16x4_t a, int32x4_t b) {
88278827
return vqrshrun_high_n_s32(a, b, 9);
88288828
}
88298829

@@ -8836,7 +8836,7 @@ int16x8_t test_vqrshrun_high_n_s32(int16x4_t a, int32x4_t b) {
88368836
// CHECK-NEXT: [[SHUFFLE_I:%.*]] = shufflevector <2 x i32> [[A]], <2 x i32> [[VQRSHRUN_N3]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
88378837
// CHECK-NEXT: ret <4 x i32> [[SHUFFLE_I]]
88388838
//
8839-
int32x4_t test_vqrshrun_high_n_s64(int32x2_t a, int64x2_t b) {
8839+
uint32x4_t test_vqrshrun_high_n_s64(uint32x2_t a, int64x2_t b) {
88408840
return vqrshrun_high_n_s64(a, b, 19);
88418841
}
88428842

0 commit comments

Comments
 (0)