Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1708)

Unified Diff: src/x87/lithium-x87.h

Issue 293743005: Introduce x87 port (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x87/lithium-gap-resolver-x87.cc ('k') | src/x87/lithium-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/lithium-x87.h
diff --git a/src/ia32/lithium-ia32.h b/src/x87/lithium-x87.h
similarity index 97%
copy from src/ia32/lithium-ia32.h
copy to src/x87/lithium-x87.h
index 20b4a29cd85180b2757e2b9552e9e55560a5c177..b2c3f65a6d66da8e15edb344cf09a305c7d4713b 100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/x87/lithium-x87.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef V8_IA32_LITHIUM_IA32_H_
-#define V8_IA32_LITHIUM_IA32_H_
+#ifndef V8_X87_LITHIUM_X87_H_
+#define V8_X87_LITHIUM_X87_H_
#include "hydrogen.h"
#include "lithium-allocator.h"
@@ -45,8 +45,9 @@ class LCodeGen;
V(CheckValue) \
V(ClampDToUint8) \
V(ClampIToUint8) \
- V(ClampTToUint8) \
+ V(ClampTToUint8NoSSE2) \
V(ClassOfTestAndBranch) \
+ V(ClobberDoubles) \
V(CompareMinusZeroAndBranch) \
V(CompareNumericAndBranch) \
V(CmpObjectEqAndBranch) \
@@ -238,7 +239,10 @@ class LInstruction : public ZoneObject {
bool ClobbersTemps() const { return IsCall(); }
bool ClobbersRegisters() const { return IsCall(); }
virtual bool ClobbersDoubleRegisters(Isolate* isolate) const {
- return IsCall();
+ return IsCall() ||
+ // We only have rudimentary X87Stack tracking, thus in general
+ // cannot handle phi-nodes.
+ (IsControl());
}
virtual bool HasResult() const = 0;
@@ -246,6 +250,7 @@ class LInstruction : public ZoneObject {
bool HasDoubleRegisterResult();
bool HasDoubleRegisterInput();
+ bool IsDoubleInput(X87Register reg, LCodeGen* cgen);
LOperand* FirstInput() { return InputAt(0); }
LOperand* Output() { return HasResult() ? result() : NULL; }
@@ -370,6 +375,18 @@ class LInstructionGap V8_FINAL : public LGap {
};
+class LClobberDoubles V8_FINAL : public LTemplateInstruction<0, 0, 0> {
+ public:
+ explicit LClobberDoubles(Isolate* isolate) { }
+
+ virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE {
+ return true;
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(ClobberDoubles, "clobber-d")
+};
+
+
class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> {
public:
explicit LGoto(HBasicBlock* block) : block_(block) { }
@@ -841,15 +858,13 @@ class LMathFloor V8_FINAL : public LTemplateInstruction<1, 1, 0> {
};
-class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LMathRound(LOperand* value, LOperand* temp) {
+ explicit LMathRound(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
@@ -1976,12 +1991,11 @@ class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> {
DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE {
- return save_doubles() == kDontSaveFPRegs;
+ return true;
}
const Runtime::Function* function() const { return hydrogen()->function(); }
int arity() const { return hydrogen()->argument_count(); }
- SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
};
@@ -1999,13 +2013,11 @@ class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 1> {
public:
- explicit LUint32ToDouble(LOperand* value, LOperand* temp) {
+ explicit LUint32ToDouble(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
};
@@ -2025,17 +2037,15 @@ class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 1> {
};
-class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 2> {
+class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 1> {
public:
- LNumberTagU(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ LNumberTagU(LOperand* value, LOperand* temp) {
inputs_[0] = value;
- temps_[0] = temp1;
- temps_[1] = temp2;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp1() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
+ LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
};
@@ -2057,15 +2067,13 @@ class LNumberTagD V8_FINAL : public LTemplateInstruction<1, 1, 1> {
// Sometimes truncating conversion from a tagged value to an int32.
-class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LDoubleToI(LOperand* value, LOperand* temp) {
+ explicit LDoubleToI(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
@@ -2088,15 +2096,13 @@ class LDoubleToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
// Truncating conversion from a tagged value to an int32.
-class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LTaggedToI(LOperand* value, LOperand* temp) {
+ explicit LTaggedToI(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
DECLARE_HYDROGEN_ACCESSOR(Change)
@@ -2442,17 +2448,27 @@ class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
};
-class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+// Truncating conversion from a tagged value to an int32.
+class LClampTToUint8NoSSE2 V8_FINAL : public LTemplateInstruction<1, 1, 3> {
public:
- LClampTToUint8(LOperand* value, LOperand* temp_xmm) {
- inputs_[0] = value;
- temps_[0] = temp_xmm;
+ LClampTToUint8NoSSE2(LOperand* unclamped,
+ LOperand* temp1,
+ LOperand* temp2,
+ LOperand* temp3) {
+ inputs_[0] = unclamped;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
+ temps_[2] = temp3;
}
LOperand* unclamped() { return inputs_[0]; }
- LOperand* temp_xmm() { return temps_[0]; }
+ LOperand* scratch() { return temps_[0]; }
+ LOperand* scratch2() { return temps_[1]; }
+ LOperand* scratch3() { return temps_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
+ DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8NoSSE2,
+ "clamp-t-to-uint8-nosse2")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
};
@@ -2749,13 +2765,11 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
// Methods for getting operands for Use / Define / Temp.
LUnallocated* ToUnallocated(Register reg);
- LUnallocated* ToUnallocated(XMMRegister reg);
+ LUnallocated* ToUnallocated(X87Register reg);
// Methods for setting up define-use relationships.
MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
- MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
- XMMRegister fixed_register);
// A value that is guaranteed to be allocated to a register.
// Operand created by UseRegister is guaranteed to be live until the end of
@@ -2797,7 +2811,6 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
// Temporary operand that must be in a register.
MUST_USE_RESULT LUnallocated* TempRegister();
MUST_USE_RESULT LOperand* FixedTemp(Register reg);
- MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg);
// Methods for setting up define-use relationships.
// Return the same instruction that they are passed.
@@ -2809,8 +2822,7 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
Register reg);
- LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
- XMMRegister reg);
+ LInstruction* DefineX87TOS(LTemplateResultInstruction<1>* instr);
// Assigns an environment to an instruction. An instruction which can
// deoptimize must have an environment.
LInstruction* AssignEnvironment(LInstruction* instr);
@@ -2859,4 +2871,4 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
} } // namespace v8::internal
-#endif // V8_IA32_LITHIUM_IA32_H_
+#endif // V8_X87_LITHIUM_X87_H_
« no previous file with comments | « src/x87/lithium-gap-resolver-x87.cc ('k') | src/x87/lithium-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698