Skip to content

Commit 1013967

Browse files
committed
[PowerPC] Remove const from paired vector store builtins
For some reason, we implemented the xx_stxvp intrinsics to require a const pointer. This absolutely doesn't make sense for a store. Remove the const from the definition.
1 parent e2ee8bf commit 1013967

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

clang/include/clang/Basic/BuiltinsPPC.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ BUILTIN(__builtin_dcbf, "vvC*", "")
843843

844844
// Provided builtins with _mma_ prefix for compatibility.
845845
CUSTOM_BUILTIN(mma_lxvp, vsx_lxvp, "W256SLiW256C*", false)
846-
CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLiW256C*", false)
846+
CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLiW256*", false)
847847
CUSTOM_BUILTIN(mma_assemble_pair, vsx_assemble_pair, "vW256*VV", false)
848848
CUSTOM_BUILTIN(mma_disassemble_pair, vsx_disassemble_pair, "vv*W256*", false)
849849
CUSTOM_BUILTIN(vsx_build_pair, vsx_assemble_pair, "vW256*VV", false)
@@ -855,7 +855,7 @@ CUSTOM_BUILTIN(mma_build_acc, mma_assemble_acc, "vW512*VVVV", false)
855855
// This avoids repeating the ID and INTR in the macro expression.
856856

857857
UNALIASED_CUSTOM_BUILTIN(vsx_lxvp, "W256SLiW256C*", false)
858-
UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLiW256C*", false)
858+
UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLiW256*", false)
859859
UNALIASED_CUSTOM_BUILTIN(vsx_assemble_pair, "vW256*VV", false)
860860
UNALIASED_CUSTOM_BUILTIN(vsx_disassemble_pair, "vv*W256*", false)
861861

