Reviewers: Weiliang, Yang,

Message:
weiliang.
please review this porting patch.

It's only the framework for X87 port. we will
implement it in the future.

thanks.

Description:
X87: Inline Math.fround in optimized code.

port r22665.

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

BUG=

Please review this at https://codereview.chromium.org/429143003/

SVN Base: https://chromium.googlesource.com/external/v8.git@bleeding_edge

Affected files (+24, -0 lines):
  M src/x87/lithium-codegen-x87.cc
  M src/x87/lithium-x87.h
  M src/x87/lithium-x87.cc


Index: src/x87/lithium-codegen-x87.cc
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc
index c32e5de24aeb2c2e966b702c46fc80da5e8819ab..a7c5a9fbdf51fb705d01cd854969f5bb06d8e672 100644
--- a/src/x87/lithium-codegen-x87.cc
+++ b/src/x87/lithium-codegen-x87.cc
@@ -3733,6 +3733,10 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
   UNIMPLEMENTED();
 }

+void LCodeGen::DoMathFround(LMathFround* instr) {
+  UNIMPLEMENTED();
+}
+

 void LCodeGen::DoMathSqrt(LMathSqrt* instr) {
   UNIMPLEMENTED();
Index: src/x87/lithium-x87.cc
diff --git a/src/x87/lithium-x87.cc b/src/x87/lithium-x87.cc
index 290f4f21fa796d9b5d83dceae258f56f00c4d570..361b20be0b2fd2ffc8feec862de0c6870b821949 100644
--- a/src/x87/lithium-x87.cc
+++ b/src/x87/lithium-x87.cc
@@ -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());
Index: src/x87/lithium-x87.h
diff --git a/src/x87/lithium-x87.h b/src/x87/lithium-x87.h
index ea76738ba7451db688daf12d0f62e13355a12d2e..ec7418b410db2c89b58057f054b0d5a6fbde6462 100644
--- a/src/x87/lithium-x87.h
+++ b/src/x87/lithium-x87.h
@@ -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);


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