1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=arm64-eabi | FileCheck %s
4 define float @t1(i1 %a, float %b, float %c) nounwind {
7 ; CHECK-NEXT: tst w0, #0x1
8 ; CHECK-NEXT: fcsel s0, s0, s1, ne
10 %sel = select i1 %a, float %b, float %c
14 ; This may infinite loop if isNegatibleForFree and getNegatedExpression are conflicted.
16 define double @negation_propagation(ptr %arg, double %arg1, double %arg2) {
17 ; CHECK-LABEL: negation_propagation:
19 ; CHECK-NEXT: fmov d2, #1.00000000
20 ; CHECK-NEXT: fdiv d0, d2, d0
21 ; CHECK-NEXT: fmul d2, d0, d0
22 ; CHECK-NEXT: fmul d1, d0, d1
23 ; CHECK-NEXT: fmul d0, d0, d2
24 ; CHECK-NEXT: fsub d0, d1, d0
26 %t = fdiv double 1.0, %arg1
27 %t7 = fmul double %t, %arg2
28 %t10 = fneg double %t7
29 %t11 = fmul double %t, %t
30 %t13 = fsub double %t11, %t
32 %t15 = fmul double %t, %t14
33 %t16 = fmul double %t, %t15
34 %t18 = fadd double %t16, %t7
38 define { double, double } @testfn(double %x, double %y) #0 {
39 ; CHECK-LABEL: testfn:
41 ; CHECK-NEXT: fsub d0, d0, d1
42 ; CHECK-NEXT: fneg d1, d0
44 %sub = fsub fast double %x, %y
45 %neg = fneg fast double %sub
46 %r0 = insertvalue { double, double } undef, double %sub, 0
47 %r1 = insertvalue { double, double } %r0, double %neg, 1
48 ret { double, double } %r1
51 define <2 x float> @fake_fneg_splat_extract(<4 x float> %rhs) {
52 ; CHECK-LABEL: fake_fneg_splat_extract:
54 ; CHECK-NEXT: fneg v0.4s, v0.4s
55 ; CHECK-NEXT: dup v0.2s, v0.s[3]
57 %rhs_neg = fsub <4 x float> <float -0.0, float -0.0, float -0.0, float -0.0>, %rhs
58 %splat = shufflevector <4 x float> %rhs_neg, <4 x float> undef, <2 x i32> <i32 3, i32 3>
59 ret <2 x float> %splat
62 define <2 x float> @fake_fneg_splat_extract_undef(<4 x float> %rhs) {
63 ; CHECK-LABEL: fake_fneg_splat_extract_undef:
65 ; CHECK-NEXT: fneg v0.4s, v0.4s
66 ; CHECK-NEXT: dup v0.2s, v0.s[3]
68 %rhs_neg = fsub <4 x float> <float undef, float -0.0, float -0.0, float -0.0>, %rhs
69 %splat = shufflevector <4 x float> %rhs_neg, <4 x float> undef, <2 x i32> <i32 3, i32 3>
70 ret <2 x float> %splat
73 attributes #0 = { "no-signed-zeros-fp-math"="true" }