clang/test/CodeGen/PowerPC/builtins-ppc-pair-mma.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ void test65(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, uns
10481048
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP1]], i8* [[TMP2]])
10491049
// CHECK-NEXT: ret void
10501050
//
1051-
void test66(const __vector_pair *vpp, const __vector_pair *vp2) {
1051+
void test66(const __vector_pair *vpp, __vector_pair *vp2) {
10521052
__vector_pair vp = __builtin_vsx_lxvp(0L, vpp);
10531053
__builtin_vsx_stxvp(vp, 0L, vp2);
10541054
}
@@ -1063,7 +1063,7 @@ void test66(const __vector_pair *vpp, const __vector_pair *vp2) {
10631063
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
10641064
// CHECK-NEXT: ret void
10651065
//
1066-
void test67(const __vector_pair *vpp, signed long offset, const __vector_pair *vp2) {
1066+
void test67(const __vector_pair *vpp, signed long offset, __vector_pair *vp2) {
10671067
__vector_pair vp = __builtin_vsx_lxvp(offset, vpp);
10681068
__builtin_vsx_stxvp(vp, offset, vp2);
10691069
}
@@ -1078,7 +1078,7 @@ void test67(const __vector_pair *vpp, signed long offset, const __vector_pair *v
10781078
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
10791079
// CHECK-NEXT: ret void
10801080
//
1081-
void test68(const __vector_pair *vpp, const __vector_pair *vp2) {
1081+
void test68(const __vector_pair *vpp, __vector_pair *vp2) {
10821082
__vector_pair vp = __builtin_vsx_lxvp(18L, vpp);
10831083
__builtin_vsx_stxvp(vp, 18L, vp2);
10841084
}
@@ -1093,7 +1093,7 @@ void test68(const __vector_pair *vpp, const __vector_pair *vp2) {
10931093
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
10941094
// CHECK-NEXT: ret void
10951095
//
1096-
void test69(const __vector_pair *vpp, const __vector_pair *vp2) {
1096+
void test69(const __vector_pair *vpp, __vector_pair *vp2) {
10971097
__vector_pair vp = __builtin_vsx_lxvp(1L, vpp);
10981098
__builtin_vsx_stxvp(vp, 1L, vp2);
10991099
}
@@ -1108,7 +1108,7 @@ void test69(const __vector_pair *vpp, const __vector_pair *vp2) {
11081108
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
11091109
// CHECK-NEXT: ret void
11101110
//
1111-
void test70(const __vector_pair *vpp, const __vector_pair *vp2) {
1111+
void test70(const __vector_pair *vpp, __vector_pair *vp2) {
11121112
__vector_pair vp = __builtin_vsx_lxvp(42L, vpp);
11131113
__builtin_vsx_stxvp(vp, 42L, vp2);
11141114
}
@@ -1123,7 +1123,7 @@ void test70(const __vector_pair *vpp, const __vector_pair *vp2) {
11231123
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
11241124
// CHECK-NEXT: ret void
11251125
//
1126-
void test71(const __vector_pair *vpp, const __vector_pair *vp2) {
1126+
void test71(const __vector_pair *vpp, __vector_pair *vp2) {
11271127
__vector_pair vp = __builtin_vsx_lxvp(32768L, vpp);
11281128
__builtin_vsx_stxvp(vp, 32768L, vp2);
11291129
}
@@ -1138,7 +1138,7 @@ void test71(const __vector_pair *vpp, const __vector_pair *vp2) {
11381138
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
11391139
// CHECK-NEXT: ret void
11401140
//
1141-
void test72(const __vector_pair *vpp, const __vector_pair *vp2) {
1141+
void test72(const __vector_pair *vpp, __vector_pair *vp2) {
11421142
__vector_pair vp = __builtin_vsx_lxvp(32799L, vpp);
11431143
__builtin_vsx_stxvp(vp, 32799L, vp2);
11441144
}
@@ -1240,7 +1240,7 @@ void test77(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, uns
12401240
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP1]], i8* [[TMP2]])
12411241
// CHECK-NEXT: ret void
12421242
//
1243-
void test78(const __vector_pair *vpp, const __vector_pair *vp2) {
1243+
void test78(const __vector_pair *vpp, __vector_pair *vp2) {
12441244
__vector_pair vp = __builtin_mma_lxvp(0L, vpp);
12451245
__builtin_mma_stxvp(vp, 0L, vp2);
12461246
}
@@ -1255,7 +1255,7 @@ void test78(const __vector_pair *vpp, const __vector_pair *vp2) {
12551255
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
12561256
// CHECK-NEXT: ret void
12571257
//
1258-
void test79(const __vector_pair *vpp, signed long offset, const __vector_pair *vp2) {
1258+
void test79(const __vector_pair *vpp, signed long offset, __vector_pair *vp2) {
12591259
__vector_pair vp = __builtin_mma_lxvp(offset, vpp);
12601260
__builtin_mma_stxvp(vp, offset, vp2);
12611261
}
@@ -1270,7 +1270,7 @@ void test79(const __vector_pair *vpp, signed long offset, const __vector_pair *v
12701270
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
12711271
// CHECK-NEXT: ret void
12721272
//
1273-
void test80(const __vector_pair *vpp, const __vector_pair *vp2) {
1273+
void test80(const __vector_pair *vpp, __vector_pair *vp2) {
12741274
__vector_pair vp = __builtin_mma_lxvp(18L, vpp);
12751275
__builtin_mma_stxvp(vp, 18L, vp2);
12761276
}
@@ -1285,7 +1285,7 @@ void test80(const __vector_pair *vpp, const __vector_pair *vp2) {
12851285
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
12861286
// CHECK-NEXT: ret void
12871287
//
1288-
void test81(const __vector_pair *vpp, const __vector_pair *vp2) {
1288+
void test81(const __vector_pair *vpp, __vector_pair *vp2) {
12891289
__vector_pair vp = __builtin_mma_lxvp(1L, vpp);
12901290
__builtin_mma_stxvp(vp, 1L, vp2);
12911291
}
@@ -1300,7 +1300,7 @@ void test81(const __vector_pair *vpp, const __vector_pair *vp2) {
13001300
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
13011301
// CHECK-NEXT: ret void
13021302
//
1303-
void test82(const __vector_pair *vpp, const __vector_pair *vp2) {
1303+
void test82(const __vector_pair *vpp, __vector_pair *vp2) {
13041304
__vector_pair vp = __builtin_mma_lxvp(42L, vpp);
13051305
__builtin_mma_stxvp(vp, 42L, vp2);
13061306
}
@@ -1315,7 +1315,7 @@ void test82(const __vector_pair *vpp, const __vector_pair *vp2) {
13151315
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
13161316
// CHECK-NEXT: ret void
13171317
//
1318-
void test83(const __vector_pair *vpp, const __vector_pair *vp2) {
1318+
void test83(const __vector_pair *vpp, __vector_pair *vp2) {
13191319
__vector_pair vp = __builtin_mma_lxvp(32768L, vpp);
13201320
__builtin_mma_stxvp(vp, 32768L, vp2);
13211321
}
@@ -1330,7 +1330,7 @@ void test83(const __vector_pair *vpp, const __vector_pair *vp2) {
13301330
// CHECK-NEXT: tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
13311331
// CHECK-NEXT: ret void
13321332
//
1333-
void test84(const __vector_pair *vpp, const __vector_pair *vp2) {
1333+
void test84(const __vector_pair *vpp, __vector_pair *vp2) {
13341334
__vector_pair vp = __builtin_mma_lxvp(32799L, vpp);
13351335
__builtin_mma_stxvp(vp, 32799L, vp2);
13361336
}

clang/test/Sema/ppc-mma-builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void test2(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, unsi
1111
__builtin_vsx_disassemble_pair(resp, (__vector_pair*)vpp);
1212
}
1313

14-
void test3(const __vector_pair *vpp, signed long offset, const __vector_pair *vp2) {
14+
void test3(const __vector_pair *vpp, signed long offset, __vector_pair *vp2) {
1515
__vector_pair vp = __builtin_vsx_lxvp(offset, vpp);
1616
__builtin_vsx_stxvp(vp, offset, vp2);
1717
}

clang/test/Sema/ppc-pair-mma-types.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void testBuiltinTypes2(__vector_pair *vpp, const __vector_pair *vp2, unsigned ch
209209

210210
void testBuiltinTypes3(vector int v, __vector_pair *vp2, signed long l, unsigned short s) {
211211
__vector_pair vp = __builtin_vsx_lxvp(l, v); // expected-error {{passing '__vector int' (vector of 4 'int' values) to parameter of incompatible type 'const __vector_pair *'}}
212-
__builtin_vsx_stxvp(vp, l, s); // expected-error {{passing 'unsigned short' to parameter of incompatible type 'const __vector_pair *'}}
212+
__builtin_vsx_stxvp(vp, l, s); // expected-error {{passing 'unsigned short' to parameter of incompatible type '__vector_pair *'}}
213213
}
214214

215215
void testRestrictQualifiedPointer1(int *__restrict acc) {

0 commit comments

Comments
 (0)