Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index d11835452c72d7024f2a38bb49a854eba7ce45f1..0c62cacd8f614711c89a9a23e9c2b973ecca709e 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -143,6 +143,7 @@ class LChunkBuilder; |
| V(MathMinMax) \ |
| V(Mod) \ |
| V(Mul) \ |
| + V(MultiplyAdd) \ |
| V(ObjectLiteral) \ |
| V(OsrEntry) \ |
| V(OuterContext) \ |
| @@ -3537,6 +3538,44 @@ class HMul: public HArithmeticBinaryOperation { |
| }; |
| +class HMultiplyAdd: public HTemplateInstruction<4> { |
| + public: |
| + HMultiplyAdd(HValue* context, HValue* a, HValue* b, HValue* c) { |
| + ASSERT(a != NULL && b != NULL && c != NULL); |
| + SetOperandAt(0, context); |
| + SetOperandAt(1, a); |
| + SetOperandAt(2, b); |
| + SetOperandAt(3, c); |
| + |
| + // FIXME: Not sure what the stuff below means. Stolen from |
| + // HArithmeticBinaryOperation and HMathFloorOfDiv. |
|
ulan_google
2012/11/07 09:54:03
It sets the output representation of this instruct
|
| + set_representation(Representation::Double()); |
| + } |
| + |
| + HValue* context() { return OperandAt(0); } |
| + HValue* a() { return OperandAt(1); } |
| + HValue* b() { return OperandAt(2); } |
| + HValue* c() { return OperandAt(3); } |
| + |
| + virtual bool IsCommutative() const { return false; } |
| + |
| + virtual void PrintDataTo(StringStream* stream) { |
| + // FIXME: Implement properly in the .cc file |
| + a()->PrintNameTo(stream); |
| + stream->Add(" "); |
| + b()->PrintNameTo(stream); |
| + stream->Add(" "); |
| + c()->PrintNameTo(stream); |
| + } |
| + |
| + virtual Representation RequiredInputRepresentation(int index) { |
| + return index == 0 ? Representation::Tagged() : Representation::Double(); |
| + } |
| + |
| + DECLARE_CONCRETE_INSTRUCTION(MultiplyAdd) |
| +}; |
| + |
| + |
| class HMod: public HArithmeticBinaryOperation { |
| public: |
| HMod(HValue* context, HValue* left, HValue* right) |