define float @f32_one_step_variables(float %x, float %y) #1 {
; SSE-LABEL: f32_one_step_variables:
; SSE: # %bb.0:
-; SSE-NEXT: rcpss %xmm0, %xmm2
-; SSE-NEXT: mulss %xmm2, %xmm0
-; SSE-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
-; SSE-NEXT: subss %xmm0, %xmm1
+; SSE-NEXT: rcpss %xmm1, %xmm2
; SSE-NEXT: mulss %xmm2, %xmm1
-; SSE-NEXT: addss %xmm2, %xmm1
-; SSE-NEXT: movaps %xmm1, %xmm0
+; SSE-NEXT: movss {{.*#+}} xmm3 = mem[0],zero,zero,zero
+; SSE-NEXT: subss %xmm1, %xmm3
+; SSE-NEXT: mulss %xmm2, %xmm3
+; SSE-NEXT: addss %xmm2, %xmm3
+; SSE-NEXT: mulss %xmm3, %xmm0
; SSE-NEXT: retq
;
; AVX-RECIP-LABEL: f32_one_step_variables:
; AVX-RECIP: # %bb.0:
-; AVX-RECIP-NEXT: vrcpss %xmm0, %xmm0, %xmm1
+; AVX-RECIP-NEXT: vrcpss %xmm1, %xmm1, %xmm2
+; AVX-RECIP-NEXT: vmulss %xmm2, %xmm1, %xmm1
+; AVX-RECIP-NEXT: vmovss {{.*#+}} xmm3 = mem[0],zero,zero,zero
+; AVX-RECIP-NEXT: vsubss %xmm1, %xmm3, %xmm1
+; AVX-RECIP-NEXT: vmulss %xmm1, %xmm2, %xmm1
+; AVX-RECIP-NEXT: vaddss %xmm1, %xmm2, %xmm1
; AVX-RECIP-NEXT: vmulss %xmm1, %xmm0, %xmm0
-; AVX-RECIP-NEXT: vmovss {{.*#+}} xmm2 = mem[0],zero,zero,zero
-; AVX-RECIP-NEXT: vsubss %xmm0, %xmm2, %xmm0
-; AVX-RECIP-NEXT: vmulss %xmm0, %xmm1, %xmm0
-; AVX-RECIP-NEXT: vaddss %xmm0, %xmm1, %xmm0
; AVX-RECIP-NEXT: retq
;
; FMA-RECIP-LABEL: f32_one_step_variables:
; FMA-RECIP: # %bb.0:
-; FMA-RECIP-NEXT: vrcpss %xmm0, %xmm0, %xmm1
-; FMA-RECIP-NEXT: vfnmadd213ss {{.*#+}} xmm0 = -(xmm1 * xmm0) + mem
-; FMA-RECIP-NEXT: vfmadd132ss {{.*#+}} xmm0 = (xmm0 * xmm1) + xmm1
+; FMA-RECIP-NEXT: vrcpss %xmm1, %xmm1, %xmm2
+; FMA-RECIP-NEXT: vfnmadd213ss {{.*#+}} xmm1 = -(xmm2 * xmm1) + mem
+; FMA-RECIP-NEXT: vfmadd132ss {{.*#+}} xmm1 = (xmm1 * xmm2) + xmm2
+; FMA-RECIP-NEXT: vmulss %xmm1, %xmm0, %xmm0
; FMA-RECIP-NEXT: retq
;
; BDVER2-LABEL: f32_one_step_variables:
; BDVER2: # %bb.0:
-; BDVER2-NEXT: vrcpss %xmm0, %xmm0, %xmm1
-; BDVER2-NEXT: vfnmaddss {{.*}}(%rip), %xmm1, %xmm0, %xmm0
-; BDVER2-NEXT: vfmaddss %xmm1, %xmm0, %xmm1, %xmm0
+; BDVER2-NEXT: vrcpss %xmm1, %xmm1, %xmm2
+; BDVER2-NEXT: vfnmaddss {{.*}}(%rip), %xmm2, %xmm1, %xmm1
+; BDVER2-NEXT: vfmaddss %xmm2, %xmm1, %xmm2, %xmm1
+; BDVER2-NEXT: vmulss %xmm1, %xmm0, %xmm0
; BDVER2-NEXT: retq
;
; BTVER2-LABEL: f32_one_step_variables:
; BTVER2: # %bb.0:
-; BTVER2-NEXT: vmovss {{.*#+}} xmm2 = mem[0],zero,zero,zero
-; BTVER2-NEXT: vrcpss %xmm0, %xmm0, %xmm1
+; BTVER2-NEXT: vmovss {{.*#+}} xmm3 = mem[0],zero,zero,zero
+; BTVER2-NEXT: vrcpss %xmm1, %xmm1, %xmm2
+; BTVER2-NEXT: vmulss %xmm2, %xmm1, %xmm1
+; BTVER2-NEXT: vsubss %xmm1, %xmm3, %xmm1
+; BTVER2-NEXT: vmulss %xmm1, %xmm2, %xmm1
+; BTVER2-NEXT: vaddss %xmm1, %xmm2, %xmm1
; BTVER2-NEXT: vmulss %xmm1, %xmm0, %xmm0
-; BTVER2-NEXT: vsubss %xmm0, %xmm2, %xmm0
-; BTVER2-NEXT: vmulss %xmm0, %xmm1, %xmm0
-; BTVER2-NEXT: vaddss %xmm0, %xmm1, %xmm0
; BTVER2-NEXT: retq
;
; SANDY-LABEL: f32_one_step_variables:
; SANDY: # %bb.0:
-; SANDY-NEXT: vrcpss %xmm0, %xmm0, %xmm1
+; SANDY-NEXT: vrcpss %xmm1, %xmm1, %xmm2
+; SANDY-NEXT: vmulss %xmm2, %xmm1, %xmm1
+; SANDY-NEXT: vmovss {{.*#+}} xmm3 = mem[0],zero,zero,zero
+; SANDY-NEXT: vsubss %xmm1, %xmm3, %xmm1
+; SANDY-NEXT: vmulss %xmm1, %xmm2, %xmm1
+; SANDY-NEXT: vaddss %xmm1, %xmm2, %xmm1
; SANDY-NEXT: vmulss %xmm1, %xmm0, %xmm0
-; SANDY-NEXT: vmovss {{.*#+}} xmm2 = mem[0],zero,zero,zero
-; SANDY-NEXT: vsubss %xmm0, %xmm2, %xmm0
-; SANDY-NEXT: vmulss %xmm0, %xmm1, %xmm0
-; SANDY-NEXT: vaddss %xmm0, %xmm1, %xmm0
; SANDY-NEXT: retq
;
; HASWELL-LABEL: f32_one_step_variables:
; HASWELL: # %bb.0:
-; HASWELL-NEXT: vrcpss %xmm0, %xmm0, %xmm1
-; HASWELL-NEXT: vfnmadd213ss {{.*#+}} xmm0 = -(xmm1 * xmm0) + mem
-; HASWELL-NEXT: vfmadd132ss {{.*#+}} xmm0 = (xmm0 * xmm1) + xmm1
+; HASWELL-NEXT: vrcpss %xmm1, %xmm1, %xmm2
+; HASWELL-NEXT: vfnmadd213ss {{.*#+}} xmm1 = -(xmm2 * xmm1) + mem
+; HASWELL-NEXT: vfmadd132ss {{.*#+}} xmm1 = (xmm1 * xmm2) + xmm2
+; HASWELL-NEXT: vmulss %xmm1, %xmm0, %xmm0
; HASWELL-NEXT: retq
;
; HASWELL-NO-FMA-LABEL: f32_one_step_variables:
; HASWELL-NO-FMA: # %bb.0:
-; HASWELL-NO-FMA-NEXT: vrcpss %xmm0, %xmm0, %xmm1
+; HASWELL-NO-FMA-NEXT: vrcpss %xmm1, %xmm1, %xmm2
+; HASWELL-NO-FMA-NEXT: vmulss %xmm2, %xmm1, %xmm1
+; HASWELL-NO-FMA-NEXT: vmovss {{.*#+}} xmm3 = mem[0],zero,zero,zero
+; HASWELL-NO-FMA-NEXT: vsubss %xmm1, %xmm3, %xmm1
+; HASWELL-NO-FMA-NEXT: vmulss %xmm1, %xmm2, %xmm1
+; HASWELL-NO-FMA-NEXT: vaddss %xmm1, %xmm2, %xmm1
; HASWELL-NO-FMA-NEXT: vmulss %xmm1, %xmm0, %xmm0
-; HASWELL-NO-FMA-NEXT: vmovss {{.*#+}} xmm2 = mem[0],zero,zero,zero
-; HASWELL-NO-FMA-NEXT: vsubss %xmm0, %xmm2, %xmm0
-; HASWELL-NO-FMA-NEXT: vmulss %xmm0, %xmm1, %xmm0
-; HASWELL-NO-FMA-NEXT: vaddss %xmm0, %xmm1, %xmm0
; HASWELL-NO-FMA-NEXT: retq
;
; AVX512-LABEL: f32_one_step_variables:
; AVX512: # %bb.0:
-; AVX512-NEXT: vrcpss %xmm0, %xmm0, %xmm1
-; AVX512-NEXT: vfnmadd213ss {{.*#+}} xmm0 = -(xmm1 * xmm0) + mem
-; AVX512-NEXT: vfmadd132ss {{.*#+}} xmm0 = (xmm0 * xmm1) + xmm1
+; AVX512-NEXT: vrcpss %xmm1, %xmm1, %xmm2
+; AVX512-NEXT: vfnmadd213ss {{.*#+}} xmm1 = -(xmm2 * xmm1) + mem
+; AVX512-NEXT: vfmadd132ss {{.*#+}} xmm1 = (xmm1 * xmm2) + xmm2
+; AVX512-NEXT: vmulss %xmm1, %xmm0, %xmm0
; AVX512-NEXT: retq
- %div = fdiv fast float 1.0, %x
+ %div = fdiv fast float %x, %y
ret float %div
}