X87: Inline Math.fround in optimized code.

port r22665.

original commit message:
 Inline Math.fround in optimized code.

BUG=
R=weiliang.lin@intel.com

Review URL: https://codereview.chromium.org/429143003

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22691 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e123082f
......@@ -3733,6 +3733,10 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
UNIMPLEMENTED();
}
void LCodeGen::DoMathFround(LMathFround* instr) {
UNIMPLEMENTED();
}
void LCodeGen::DoMathSqrt(LMathSqrt* instr) {
UNIMPLEMENTED();
......
......@@ -1148,6 +1148,7 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
switch (instr->op()) {
case kMathFloor: return DoMathFloor(instr);
case kMathRound: return DoMathRound(instr);
case kMathFround: return DoMathFround(instr);
case kMathAbs: return DoMathAbs(instr);
case kMathLog: return DoMathLog(instr);
case kMathExp: return DoMathExp(instr);
......@@ -1175,6 +1176,13 @@ LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) {
}
LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) {
LOperand* input = UseRegisterAtStart(instr->value());
LMathFround* result = new (zone()) LMathFround(input);
return AssignEnvironment(DefineAsRegister(result));
}
LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) {
LOperand* context = UseAny(instr->context()); // Deferred use.
LOperand* input = UseRegisterAtStart(instr->value());
......
......@@ -112,6 +112,7 @@ class LCodeGen;
V(MathClz32) \
V(MathExp) \
V(MathFloor) \
V(MathFround) \
V(MathLog) \
V(MathMinMax) \
V(MathPowHalf) \
......@@ -873,6 +874,16 @@ class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 0> {
};
class LMathFround V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
explicit LMathFround(LOperand* value) { inputs_[0] = value; }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(MathFround, "math-fround")
};
class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
LMathAbs(LOperand* context, LOperand* value) {
......@@ -2751,6 +2762,7 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
LInstruction* DoMathFloor(HUnaryMathOperation* instr);
LInstruction* DoMathRound(HUnaryMathOperation* instr);
LInstruction* DoMathFround(HUnaryMathOperation* instr);
LInstruction* DoMathAbs(HUnaryMathOperation* instr);
LInstruction* DoMathLog(HUnaryMathOperation* instr);
LInstruction* DoMathExp(HUnaryMathOperation* instr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment