summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJatin Bhateja <jatin.bhateja@gmail.com>2017-09-22 05:48:20 +0000
committerJatin Bhateja <jatin.bhateja@gmail.com>2017-09-22 05:48:20 +0000
commitc034d36024d6bafee5c19c52a24e062f9395fd6d (patch)
tree9b1d47bc79968b0911af9af3dfdd7e6d5adc0ee5
parent7fc53367df75da407d898042768a3d4db02bf9a7 (diff)
downloadbcm5719-llvm-c034d36024d6bafee5c19c52a24e062f9395fd6d.tar.gz
bcm5719-llvm-c034d36024d6bafee5c19c52a24e062f9395fd6d.zip
[X86] Updating the test case for FMF propagation.
Differential Revision: https://reviews.llvm.org/D38163 llvm-svn: 313964
-rw-r--r--llvm/test/CodeGen/X86/fmf-flags.ll16
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/X86/fmf-flags.ll b/llvm/test/CodeGen/X86/fmf-flags.ll
index 50f34e8b814..652c1d1b166 100644
--- a/llvm/test/CodeGen/X86/fmf-flags.ll
+++ b/llvm/test/CodeGen/X86/fmf-flags.ll
@@ -48,12 +48,15 @@ define float @fast_fmuladd_opts(float %a , float %b , float %c) {
; The multiply is strict.
+@mul1 = common global double 0.000000e+00, align 4
+
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: movsd %xmm1, {{.*}}(%rip)
; X64-NEXT: retq
;
; X86-LABEL: not_so_fast_mul_add:
@@ -61,21 +64,26 @@ define double @not_so_fast_mul_add(double %x) {
; X86-NEXT: fldl {{[0-9]+}}(%esp)
; X86-NEXT: fld %st(0)
; X86-NEXT: fmull {{\.LCPI.*}}
-; X86-NEXT: faddp %st(1)
+; X86-NEXT: fadd %st(0), %st(1)
+; X86-NEXT: fstpl mul1
; X86-NEXT: retl
%m = fmul double %x, 4.2
%a = fadd fast double %m, %x
+ store double %m, double* @mul1, align 4
ret double %a
}
; The sqrt is strict.
+@sqrt1 = common global float 0.000000e+00, align 4
+
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: movss %xmm1, {{.*}}(%rip)
; X64-NEXT: retq
;
; X86-LABEL: not_so_fast_recip_sqrt:
@@ -83,10 +91,14 @@ define float @not_so_fast_recip_sqrt(float %x) {
; X86-NEXT: flds {{[0-9]+}}(%esp)
; X86-NEXT: fsqrt
; X86-NEXT: fld1
-; X86-NEXT: fdivp %st(1)
+; X86-NEXT: fdiv %st(1)
+; X86-NEXT: fxch %st(1)
+; X86-NEXT: fstps sqrt1
; X86-NEXT: retl
%y = call float @llvm.sqrt.f32(float %x)
%z = fdiv fast float 1.0, %y
+ store float %y, float* @sqrt1, align 4
+ %ret = fadd float %z , 14.5
ret float %z
}
OpenPOWER on IntegriCloud