1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: xorl %eax, %eax
8 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
9 ; CHECK-NEXT: movapd %xmm0, %xmm1
10 ; CHECK-NEXT: mulsd %xmm0, %xmm1
11 ; CHECK-NEXT: subsd %xmm0, %xmm1
12 ; CHECK-NEXT: .p2align 4
13 ; CHECK-NEXT: .LBB0_1: # %for.cond
14 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
15 ; CHECK-NEXT: imull %eax, %eax
17 ; CHECK-NEXT: xorps %xmm2, %xmm2
18 ; CHECK-NEXT: cvtsi2sd %eax, %xmm2
19 ; CHECK-NEXT: mulsd %xmm0, %xmm2
20 ; CHECK-NEXT: mulsd %xmm0, %xmm2
21 ; CHECK-NEXT: movapd %xmm2, %xmm3
22 ; CHECK-NEXT: mulsd %xmm1, %xmm3
23 ; CHECK-NEXT: mulsd %xmm0, %xmm2
24 ; CHECK-NEXT: movapd %xmm1, %xmm4
25 ; CHECK-NEXT: subsd %xmm3, %xmm4
26 ; CHECK-NEXT: addsd %xmm2, %xmm4
27 ; CHECK-NEXT: cvttsd2si %xmm4, %eax
28 ; CHECK-NEXT: jmp .LBB0_1
32 for.cond: ; preds = %for.cond, %entry
33 %b.0 = phi i16 [ 0, %entry ], [ %conv77, %for.cond ]
34 %mul18 = mul i16 %b.0, %b.0
35 %arrayidx.real = load double, ptr undef, align 1
36 %arrayidx.imag = load double, ptr undef, align 1
37 %mul_ac = fmul fast double %arrayidx.real, %arrayidx.real
38 %0 = fadd fast double 0.000000e+00, %arrayidx.real
39 %sub.r = fsub fast double %mul_ac, %0
40 %sub.i = fsub fast double 0.000000e+00, %arrayidx.imag
41 %conv28 = sitofp i16 %mul18 to double
42 %mul_bc32 = fmul fast double %arrayidx.imag, %conv28
43 %mul_bd46 = fmul fast double %mul_bc32, %arrayidx.imag
44 %mul_r49 = fsub fast double 0.000000e+00, %mul_bd46
45 %mul_ac59 = fmul fast double %mul_r49, %sub.r
46 %mul_bc48 = fmul fast double %mul_bc32, %arrayidx.real
47 %mul_i50 = fadd fast double 0.000000e+00, %mul_bc48
48 %1 = fmul fast double %mul_i50, %sub.i
49 %.neg = fneg fast double %0
50 %.neg19 = fmul fast double %1, -1.000000e+00
51 %.neg20 = fadd fast double %.neg, %mul_ac
52 %2 = fadd fast double %.neg20, %mul_ac59
53 %sub.r75 = fadd fast double %2, %.neg19
54 %conv77 = fptosi double %sub.r75 to i16