1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse2 -recip=!divf,!vec-divf | FileCheck %s --check-prefix=NORECIP
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx -recip=divf,vec-divf | FileCheck %s --check-prefix=RECIP
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx -recip=divf:2,vec-divf:2 | FileCheck %s --check-prefix=REFINE
5 ; If the target's divss/divps instructions are substantially
6 ; slower than rcpss/rcpps with a Newton-Raphson refinement,
7 ; we should generate the estimate sequence.
9 ; See PR21385 ( http://llvm.org/bugs/show_bug.cgi?id=21385 )
10 ; for details about the accuracy, speed, and implementation
11 ; differences of x86 reciprocal estimates.
13 define float @reciprocal_estimate(float %x) #0 {
14 %div = fdiv fast float 1.0, %x
17 ; NORECIP-LABEL: reciprocal_estimate:
20 ; NORECIP-NEXT: movaps
23 ; RECIP-LABEL: reciprocal_estimate:
31 ; REFINE-LABEL: reciprocal_estimate:
44 define <4 x float> @reciprocal_estimate_v4f32(<4 x float> %x) #0 {
45 %div = fdiv fast <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, %x
48 ; NORECIP-LABEL: reciprocal_estimate_v4f32:
51 ; NORECIP-NEXT: movaps
54 ; RECIP-LABEL: reciprocal_estimate_v4f32:
62 ; REFINE-LABEL: reciprocal_estimate_v4f32:
75 define <8 x float> @reciprocal_estimate_v8f32(<8 x float> %x) #0 {
76 %div = fdiv fast <8 x float> <float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0>, %x
79 ; NORECIP-LABEL: reciprocal_estimate_v8f32:
84 ; NORECIP-NEXT: movaps
85 ; NORECIP-NEXT: movaps
88 ; RECIP-LABEL: reciprocal_estimate_v8f32:
96 ; REFINE-LABEL: reciprocal_estimate_v8f32:
109 attributes #0 = { "unsafe-fp-math"="true" }