Reviewers: danno, dcarney, Jakob, mtbrandyberry, Sven Panne, Yang,
Message:
Next PPC port
Description:
PPC: [turbofan] Turn Math.clz32 into an inlinable builtin.
Port 3aa206b86560da94f895625186295bf07a0301d8
Original commit message:
[email protected], [email protected]
BUG=v8:3952
LOG=n
[email protected], [email protected], [email protected],
[email protected]
Please review this at https://codereview.chromium.org/1028313003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+11, -0 lines):
M src/compiler/ppc/code-generator-ppc.cc
M src/compiler/ppc/instruction-codes-ppc.h
M src/compiler/ppc/instruction-selector-ppc.cc
Index: src/compiler/ppc/code-generator-ppc.cc
diff --git a/src/compiler/ppc/code-generator-ppc.cc
b/src/compiler/ppc/code-generator-ppc.cc
index
92562f0e64963636b4260002bf41e8f8ad37ded5..b843ad698536d045bc8ce1a0345864d78464f50d
100644
--- a/src/compiler/ppc/code-generator-ppc.cc
+++ b/src/compiler/ppc/code-generator-ppc.cc
@@ -839,6 +839,10 @@ void
CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kPPC_NegFloat64:
ASSEMBLE_FLOAT_UNOP_RC(fneg);
break;
+ case kPPC_Cntlz32:
+ __ cntlzw_(i.OutputRegister(), i.InputRegister(0));
+ DCHECK_EQ(LeaveRC, i.OutputRCBit());
+ break;
case kPPC_Cmp32:
ASSEMBLE_COMPARE(cmpw, cmplw);
break;
Index: src/compiler/ppc/instruction-codes-ppc.h
diff --git a/src/compiler/ppc/instruction-codes-ppc.h
b/src/compiler/ppc/instruction-codes-ppc.h
index
1eeaeecafff44af5120075cf9c1027049cff5d58..bb0a77117d5ef37f80bff3ccb858ed982f69a41b
100644
--- a/src/compiler/ppc/instruction-codes-ppc.h
+++ b/src/compiler/ppc/instruction-codes-ppc.h
@@ -69,6 +69,7 @@ namespace compiler {
V(PPC_RoundFloat64) \
V(PPC_MaxFloat64) \
V(PPC_MinFloat64) \
+ V(PPC_Cntlz32) \
V(PPC_Cmp32) \
V(PPC_Cmp64) \
V(PPC_CmpFloat64) \
Index: src/compiler/ppc/instruction-selector-ppc.cc
diff --git a/src/compiler/ppc/instruction-selector-ppc.cc
b/src/compiler/ppc/instruction-selector-ppc.cc
index
1c0e4663add7b8f449f551046f2f164220c97329..8d8fbdaf19dd582e24d1e11d272c8ed7a06051cf
100644
--- a/src/compiler/ppc/instruction-selector-ppc.cc
+++ b/src/compiler/ppc/instruction-selector-ppc.cc
@@ -737,6 +737,12 @@ void InstructionSelector::VisitWord64Ror(Node* node) {
#endif
+void InstructionSelector::VisitWord32Clz(Node* node) {
+ PPCOperandGenerator g(this);
+ Emit(kPPC_Cntlz32, g.DefineAsRegister(node),
g.UseRegister(node->InputAt(0)));
+}
+
+
void InstructionSelector::VisitInt32Add(Node* node) {
VisitBinop<Int32BinopMatcher>(this, node, kPPC_Add32, kInt16Imm);
}
--
--
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.