Emit neg.s or neg.d only if -enable-no-nans-fp-math is supplied by user,
[oota-llvm.git] / lib / Target / Mips / MipsISelLowering.cpp
index 842988c816f6a76d83a3350a923348d3a4a06988..6a23bc3d1d7cc6d9e45501f7499131fe8ebbf07b 100644 (file)
@@ -216,6 +216,11 @@ MipsTargetLowering(MipsTargetMachine &TM)
   setOperationAction(ISD::FREM,              MVT::f32,   Expand);
   setOperationAction(ISD::FREM,              MVT::f64,   Expand);
 
+  if (!TM.Options.NoNaNsFPMath) {
+    setOperationAction(ISD::FNEG,             MVT::f32,   Expand);
+    setOperationAction(ISD::FNEG,             MVT::f64,   Expand);
+  }
+
   setOperationAction(ISD::EXCEPTIONADDR,     MVT::i32, Expand);
   setOperationAction(ISD::EXCEPTIONADDR,     MVT::i64, Expand);
   setOperationAction(ISD::EHSELECTION,       MVT::i32, Expand);