[mips] Fix predicate for the MipsTruncIntFP pattern
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 18 Jul 2018 14:11:22 +0000 (14:11 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 18 Jul 2018 14:11:22 +0000 (14:11 +0000)
This is a follow-up to the rL337171. This patch fixes regression
introduced by the r337171 and enables MipsTruncIntFP pattern.

Differential revision: https://reviews.llvm.org/D49469

llvm-svn: 337392

llvm/lib/Target/Mips/MipsInstrFPU.td
llvm/test/CodeGen/Mips/double2int.ll

index b17a340..dd30e20 100644 (file)
@@ -894,7 +894,7 @@ def : MipsPat<(f64 (sint_to_fp GPR64Opnd:$src)),
               (PseudoCVT_D64_L GPR64Opnd:$src)>, FGR_64;
 
 def : MipsPat<(MipsTruncIntFP FGR64Opnd:$src),
-              (TRUNC_W_D64 FGR64Opnd:$src)>, ISA_MIPS3, FGR_64;
+              (TRUNC_W_D64 FGR64Opnd:$src)>, ISA_MIPS2, FGR_64;
 def : MipsPat<(MipsTruncIntFP FGR32Opnd:$src),
               (TRUNC_L_S FGR32Opnd:$src)>, ISA_MIPS2, FGR_64;
 def : MipsPat<(MipsTruncIntFP FGR64Opnd:$src),
index 445ccb3..f0d8ad2 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: llc -march=mips < %s | FileCheck %s
+; RUN: llc -march=mips -mcpu=mips32 < %s | FileCheck %s
+; RUN: llc -march=mips -mcpu=mips32r6 < %s | FileCheck %s
 
 define i32 @f1(double %d) nounwind readnone {
 entry: