diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-10-15 15:28:44 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-10-15 15:28:44 +0000 |
commit | b06ac18ee9d5e8341d9268c4e59c9143e349692d (patch) | |
tree | e9b1e57b84e40012d6c09b1d37ca6a1c1ae01356 /llvm/test/CodeGen/X86/fma_patterns.ll | |
parent | cb1f0cf54b695ee4b79f7b1639b5d997139ded16 (diff) | |
download | bcm5719-llvm-b06ac18ee9d5e8341d9268c4e59c9143e349692d.tar.gz bcm5719-llvm-b06ac18ee9d5e8341d9268c4e59c9143e349692d.zip |
[x86] add tests for fma with undef elts; NFC
llvm-svn: 344523
Diffstat (limited to 'llvm/test/CodeGen/X86/fma_patterns.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/fma_patterns.ll | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fma_patterns.ll b/llvm/test/CodeGen/X86/fma_patterns.ll index 2d01c570f99..d0d0dfed352 100644 --- a/llvm/test/CodeGen/X86/fma_patterns.ll +++ b/llvm/test/CodeGen/X86/fma_patterns.ll @@ -636,6 +636,29 @@ define <4 x float> @test_v4f32_mul_y_add_x_one(<4 x float> %x, <4 x float> %y) { ret <4 x float> %m } +define <4 x float> @test_v4f32_mul_y_add_x_one_undefs(<4 x float> %x, <4 x float> %y) { +; FMA-LABEL: test_v4f32_mul_y_add_x_one_undefs: +; FMA: # %bb.0: +; FMA-NEXT: vaddps {{.*}}(%rip), %xmm0, %xmm0 +; FMA-NEXT: vmulps %xmm0, %xmm1, %xmm0 +; FMA-NEXT: retq +; +; FMA4-LABEL: test_v4f32_mul_y_add_x_one_undefs: +; FMA4: # %bb.0: +; FMA4-NEXT: vaddps {{.*}}(%rip), %xmm0, %xmm0 +; FMA4-NEXT: vmulps %xmm0, %xmm1, %xmm0 +; FMA4-NEXT: retq +; +; AVX512-LABEL: test_v4f32_mul_y_add_x_one_undefs: +; AVX512: # %bb.0: +; AVX512-NEXT: vaddps {{.*}}(%rip){1to4}, %xmm0, %xmm0 +; AVX512-NEXT: vmulps %xmm0, %xmm1, %xmm0 +; AVX512-NEXT: retq + %a = fadd <4 x float> %x, <float 1.0, float undef, float 1.0, float undef> + %m = fmul <4 x float> %y, %a + ret <4 x float> %m +} + define <4 x float> @test_v4f32_mul_add_x_negone_y(<4 x float> %x, <4 x float> %y) { ; FMA-INFS-LABEL: test_v4f32_mul_add_x_negone_y: ; FMA-INFS: # %bb.0: @@ -712,6 +735,29 @@ define <4 x float> @test_v4f32_mul_y_add_x_negone(<4 x float> %x, <4 x float> %y ret <4 x float> %m } +define <4 x float> @test_v4f32_mul_y_add_x_negone_undefs(<4 x float> %x, <4 x float> %y) { +; FMA-LABEL: test_v4f32_mul_y_add_x_negone_undefs: +; FMA: # %bb.0: +; FMA-NEXT: vaddps {{.*}}(%rip), %xmm0, %xmm0 +; FMA-NEXT: vmulps %xmm0, %xmm1, %xmm0 +; FMA-NEXT: retq +; +; FMA4-LABEL: test_v4f32_mul_y_add_x_negone_undefs: +; FMA4: # %bb.0: +; FMA4-NEXT: vaddps {{.*}}(%rip), %xmm0, %xmm0 +; FMA4-NEXT: vmulps %xmm0, %xmm1, %xmm0 +; FMA4-NEXT: retq +; +; AVX512-LABEL: test_v4f32_mul_y_add_x_negone_undefs: +; AVX512: # %bb.0: +; AVX512-NEXT: vaddps {{.*}}(%rip){1to4}, %xmm0, %xmm0 +; AVX512-NEXT: vmulps %xmm0, %xmm1, %xmm0 +; AVX512-NEXT: retq + %a = fadd <4 x float> %x, <float undef, float -1.0, float undef, float -1.0> + %m = fmul <4 x float> %y, %a + ret <4 x float> %m +} + define <4 x float> @test_v4f32_mul_sub_one_x_y(<4 x float> %x, <4 x float> %y) { ; FMA-INFS-LABEL: test_v4f32_mul_sub_one_x_y: ; FMA-INFS: # %bb.0: |