[llvm-commits] [llvm] r48006 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2008-03-06-frem-fpstack.ll
Chris Lattner
sabre at nondot.org
Thu Mar 6 22:36:32 PST 2008
Author: lattner
Date: Fri Mar 7 00:36:32 2008
New Revision: 48006
URL: http://llvm.org/viewvc/llvm-project?rev=48006&view=rev
Log:
mark frem as expand for all legal fp types on x86, regardless of whether
we're using SSE or not. This fixes PR2122.
Added:
llvm/trunk/test/CodeGen/X86/2008-03-06-frem-fpstack.ll
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=48006&r1=48005&r2=48006&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Mar 7 00:36:32 2008
@@ -215,7 +215,9 @@
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i8 , Legal);
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1 , Expand);
setOperationAction(ISD::FP_ROUND_INREG , MVT::f32 , Expand);
+ setOperationAction(ISD::FREM , MVT::f32 , Expand);
setOperationAction(ISD::FREM , MVT::f64 , Expand);
+ setOperationAction(ISD::FREM , MVT::f80 , Expand);
setOperationAction(ISD::FLT_ROUNDS_ , MVT::i32 , Custom);
setOperationAction(ISD::CTPOP , MVT::i8 , Expand);
@@ -358,10 +360,8 @@
// We don't support sin/cos/fmod
setOperationAction(ISD::FSIN , MVT::f64, Expand);
setOperationAction(ISD::FCOS , MVT::f64, Expand);
- setOperationAction(ISD::FREM , MVT::f64, Expand);
setOperationAction(ISD::FSIN , MVT::f32, Expand);
setOperationAction(ISD::FCOS , MVT::f32, Expand);
- setOperationAction(ISD::FREM , MVT::f32, Expand);
// Expand FP immediates into loads from the stack, except for the special
// cases we handle.
@@ -398,7 +398,6 @@
// We don't support sin/cos/fmod
setOperationAction(ISD::FSIN , MVT::f32, Expand);
setOperationAction(ISD::FCOS , MVT::f32, Expand);
- setOperationAction(ISD::FREM , MVT::f32, Expand);
// Special cases we handle for FP constants.
addLegalFPImmediate(APFloat(+0.0f)); // xorps
Added: llvm/trunk/test/CodeGen/X86/2008-03-06-frem-fpstack.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-03-06-frem-fpstack.ll?rev=48006&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2008-03-06-frem-fpstack.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2008-03-06-frem-fpstack.ll Fri Mar 7 00:36:32 2008
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386
+; PR2122
+define float @func(float %a, float %b) nounwind {
+entry:
+ %tmp3 = frem float %a, %b ; <float> [#uses=1]
+ ret float %tmp3
+}
More information about the llvm-commits
mailing list