%res = call fast float @llvm.fmuladd.f32(float %a, float 2.0, float %a)
ret float %res
}
+
+; The multiply is strict.
+
+define double @not_so_fast_mul_add(double %x) {
+; X64-LABEL: not_so_fast_mul_add:
+; X64: # BB#0:
+; X64-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
+; X64-NEXT: mulsd %xmm0, %xmm1
+; X64-NEXT: addsd %xmm1, %xmm0
+; X64-NEXT: retq
+;
+; X86-LABEL: not_so_fast_mul_add:
+; X86: # BB#0:
+; X86-NEXT: fldl {{[0-9]+}}(%esp)
+; X86-NEXT: fld %st(0)
+; X86-NEXT: fmull {{\.LCPI.*}}
+; X86-NEXT: faddp %st(1)
+; X86-NEXT: retl
+ %m = fmul double %x, 4.2
+ %a = fadd fast double %m, %x
+ ret double %a
+}
+
+; The sqrt is strict.
+
+define float @not_so_fast_recip_sqrt(float %x) {
+; X64-LABEL: not_so_fast_recip_sqrt:
+; X64: # BB#0:
+; X64-NEXT: sqrtss %xmm0, %xmm1
+; X64-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; X64-NEXT: divss %xmm1, %xmm0
+; X64-NEXT: retq
+;
+; X86-LABEL: not_so_fast_recip_sqrt:
+; X86: # BB#0:
+; X86-NEXT: flds {{[0-9]+}}(%esp)
+; X86-NEXT: fsqrt
+; X86-NEXT: fld1
+; X86-NEXT: fdivp %st(1)
+; X86-NEXT: retl
+ %y = call float @llvm.sqrt.f32(float %x)
+ %z = fdiv fast float 1.0, %y
+ ret float %z
+}
+