aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-03-29 18:43:11 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-03-29 18:43:11 +0000
commit21ecc2f4edbbc2c4ec1c2e2c87dc5a5ee6f58a68 (patch)
treec1f707a0f674205b17bff12565cb42ec99e794c3
parentc6a96ff6aeeb77e1007364e5603b72f3ab4cc7bd (diff)
downloadexternal_llvm-21ecc2f4edbbc2c4ec1c2e2c87dc5a5ee6f58a68.zip
external_llvm-21ecc2f4edbbc2c4ec1c2e2c87dc5a5ee6f58a68.tar.gz
external_llvm-21ecc2f4edbbc2c4ec1c2e2c87dc5a5ee6f58a68.tar.bz2
Expand FREM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153671 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/Mips/MipsISelLowering.cpp2
-rw-r--r--test/CodeGen/Mips/frem.ll13
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp
index eb0e8ae..9cba688 100644
--- a/lib/Target/Mips/MipsISelLowering.cpp
+++ b/lib/Target/Mips/MipsISelLowering.cpp
@@ -208,6 +208,8 @@ MipsTargetLowering(MipsTargetMachine &TM)
setOperationAction(ISD::FEXP, MVT::f32, Expand);
setOperationAction(ISD::FMA, MVT::f32, Expand);
setOperationAction(ISD::FMA, MVT::f64, Expand);
+ setOperationAction(ISD::FREM, MVT::f32, Expand);
+ setOperationAction(ISD::FREM, MVT::f64, Expand);
setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand);
setOperationAction(ISD::EXCEPTIONADDR, MVT::i64, Expand);
diff --git a/test/CodeGen/Mips/frem.ll b/test/CodeGen/Mips/frem.ll
new file mode 100644
index 0000000..be222b2
--- /dev/null
+++ b/test/CodeGen/Mips/frem.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -march=mipsel
+
+define float @fmods(float %x, float %y) {
+entry:
+ %r = frem float %x, %y
+ ret float %r
+}
+
+define double @fmodd(double %x, double %y) {
+entry:
+ %r = frem double %x, %y
+ ret double %r
+}