This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6b6ea93125bd: [PowerPC][altivec] Correct modulo number of vec_promote on vector char (authored by lkail).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158484/new/ https://reviews.llvm.org/D158484 Files: clang/lib/Headers/altivec.h clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c Index: clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c =================================================================== --- clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c +++ clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c @@ -2250,18 +2250,18 @@ res_vsc = vec_promote(asc[0], 8); // CHECK: store <16 x i8> zeroinitializer -// CHECK: [[IDX:%.*]] = and i32 {{.*}}, 7 +// CHECK: [[IDX:%.*]] = and i32 {{.*}}, 15 // CHECK: insertelement <16 x i8> {{.*}}, i8 {{.*}}, i32 [[IDX]] // CHECK-LE: store <16 x i8> zeroinitializer -// CHECK-LE: [[IDX:%.*]] = and i32 {{.*}}, 7 +// CHECK-LE: [[IDX:%.*]] = and i32 {{.*}}, 15 // CHECK-LE: insertelement <16 x i8> {{.*}}, i8 {{.*}}, i32 [[IDX]] res_vuc = vec_promote(auc[0], 8); // CHECK: store <16 x i8> zeroinitializer -// CHECK: [[IDX:%.*]] = and i32 {{.*}}, 7 +// CHECK: [[IDX:%.*]] = and i32 {{.*}}, 15 // CHECK: insertelement <16 x i8> {{.*}}, i8 {{.*}}, i32 [[IDX]] // CHECK-LE: store <16 x i8> zeroinitializer -// CHECK-LE: [[IDX:%.*]] = and i32 {{.*}}, 7 +// CHECK-LE: [[IDX:%.*]] = and i32 {{.*}}, 15 // CHECK-LE: insertelement <16 x i8> {{.*}}, i8 {{.*}}, i32 [[IDX]] } Index: clang/lib/Headers/altivec.h =================================================================== --- clang/lib/Headers/altivec.h +++ clang/lib/Headers/altivec.h @@ -14648,14 +14648,14 @@ static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a, int __b) { vector signed char __res = (vector signed char)(0); - __res[__b & 0x7] = __a; + __res[__b & 0xf] = __a; return __res; } static __inline__ vector unsigned char __ATTRS_o_ai vec_promote(unsigned char __a, int __b) { vector unsigned char __res = (vector unsigned char)(0); - __res[__b & 0x7] = __a; + __res[__b & 0xf] = __a; return __res; }
Index: clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c =================================================================== --- clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c +++ clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c @@ -2250,18 +2250,18 @@ res_vsc = vec_promote(asc[0], 8); // CHECK: store <16 x i8> zeroinitializer -// CHECK: [[IDX:%.*]] = and i32 {{.*}}, 7 +// CHECK: [[IDX:%.*]] = and i32 {{.*}}, 15 // CHECK: insertelement <16 x i8> {{.*}}, i8 {{.*}}, i32 [[IDX]] // CHECK-LE: store <16 x i8> zeroinitializer -// CHECK-LE: [[IDX:%.*]] = and i32 {{.*}}, 7 +// CHECK-LE: [[IDX:%.*]] = and i32 {{.*}}, 15 // CHECK-LE: insertelement <16 x i8> {{.*}}, i8 {{.*}}, i32 [[IDX]] res_vuc = vec_promote(auc[0], 8); // CHECK: store <16 x i8> zeroinitializer -// CHECK: [[IDX:%.*]] = and i32 {{.*}}, 7 +// CHECK: [[IDX:%.*]] = and i32 {{.*}}, 15 // CHECK: insertelement <16 x i8> {{.*}}, i8 {{.*}}, i32 [[IDX]] // CHECK-LE: store <16 x i8> zeroinitializer -// CHECK-LE: [[IDX:%.*]] = and i32 {{.*}}, 7 +// CHECK-LE: [[IDX:%.*]] = and i32 {{.*}}, 15 // CHECK-LE: insertelement <16 x i8> {{.*}}, i8 {{.*}}, i32 [[IDX]] } Index: clang/lib/Headers/altivec.h =================================================================== --- clang/lib/Headers/altivec.h +++ clang/lib/Headers/altivec.h @@ -14648,14 +14648,14 @@ static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a, int __b) { vector signed char __res = (vector signed char)(0); - __res[__b & 0x7] = __a; + __res[__b & 0xf] = __a; return __res; } static __inline__ vector unsigned char __ATTRS_o_ai vec_promote(unsigned char __a, int __b) { vector unsigned char __res = (vector unsigned char)(0); - __res[__b & 0x7] = __a; + __res[__b & 0xf] = __a; return __res; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits