diff options
Diffstat (limited to 'clang/test/CodeGen/builtins-ppc-vsx.c')
-rw-r--r-- | clang/test/CodeGen/builtins-ppc-vsx.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtins-ppc-vsx.c b/clang/test/CodeGen/builtins-ppc-vsx.c index 848d24d4fb1..c19140b9464 100644 --- a/clang/test/CodeGen/builtins-ppc-vsx.c +++ b/clang/test/CodeGen/builtins-ppc-vsx.c @@ -49,6 +49,7 @@ vector unsigned int res_vui; vector bool long long res_vbll; vector signed long long res_vsll; vector unsigned long long res_vull; +vector signed __int128 res_vslll; double res_d; float res_af[4]; @@ -1803,3 +1804,31 @@ vector double xxsldwi_should_not_assert(vector double a, vector double b) { // CHECK-NEXT-LE: shufflevector <4 x i32> %{{[0-9]+}}, <4 x i32> %{{[0-9]+}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3> // CHECK-NEXT-LE: bitcast <4 x i32> %{{[0-9]+}} to <2 x double> } + +void testVectorInt128Pack(){ +// CHECK-LABEL: testVectorInt128Pack +// CHECK-LABEL-LE: testVectorInt128Pack + res_vslll = __builtin_pack_vector_int128(aull[0], aull[1]); +// CHECK: %[[V1:[0-9]+]] = insertelement <2 x i64> undef, i64 %{{[0-9]+}}, i64 0 +// CHECK-NEXT: %[[V2:[0-9]+]] = insertelement <2 x i64> %[[V1]], i64 %{{[0-9]+}}, i64 1 +// CHECK-NEXT: bitcast <2 x i64> %[[V2]] to <1 x i128> + +// CHECK-LE: %[[V1:[0-9]+]] = insertelement <2 x i64> undef, i64 %{{[0-9]+}}, i64 1 +// CHECK-NEXT-LE: %[[V2:[0-9]+]] = insertelement <2 x i64> %[[V1]], i64 %{{[0-9]+}}, i64 0 +// CHECK-NEXT-LE: bitcast <2 x i64> %[[V2]] to <1 x i128> + + __builtin_unpack_vector_int128(res_vslll, 0); +// CHECK: %[[V1:[0-9]+]] = bitcast <1 x i128> %{{[0-9]+}} to <2 x i64> +// CHECK-NEXT: %{{[0-9]+}} = extractelement <2 x i64> %[[V1]], i32 0 + +// CHECK-LE: %[[V1:[0-9]+]] = bitcast <1 x i128> %{{[0-9]+}} to <2 x i64> +// CHECK-NEXT-LE: %{{[0-9]+}} = extractelement <2 x i64> %[[V1]], i32 1 + + __builtin_unpack_vector_int128(res_vslll, 1); +// CHECK: %[[V1:[0-9]+]] = bitcast <1 x i128> %{{[0-9]+}} to <2 x i64> +// CHECK-NEXT: %{{[0-9]+}} = extractelement <2 x i64> %[[V1]], i32 1 + +// CHECK-LE: %[[V1:[0-9]+]] = bitcast <1 x i128> %{{[0-9]+}} to <2 x i64> +// CHECK-NEXT-LE: %{{[0-9]+}} = extractelement <2 x i64> %[[V1]], i32 0 + +} |