; X64-LABEL: fast_recip_sqrt:
; X64: # %bb.0:
; X64-NEXT: rsqrtss %xmm0, %xmm1
-; X64-NEXT: mulss %xmm1, %xmm0
-; X64-NEXT: mulss %xmm1, %xmm0
-; X64-NEXT: addss {{.*}}(%rip), %xmm0
-; X64-NEXT: mulss {{.*}}(%rip), %xmm1
-; X64-NEXT: mulss %xmm1, %xmm0
+; X64-NEXT: mulss %xmm1, %xmm0
+; X64-NEXT: mulss %xmm1, %xmm0
+; X64-NEXT: addss {{.*}}(%rip), %xmm0
+; X64-NEXT: mulss {{.*}}(%rip), %xmm1
+; X64-NEXT: mulss %xmm1, %xmm0
; X64-NEXT: retq
;
; X86-LABEL: fast_recip_sqrt:
; X86-LABEL: fast_fmuladd_opts:
; X86: # %bb.0:
; X86-NEXT: flds {{[0-9]+}}(%esp)
-; X86-NEXT: fmuls {{.*}}
+; X86-NEXT: fmuls {{\.LCPI.*}}
; X86-NEXT: retl
%res = call fast float @llvm.fmuladd.f32(float %a, float 2.0, float %a)
ret float %res
define double @not_so_fast_mul_add(double %x) {
; X64-LABEL: not_so_fast_mul_add:
; X64: # %bb.0:
-; X64-NEXT: movsd {{.*}}(%rip), %xmm1
+; X64-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
; X64-NEXT: mulsd %xmm0, %xmm1
; X64-NEXT: mulsd {{.*}}(%rip), %xmm0
; X64-NEXT: movsd %xmm1, {{.*}}(%rip)
; X64-LABEL: not_so_fast_recip_sqrt:
; X64: # %bb.0:
; X64-NEXT: rsqrtss %xmm0, %xmm1
-; X64-NEXT: sqrtss %xmm0, %xmm2
-; X64-NEXT: mulss %xmm1, %xmm0
-; X64-NEXT: mulss %xmm1, %xmm0
-; X64-NEXT: addss {{.*}}(%rip), %xmm0
-; X64-NEXT: mulss {{.*}}(%rip), %xmm1
-; X64-NEXT: mulss %xmm1, %xmm0
-; X64-NEXT: movss %xmm2, sqrt1(%rip)
+; X64-NEXT: sqrtss %xmm0, %xmm2
+; X64-NEXT: mulss %xmm1, %xmm0
+; X64-NEXT: mulss %xmm1, %xmm0
+; X64-NEXT: addss {{.*}}(%rip), %xmm0
+; X64-NEXT: mulss {{.*}}(%rip), %xmm1
+; X64-NEXT: mulss %xmm1, %xmm0
+; X64-NEXT: movss %xmm2, {{.*}}(%rip)
; X64-NEXT: retq
;
; X86-LABEL: not_so_fast_recip_sqrt:
}
define float @div_arcp_by_const(half %x) {
-; X64-LABEL: .LCPI4_0:
-; X64-NEXT: .long 1036828672
; X64-LABEL: div_arcp_by_const:
-; X64: movzwl %ax, %edi
-; X64: mulss .LCPI4_0(%rip), %xmm0
+; X64: # %bb.0:
+; X64-NEXT: pushq %rax
+; X64-NEXT: .cfi_def_cfa_offset 16
+; X64-NEXT: callq __gnu_f2h_ieee
+; X64-NEXT: movzwl %ax, %edi
+; X64-NEXT: callq __gnu_h2f_ieee
+; X64-NEXT: mulss {{.*}}(%rip), %xmm0
+; X64-NEXT: popq %rax
+; X64-NEXT: .cfi_def_cfa_offset 8
+; X64-NEXT: retq
;
-; X86-LABEL: .LCPI4_0:
-; X86-NEXT: .long 1036828672
; X86-LABEL: div_arcp_by_const:
-; X86: movzwl %ax, %eax
-; X86: fmuls .LCPI4_0
+; X86: # %bb.0:
+; X86-NEXT: pushl %eax
+; X86-NEXT: .cfi_def_cfa_offset 8
+; X86-NEXT: flds {{[0-9]+}}(%esp)
+; X86-NEXT: fstps (%esp)
+; X86-NEXT: calll __gnu_f2h_ieee
+; X86-NEXT: movzwl %ax, %eax
+; X86-NEXT: movl %eax, (%esp)
+; X86-NEXT: calll __gnu_h2f_ieee
+; X86-NEXT: fmuls {{\.LCPI.*}}
+; X86-NEXT: popl %eax
+; X86-NEXT: .cfi_def_cfa_offset 4
+; X86-NEXT: retl
%rcp = fdiv arcp half %x, 10.0
%z = fpext half %rcp to float
ret float %z