33; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=X64
44
55; FIXME: Missing fsub(x,fneg(y)) -> fadd(x,y) fold
6- define float @fneg_strict_fsub_to_strict_fadd (float %x , float %y ) nounwind {
6+ define float @fneg_strict_fsub_to_strict_fadd (float %x , float %y ) nounwind strictfp {
77; X86-LABEL: fneg_strict_fsub_to_strict_fadd:
88; X86: # %bb.0:
99; X86-NEXT: pushl %eax
@@ -13,6 +13,7 @@ define float @fneg_strict_fsub_to_strict_fadd(float %x, float %y) nounwind {
1313; X86-NEXT: subss %xmm1, %xmm0
1414; X86-NEXT: movss %xmm0, (%esp)
1515; X86-NEXT: flds (%esp)
16+ ; X86-NEXT: wait
1617; X86-NEXT: popl %eax
1718; X86-NEXT: retl
1819;
@@ -27,7 +28,7 @@ define float @fneg_strict_fsub_to_strict_fadd(float %x, float %y) nounwind {
2728}
2829
2930; FIXME: Missing fsub(x,fneg(y)) -> fadd(x,y) fold
30- define double @fneg_strict_fsub_to_strict_fadd_d (double %x , double %y ) nounwind {
31+ define double @fneg_strict_fsub_to_strict_fadd_d (double %x , double %y ) nounwind strictfp {
3132; X86-LABEL: fneg_strict_fsub_to_strict_fadd_d:
3233; X86: # %bb.0:
3334; X86-NEXT: pushl %ebp
@@ -40,6 +41,7 @@ define double @fneg_strict_fsub_to_strict_fadd_d(double %x, double %y) nounwind
4041; X86-NEXT: subsd %xmm1, %xmm0
4142; X86-NEXT: movsd %xmm0, (%esp)
4243; X86-NEXT: fldl (%esp)
44+ ; X86-NEXT: wait
4345; X86-NEXT: movl %ebp, %esp
4446; X86-NEXT: popl %ebp
4547; X86-NEXT: retl
@@ -55,7 +57,7 @@ define double @fneg_strict_fsub_to_strict_fadd_d(double %x, double %y) nounwind
5557}
5658
5759; FIXME: Missing fneg(fsub(x,y)) -> fsub(y,x) fold
58- define float @strict_fsub_fneg_to_strict_fsub (float %x , float %y ) nounwind {
60+ define float @strict_fsub_fneg_to_strict_fsub (float %x , float %y ) nounwind strictfp {
5961; X86-LABEL: strict_fsub_fneg_to_strict_fsub:
6062; X86: # %bb.0:
6163; X86-NEXT: pushl %eax
@@ -64,6 +66,7 @@ define float @strict_fsub_fneg_to_strict_fsub(float %x, float %y) nounwind {
6466; X86-NEXT: xorps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
6567; X86-NEXT: movss %xmm0, (%esp)
6668; X86-NEXT: flds (%esp)
69+ ; X86-NEXT: wait
6770; X86-NEXT: popl %eax
6871; X86-NEXT: retl
6972;
@@ -78,7 +81,7 @@ define float @strict_fsub_fneg_to_strict_fsub(float %x, float %y) nounwind {
7881}
7982
8083; FIXME: Missing fneg(fsub(x,y)) -> fsub(y,x) fold
81- define double @strict_fsub_fneg_to_strict_fsub_d (double %x , double %y ) nounwind {
84+ define double @strict_fsub_fneg_to_strict_fsub_d (double %x , double %y ) nounwind strictfp {
8285; X86-LABEL: strict_fsub_fneg_to_strict_fsub_d:
8386; X86: # %bb.0:
8487; X86-NEXT: pushl %ebp
@@ -90,6 +93,7 @@ define double @strict_fsub_fneg_to_strict_fsub_d(double %x, double %y) nounwind
9093; X86-NEXT: xorpd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
9194; X86-NEXT: movlpd %xmm0, (%esp)
9295; X86-NEXT: fldl (%esp)
96+ ; X86-NEXT: wait
9397; X86-NEXT: movl %ebp, %esp
9498; X86-NEXT: popl %ebp
9599; X86-NEXT: retl
0 commit comments