From 04d07484178379744e4d2ea94b497649643b2775 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 7 Sep 2018 13:27:07 +0000 Subject: [PATCH] [X86][SSE] Add additional fadd/fsub(x, bitcast_fneg(y)) tests with different integer bitwidths llvm-svn: 341657 --- llvm/test/CodeGen/X86/fp-logic.ll | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/llvm/test/CodeGen/X86/fp-logic.ll b/llvm/test/CodeGen/X86/fp-logic.ll index e9781fa..6636271 100644 --- a/llvm/test/CodeGen/X86/fp-logic.ll +++ b/llvm/test/CodeGen/X86/fp-logic.ll @@ -331,3 +331,29 @@ define <4 x float> @fsub_bitcast_fneg_vec(<4 x float> %x, <4 x float> %y) { %fsub = fsub <4 x float> %x, %bc2 ret <4 x float> %fsub } + +define <4 x float> @fadd_bitcast_fneg_vec_width(<4 x float> %x, <4 x float> %y) { +; CHECK-LABEL: fadd_bitcast_fneg_vec_width: +; CHECK: # %bb.0: +; CHECK-NEXT: xorps {{.*}}(%rip), %xmm1 +; CHECK-NEXT: addps %xmm1, %xmm0 +; CHECK-NEXT: retq + %bc1 = bitcast <4 x float> %y to <2 x i64> + %xor = xor <2 x i64> %bc1, + %bc2 = bitcast <2 x i64> %xor to <4 x float> + %fadd = fadd <4 x float> %x, %bc2 + ret <4 x float> %fadd +} + +define <4 x float> @fsub_bitcast_fneg_vec_width(<4 x float> %x, <4 x float> %y) { +; CHECK-LABEL: fsub_bitcast_fneg_vec_width: +; CHECK: # %bb.0: +; CHECK-NEXT: xorps {{.*}}(%rip), %xmm1 +; CHECK-NEXT: subps %xmm1, %xmm0 +; CHECK-NEXT: retq + %bc1 = bitcast <4 x float> %y to <2 x i64> + %xor = xor <2 x i64> %bc1, + %bc2 = bitcast <2 x i64> %xor to <4 x float> + %fsub = fsub <4 x float> %x, %bc2 + ret <4 x float> %fsub +} -- 2.7.4