diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-05-03 21:55:37 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-05-03 21:55:37 +0000 |
commit | fb1766ad687facc740871cf8ab5599472420b197 (patch) | |
tree | 4d37a249f57607f21f96cdd94d9c9396c271a5f5 /llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll | |
parent | 7e72f66bf2176c2270e86889a43e31ff6ae77d8b (diff) | |
download | bcm5719-llvm-fb1766ad687facc740871cf8ab5599472420b197.tar.gz bcm5719-llvm-fb1766ad687facc740871cf8ab5599472420b197.zip |
[X86][XOP] Add placeholder VPERMIL2 combining tests
llvm-svn: 268450
Diffstat (limited to 'llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll b/llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll index dda93aca9b8..bf547bd1577 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll @@ -10,6 +10,68 @@ declare <8 x float> @llvm.x86.xop.vpermil2ps.256(<8 x float>, <8 x float>, <8 x declare <16 x i8> @llvm.x86.xop.vpperm(<16 x i8>, <16 x i8>, <16 x i8>) nounwind readnone +define <2 x double> @combine_vpermil2pd_identity(<2 x double> %a0, <2 x double> %a1) { +; CHECK-LABEL: combine_vpermil2pd_identity: +; CHECK: # BB#0: +; CHECK-NEXT: vmovsd {{.*#+}} xmm2 = mem[0],zero +; CHECK-NEXT: vpermil2pd $0, %xmm2, %xmm0, %xmm1, %xmm0 +; CHECK-NEXT: vpermil2pd $0, %xmm2, %xmm0, %xmm0, %xmm0 +; CHECK-NEXT: retq + %mask = bitcast <2 x i64> <i64 2, i64 0> to <2 x double> + %res0 = call <2 x double> @llvm.x86.xop.vpermil2pd(<2 x double> %a1, <2 x double> %a0, <2 x double> %mask, i8 0) + %res1 = call <2 x double> @llvm.x86.xop.vpermil2pd(<2 x double> %res0, <2 x double> undef, <2 x double> %mask, i8 0) + ret <2 x double> %res1 +} + +define <4 x double> @combine_vpermil2pd256_identity(<4 x double> %a0, <4 x double> %a1) { +; CHECK-LABEL: combine_vpermil2pd256_identity: +; CHECK: # BB#0: +; CHECK-NEXT: vmovapd {{.*#+}} ymm2 = [9.881313e-324,0.000000e+00,9.881313e-324,0.000000e+00] +; CHECK-NEXT: vpermil2pd $0, %ymm2, %ymm0, %ymm1, %ymm0 +; CHECK-NEXT: vpermil2pd $0, %ymm2, %ymm0, %ymm0, %ymm0 +; CHECK-NEXT: retq + %mask = bitcast <4 x i64> <i64 2, i64 0, i64 2, i64 0> to <4 x double> + %res0 = call <4 x double> @llvm.x86.xop.vpermil2pd.256(<4 x double> %a1, <4 x double> %a0, <4 x double> %mask, i8 0) + %res1 = call <4 x double> @llvm.x86.xop.vpermil2pd.256(<4 x double> %res0, <4 x double> undef, <4 x double> %mask, i8 0) + ret <4 x double> %res1 +} + +define <4 x float> @combine_vpermil2ps_identity(<4 x float> %a0, <4 x float> %a1) { +; CHECK-LABEL: combine_vpermil2ps_identity: +; CHECK: # BB#0: +; CHECK-NEXT: vmovaps {{.*#+}} xmm2 = [4.203895e-45,2.802597e-45,1.401298e-45,0.000000e+00] +; CHECK-NEXT: vpermil2ps $0, %xmm2, %xmm0, %xmm1, %xmm0 +; CHECK-NEXT: vpermil2ps $0, %xmm2, %xmm0, %xmm0, %xmm0 +; CHECK-NEXT: retq + %mask = bitcast <4 x i32> <i32 3, i32 2, i32 1, i32 0> to <4 x float> + %res0 = call <4 x float> @llvm.x86.xop.vpermil2ps(<4 x float> %a1, <4 x float> %a0, <4 x float> %mask, i8 0) + %res1 = call <4 x float> @llvm.x86.xop.vpermil2ps(<4 x float> %res0, <4 x float> undef, <4 x float> %mask, i8 0) + ret <4 x float> %res1 +} + +define <8 x float> @combine_vpermil2ps256_identity(<8 x float> %a0, <8 x float> %a1) { +; CHECK-LABEL: combine_vpermil2ps256_identity: +; CHECK: # BB#0: +; CHECK-NEXT: vmovaps {{.*#+}} ymm2 = [4.203895e-45,2.802597e-45,1.401298e-45,0.000000e+00,1.401298e-45,0.000000e+00,4.203895e-45,2.802597e-45] +; CHECK-NEXT: vpermil2ps $0, %ymm2, %ymm0, %ymm1, %ymm0 +; CHECK-NEXT: vpermil2ps $0, %ymm2, %ymm0, %ymm0, %ymm0 +; CHECK-NEXT: retq + %mask = bitcast <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 1, i32 0, i32 3, i32 2> to <8 x float> + %res0 = call <8 x float> @llvm.x86.xop.vpermil2ps.256(<8 x float> %a1, <8 x float> %a0, <8 x float> %mask, i8 0) + %res1 = call <8 x float> @llvm.x86.xop.vpermil2ps.256(<8 x float> %res0, <8 x float> undef, <8 x float> %mask, i8 0) + ret <8 x float> %res1 +} + +define <4 x float> @combine_vpermil2ps_blend_with_zero(<4 x float> %a0, <4 x float> %a1) { +; CHECK-LABEL: combine_vpermil2ps_blend_with_zero: +; CHECK: # BB#0: +; CHECK-NEXT: vpermil2ps $2, {{.*}}(%rip), %xmm1, %xmm0, %xmm0 +; CHECK-NEXT: retq + %mask = bitcast <4 x i32> <i32 8, i32 1, i32 2, i32 3> to <4 x float> + %res0 = call <4 x float> @llvm.x86.xop.vpermil2ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %mask, i8 2) + ret <4 x float> %res0 +} + define <16 x i8> @combine_vpperm_identity(<16 x i8> %a0, <16 x i8> %a1) { ; CHECK-LABEL: combine_vpperm_identity: ; CHECK: # BB#0: |