Revision: 22691
Author:   [email protected]
Date:     Wed Jul 30 06:46:25 2014 UTC
Log:      X87: Inline Math.fround in optimized code.

port r22665.

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

BUG=
[email protected]

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

Patch from Chunyang Dai <[email protected]>.
http://code.google.com/p/v8/source/detail?r=22691

Modified:
 /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc
 /branches/bleeding_edge/src/x87/lithium-x87.cc
 /branches/bleeding_edge/src/x87/lithium-x87.h

=======================================
--- /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Thu Jul 24 09:11:59 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Wed Jul 30 06:46:25 2014 UTC
@@ -3732,6 +3732,10 @@
 void LCodeGen::DoMathRound(LMathRound* instr) {
   UNIMPLEMENTED();
 }
+
+void LCodeGen::DoMathFround(LMathFround* instr) {
+  UNIMPLEMENTED();
+}


 void LCodeGen::DoMathSqrt(LMathSqrt* instr) {
=======================================
--- /branches/bleeding_edge/src/x87/lithium-x87.cc Wed Jul 23 07:48:19 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-x87.cc Wed Jul 30 06:46:25 2014 UTC
@@ -1148,6 +1148,7 @@
   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);
@@ -1173,6 +1174,13 @@
   UNREACHABLE();
   return NULL;
 }
+
+
+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) {
=======================================
--- /branches/bleeding_edge/src/x87/lithium-x87.h Wed Jul 23 07:48:19 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-x87.h Wed Jul 30 06:46:25 2014 UTC
@@ -112,6 +112,7 @@
   V(MathClz32)                                  \
   V(MathExp)                                    \
   V(MathFloor)                                  \
+  V(MathFround)                                 \
   V(MathLog)                                    \
   V(MathMinMax)                                 \
   V(MathPowHalf)                                \
@@ -873,6 +874,16 @@
 };


+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 @@

   LInstruction* DoMathFloor(HUnaryMathOperation* instr);
   LInstruction* DoMathRound(HUnaryMathOperation* instr);
+  LInstruction* DoMathFround(HUnaryMathOperation* instr);
   LInstruction* DoMathAbs(HUnaryMathOperation* instr);
   LInstruction* DoMathLog(HUnaryMathOperation* instr);
   LInstruction* DoMathExp(HUnaryMathOperation* instr);

--
--
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