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 e9e6a758ec35744959557ef42ac4f6e02c47356c..0fe2acb369bbec610c182371f255cb1658f770f6 100644 |
--- a/src/compiler/ppc/instruction-selector-ppc.cc |
+++ b/src/compiler/ppc/instruction-selector-ppc.cc |
@@ -874,26 +874,31 @@ void InstructionSelector::VisitChangeInt32ToInt64(Node* node) { |
void InstructionSelector::VisitChangeUint32ToUint64(Node* node) { |
// TODO(mbrandy): inspect input to see if nop is appropriate. |
- PPCOperandGenerator g(this); |
- Emit(kPPC_Uint32ToUint64, g.DefineAsRegister(node), |
- g.UseRegister(node->InputAt(0))); |
+ VisitRR(this, kPPC_Uint32ToUint64, node); |
} |
#endif |
void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
- PPCOperandGenerator g(this); |
- Emit(kPPC_DoubleToFloat32, g.DefineAsRegister(node), |
- g.UseRegister(node->InputAt(0))); |
+ VisitRR(this, kPPC_DoubleToFloat32, node); |
+} |
+ |
+ |
+void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) { |
+ switch (TruncationModeOf(node->op())) { |
+ case TruncationMode::kJavaScript: |
+ return VisitRR(this, kArchTruncateDoubleToI, node); |
+ case TruncationMode::kRoundToZero: |
+ return VisitRR(this, kPPC_DoubleToInt32, node); |
+ } |
+ UNREACHABLE(); |
} |
#if V8_TARGET_ARCH_PPC64 |
void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { |
- PPCOperandGenerator g(this); |
// TODO(mbrandy): inspect input to see if nop is appropriate. |
- Emit(kPPC_Int64ToInt32, g.DefineAsRegister(node), |
- g.UseRegister(node->InputAt(0))); |
+ VisitRR(this, kPPC_Int64ToInt32, node); |
} |
#endif |