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: .p2align 4, 0x90
9 ; CHECK-NEXT: .LBB0_1: # %for.cond
10 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
11 ; CHECK-NEXT: imull %eax, %eax
12 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
13 ; CHECK-NEXT: movapd %xmm0, %xmm1
14 ; CHECK-NEXT: mulsd %xmm0, %xmm1
15 ; CHECK-NEXT: subsd %xmm0, %xmm1
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: subsd %xmm3, %xmm1
25 ; CHECK-NEXT: addsd %xmm2, %xmm1
26 ; CHECK-NEXT: cvttsd2si %xmm1, %eax
27 ; CHECK-NEXT: jmp .LBB0_1
31 for.cond: ; preds = %for.cond, %entry
32 %b.0 = phi i16 [ 0, %entry ], [ %conv77, %for.cond ]
33 %mul18 = mul i16 %b.0, %b.0
34 %arrayidx.real = load double, ptr undef, align 1
35 %arrayidx.imag = load double, ptr undef, align 1
36 %mul_ac = fmul fast double %arrayidx.real, %arrayidx.real
37 %0 = fadd fast double 0.000000e+00, %arrayidx.real
38 %sub.r = fsub fast double %mul_ac, %0
39 %sub.i = fsub fast double 0.000000e+00, %arrayidx.imag
40 %conv28 = sitofp i16 %mul18 to double
41 %mul_bc32 = fmul fast double %arrayidx.imag, %conv28
42 %mul_bd46 = fmul fast double %mul_bc32, %arrayidx.imag
43 %mul_r49 = fsub fast double 0.000000e+00, %mul_bd46
44 %mul_ac59 = fmul fast double %mul_r49, %sub.r
45 %mul_bc48 = fmul fast double %mul_bc32, %arrayidx.real
46 %mul_i50 = fadd fast double 0.000000e+00, %mul_bc48
47 %1 = fmul fast double %mul_i50, %sub.i
48 %.neg = fneg fast double %0
49 %.neg19 = fmul fast double %1, -1.000000e+00
50 %.neg20 = fadd fast double %.neg, %mul_ac
51 %2 = fadd fast double %.neg20, %mul_ac59
52 %sub.r75 = fadd fast double %2, %.neg19
53 %conv77 = fptosi double %sub.r75 to i16