Add a triple to switch.ll test.
[oota-llvm.git] / test / CodeGen / X86 / fdiv-combine.ll
1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
2
3 ; Anything more than one division using a single divisor operand
4 ; should be converted into a reciprocal and multiplication.
5
6 define float @div1_arcp(float %x, float %y, float %z) #0 {
7 ; CHECK-LABEL: div1_arcp:
8 ; CHECK:       # BB#0:
9 ; CHECK-NEXT:    divss %xmm1, %xmm0
10 ; CHECK-NEXT:    retq
11   %div1 = fdiv arcp float %x, %y
12   ret float %div1
13 }
14
15 define float @div2_arcp(float %x, float %y, float %z) #0 {
16 ; CHECK-LABEL: div2_arcp:
17 ; CHECK:       # BB#0:
18 ; CHECK-NEXT:    movss {{.*#+}} xmm3 = mem[0],zero,zero,zero
19 ; CHECK-NEXT:    divss %xmm2, %xmm3
20 ; CHECK-NEXT:    mulss %xmm3, %xmm0
21 ; CHECK-NEXT:    mulss %xmm1, %xmm0
22 ; CHECK-NEXT:    mulss %xmm3, %xmm0
23 ; CHECK-NEXT:    retq
24   %div1 = fdiv arcp float %x, %z
25   %mul = fmul arcp float %div1, %y
26   %div2 = fdiv arcp float %mul, %z
27   ret float %div2
28 }
29
30 ; FIXME: If the backend understands 'arcp', then this attribute is unnecessary.
31 attributes #0 = { "unsafe-fp-math"="true" }