[llvm] r341650 - [X86][SSE] Add fadd/fsub(x, bitcast_fneg(y)) tests
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 7 04:24:44 PDT 2018
Author: rksimon
Date: Fri Sep 7 04:24:43 2018
New Revision: 341650
URL: http://llvm.org/viewvc/llvm-project?rev=341650&view=rev
Log:
[X86][SSE] Add fadd/fsub(x, bitcast_fneg(y)) tests
Show missing vector support
Modified:
llvm/trunk/test/CodeGen/X86/fp-logic.ll
Modified: llvm/trunk/test/CodeGen/X86/fp-logic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fp-logic.ll?rev=341650&r1=341649&r2=341650&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fp-logic.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fp-logic.ll Fri Sep 7 04:24:43 2018
@@ -284,3 +284,52 @@ define <4 x float> @bitcast_fneg_vec(<4
ret <4 x float> %bc2
}
+define float @fadd_bitcast_fneg(float %x, float %y) {
+; CHECK-LABEL: fadd_bitcast_fneg:
+; CHECK: # %bb.0:
+; CHECK-NEXT: subss %xmm1, %xmm0
+; CHECK-NEXT: retq
+ %bc1 = bitcast float %y to i32
+ %xor = xor i32 %bc1, 2147483648
+ %bc2 = bitcast i32 %xor to float
+ %fadd = fadd float %x, %bc2
+ ret float %fadd
+}
+
+define float @fsub_bitcast_fneg(float %x, float %y) {
+; CHECK-LABEL: fsub_bitcast_fneg:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addss %xmm1, %xmm0
+; CHECK-NEXT: retq
+ %bc1 = bitcast float %y to i32
+ %xor = xor i32 %bc1, 2147483648
+ %bc2 = bitcast i32 %xor to float
+ %fsub = fsub float %x, %bc2
+ ret float %fsub
+}
+
+define <4 x float> @fadd_bitcast_fneg_vec(<4 x float> %x, <4 x float> %y) {
+; CHECK-LABEL: fadd_bitcast_fneg_vec:
+; CHECK: # %bb.0:
+; CHECK-NEXT: xorps {{.*}}(%rip), %xmm1
+; CHECK-NEXT: addps %xmm1, %xmm0
+; CHECK-NEXT: retq
+ %bc1 = bitcast <4 x float> %y to <4 x i32>
+ %xor = xor <4 x i32> %bc1, <i32 2147483648, i32 2147483648, i32 2147483648, i32 2147483648>
+ %bc2 = bitcast <4 x i32> %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(<4 x float> %x, <4 x float> %y) {
+; CHECK-LABEL: fsub_bitcast_fneg_vec:
+; CHECK: # %bb.0:
+; CHECK-NEXT: xorps {{.*}}(%rip), %xmm1
+; CHECK-NEXT: subps %xmm1, %xmm0
+; CHECK-NEXT: retq
+ %bc1 = bitcast <4 x float> %y to <4 x i32>
+ %xor = xor <4 x i32> %bc1, <i32 2147483648, i32 2147483648, i32 2147483648, i32 2147483648>
+ %bc2 = bitcast <4 x i32> %xor to <4 x float>
+ %fsub = fsub <4 x float> %x, %bc2
+ ret <4 x float> %fsub
+}
More information about the llvm-commits
mailing list