Revision: 24611
Author:   [email protected]
Date:     Tue Oct 14 17:26:14 2014 UTC
Log:      MIPS: [turbofan] Optimize division/modulus by constant.

Port r24595 (d0f464e)

TEST=cctest,mjsunit,unittests
BUG=
[email protected]

Review URL: https://codereview.chromium.org/651223003
https://code.google.com/p/v8/source/detail?r=24611

Modified:
 /branches/bleeding_edge/src/compiler/mips/code-generator-mips.cc
 /branches/bleeding_edge/src/compiler/mips/instruction-codes-mips.h
 /branches/bleeding_edge/src/compiler/mips/instruction-selector-mips.cc

=======================================
--- /branches/bleeding_edge/src/compiler/mips/code-generator-mips.cc Tue Oct 14 08:51:22 2014 UTC +++ /branches/bleeding_edge/src/compiler/mips/code-generator-mips.cc Tue Oct 14 17:26:14 2014 UTC
@@ -185,6 +185,9 @@
     case kMipsMul:
       __ Mul(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
       break;
+    case kMipsMulHigh:
+      __ Mulh(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
+      break;
     case kMipsDiv:
       __ Div(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
       break;
=======================================
--- /branches/bleeding_edge/src/compiler/mips/instruction-codes-mips.h Thu Oct 2 15:48:48 2014 UTC +++ /branches/bleeding_edge/src/compiler/mips/instruction-codes-mips.h Tue Oct 14 17:26:14 2014 UTC
@@ -17,6 +17,7 @@
   V(MipsSub)                       \
   V(MipsSubOvf)                    \
   V(MipsMul)                       \
+  V(MipsMulHigh)                   \
   V(MipsDiv)                       \
   V(MipsDivU)                      \
   V(MipsMod)                       \
=======================================
--- /branches/bleeding_edge/src/compiler/mips/instruction-selector-mips.cc Mon Oct 13 23:31:59 2014 UTC +++ /branches/bleeding_edge/src/compiler/mips/instruction-selector-mips.cc Tue Oct 14 17:26:14 2014 UTC
@@ -298,6 +298,13 @@
   Emit(kMipsMul, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
        g.UseRegister(m.right().node()));
 }
+
+
+void InstructionSelector::VisitInt32MulHigh(Node* node) {
+  MipsOperandGenerator g(this);
+ Emit(kMipsMulHigh, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)),
+       g.UseRegister(node->InputAt(1)));
+}


 void InstructionSelector::VisitInt32Div(Node* node) {

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to