diff options
Diffstat (limited to 'llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll')
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll index ba177ead718..d564992e2d8 100644 --- a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll +++ b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll @@ -11,6 +11,26 @@ define float @fsub_-0_-0_x(float %a) { ret float %ret } +define <2 x float> @fsub_-0_-0_x_vec(<2 x float> %a) { +; CHECK-LABEL: @fsub_-0_-0_x_vec( +; CHECK-NEXT: ret <2 x float> [[A:%.*]] +; + %t1 = fsub <2 x float> <float -0.0, float -0.0>, %a + %ret = fsub <2 x float> <float -0.0, float -0.0>, %t1 + ret <2 x float> %ret +} + +define <2 x float> @fsub_-0_-0_x_vec_undef_elts(<2 x float> %a) { +; CHECK-LABEL: @fsub_-0_-0_x_vec_undef_elts( +; CHECK-NEXT: [[T1:%.*]] = fsub <2 x float> <float undef, float -0.000000e+00>, [[A:%.*]] +; CHECK-NEXT: [[RET:%.*]] = fsub <2 x float> <float -0.000000e+00, float undef>, [[T1]] +; CHECK-NEXT: ret <2 x float> [[RET]] +; + %t1 = fsub <2 x float> <float undef, float -0.0>, %a + %ret = fsub <2 x float> <float -0.0, float undef>, %t1 + ret <2 x float> %ret +} + ; fsub 0.0, (fsub -0.0, X) != X define float @fsub_0_-0_x(float %a) { ; CHECK-LABEL: @fsub_0_-0_x( @@ -53,6 +73,15 @@ define float @fadd_x_n0(float %a) { ret float %ret } +define <2 x float> @fadd_x_n0_vec_undef_elt(<2 x float> %a) { +; CHECK-LABEL: @fadd_x_n0_vec_undef_elt( +; CHECK-NEXT: [[RET:%.*]] = fadd <2 x float> [[A:%.*]], <float -0.000000e+00, float undef> +; CHECK-NEXT: ret <2 x float> [[RET]] +; + %ret = fadd <2 x float> %a, <float -0.0, float undef> + ret <2 x float> %ret +} + ; fmul X, 1.0 ==> X define double @fmul_X_1(double %a) { ; CHECK-LABEL: @fmul_X_1( |

