]> granicus.if.org Git - llvm/commitdiff
[mips] Use mult/mflo pattern on 64-bit targets prior to MIPS64
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 17 Jul 2019 08:11:40 +0000 (08:11 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 17 Jul 2019 08:11:40 +0000 (08:11 +0000)
The `MUL` instruction is available starting from the MIPS32/MIPS64 targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366301 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/Mips64InstrInfo.td
test/CodeGen/Mips/llvm-ir/mul.ll

index b5711004f700767b143fbd8137070675469f6b2a..7f35280f793638f830ad73c952dcf53a70b0fbdf 100644 (file)
@@ -853,7 +853,7 @@ def : MipsPat<(i64 (sext (i32 (sub GPR32:$src, GPR32:$src2)))),
               (SUBu GPR32:$src, GPR32:$src2), sub_32)>;
 def : MipsPat<(i64 (sext (i32 (mul GPR32:$src, GPR32:$src2)))),
               (INSERT_SUBREG (i64 (IMPLICIT_DEF)),
-              (MUL GPR32:$src, GPR32:$src2), sub_32)>, ISA_MIPS3_NOT_32R6_64R6;
+              (MUL GPR32:$src, GPR32:$src2), sub_32)>, ISA_MIPS32_NOT_32R6_64R6;
 def : MipsPat<(i64 (sext (i32 (MipsMFHI ACC64:$src)))),
               (INSERT_SUBREG (i64 (IMPLICIT_DEF)),
               (PseudoMFHI ACC64:$src), sub_32)>;
index b6f535abdee35fcc836ca99e6a2c039ee79cb2ed..c75bda3f394ad344e97fd2aee3a92d708f182371 100644 (file)
@@ -155,6 +155,9 @@ entry:
   ; M2:         mult    $4, $5
   ; M2:         mflo    $2
 
+  ; M4:         mult    $4, $5
+  ; M4:         mflo    $1
+
   ; 32R1-R5:    mul     $2, $4, $5
   ; 32R6:       mul     $2, $4, $5