Commit dabb34b2 authored by Jacob.Bramley@arm.com's avatar Jacob.Bramley@arm.com

ARM64: Remove ToOperand32I and ToOperand32U.

These were front-ends to ToOperand32, to specify sign-extension.
However, since r22148, bits 63-32 are ignored for 32-bit operations
anyway, so there's no need for the caller to be explicit.

BUG=
R=ulan@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b488b2ed
...@@ -1226,17 +1226,7 @@ Operand LCodeGen::ToOperand(LOperand* op) { ...@@ -1226,17 +1226,7 @@ Operand LCodeGen::ToOperand(LOperand* op) {
} }
Operand LCodeGen::ToOperand32I(LOperand* op) { Operand LCodeGen::ToOperand32(LOperand* op) {
return ToOperand32(op, SIGNED_INT32);
}
Operand LCodeGen::ToOperand32U(LOperand* op) {
return ToOperand32(op, UNSIGNED_INT32);
}
Operand LCodeGen::ToOperand32(LOperand* op, IntegerSignedness signedness) {
DCHECK(op != NULL); DCHECK(op != NULL);
if (op->IsRegister()) { if (op->IsRegister()) {
return Operand(ToRegister32(op)); return Operand(ToRegister32(op));
...@@ -1245,10 +1235,7 @@ Operand LCodeGen::ToOperand32(LOperand* op, IntegerSignedness signedness) { ...@@ -1245,10 +1235,7 @@ Operand LCodeGen::ToOperand32(LOperand* op, IntegerSignedness signedness) {
HConstant* constant = chunk()->LookupConstant(const_op); HConstant* constant = chunk()->LookupConstant(const_op);
Representation r = chunk_->LookupLiteralRepresentation(const_op); Representation r = chunk_->LookupLiteralRepresentation(const_op);
if (r.IsInteger32()) { if (r.IsInteger32()) {
DCHECK(constant->HasInteger32Value()); return Operand(constant->Integer32Value());
return (signedness == SIGNED_INT32)
? Operand(constant->Integer32Value())
: Operand(static_cast<uint32_t>(constant->Integer32Value()));
} else { } else {
// Other constants not implemented. // Other constants not implemented.
Abort(kToOperand32UnsupportedImmediate); Abort(kToOperand32UnsupportedImmediate);
...@@ -1314,12 +1301,10 @@ Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { ...@@ -1314,12 +1301,10 @@ Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const {
} }
template<class LI> template <class LI>
Operand LCodeGen::ToShiftedRightOperand32(LOperand* right, LI* shift_info, Operand LCodeGen::ToShiftedRightOperand32(LOperand* right, LI* shift_info) {
IntegerSignedness signedness) {
if (shift_info->shift() == NO_SHIFT) { if (shift_info->shift() == NO_SHIFT) {
return (signedness == SIGNED_INT32) ? ToOperand32I(right) return ToOperand32(right);
: ToOperand32U(right);
} else { } else {
return Operand( return Operand(
ToRegister32(right), ToRegister32(right),
...@@ -1501,7 +1486,7 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { ...@@ -1501,7 +1486,7 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
} }
} else { } else {
Register length = ToRegister32(instr->length()); Register length = ToRegister32(instr->length());
Operand index = ToOperand32I(instr->index()); Operand index = ToOperand32(instr->index());
__ Sub(result.W(), length, index); __ Sub(result.W(), length, index);
__ Add(result.W(), result.W(), 1); __ Add(result.W(), result.W(), 1);
__ Ldr(result, MemOperand(arguments, result, UXTW, kPointerSizeLog2)); __ Ldr(result, MemOperand(arguments, result, UXTW, kPointerSizeLog2));
...@@ -1525,7 +1510,7 @@ void LCodeGen::DoAddI(LAddI* instr) { ...@@ -1525,7 +1510,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
Register result = ToRegister32(instr->result()); Register result = ToRegister32(instr->result());
Register left = ToRegister32(instr->left()); Register left = ToRegister32(instr->left());
Operand right = ToShiftedRightOperand32I(instr->right(), instr); Operand right = ToShiftedRightOperand32(instr->right(), instr);
if (can_overflow) { if (can_overflow) {
__ Adds(result, left, right); __ Adds(result, left, right);
...@@ -1804,7 +1789,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) { ...@@ -1804,7 +1789,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
void LCodeGen::DoBitI(LBitI* instr) { void LCodeGen::DoBitI(LBitI* instr) {
Register result = ToRegister32(instr->result()); Register result = ToRegister32(instr->result());
Register left = ToRegister32(instr->left()); Register left = ToRegister32(instr->left());
Operand right = ToShiftedRightOperand32U(instr->right(), instr); Operand right = ToShiftedRightOperand32(instr->right(), instr);
switch (instr->op()) { switch (instr->op()) {
case Token::BIT_AND: __ And(result, left, right); break; case Token::BIT_AND: __ And(result, left, right); break;
...@@ -1838,13 +1823,13 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck *instr) { ...@@ -1838,13 +1823,13 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck *instr) {
DCHECK(instr->hydrogen()->index()->representation().IsInteger32()); DCHECK(instr->hydrogen()->index()->representation().IsInteger32());
DCHECK(instr->hydrogen()->length()->representation().IsInteger32()); DCHECK(instr->hydrogen()->length()->representation().IsInteger32());
if (instr->index()->IsConstantOperand()) { if (instr->index()->IsConstantOperand()) {
Operand index = ToOperand32I(instr->index()); Operand index = ToOperand32(instr->index());
Register length = ToRegister32(instr->length()); Register length = ToRegister32(instr->length());
__ Cmp(length, index); __ Cmp(length, index);
cond = CommuteCondition(cond); cond = CommuteCondition(cond);
} else { } else {
Register index = ToRegister32(instr->index()); Register index = ToRegister32(instr->index());
Operand length = ToOperand32I(instr->length()); Operand length = ToOperand32(instr->length());
__ Cmp(index, length); __ Cmp(index, length);
} }
if (FLAG_debug_code && instr->hydrogen()->skip_check()) { if (FLAG_debug_code && instr->hydrogen()->skip_check()) {
...@@ -2486,16 +2471,12 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) { ...@@ -2486,16 +2471,12 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
} else { } else {
if (instr->hydrogen_value()->representation().IsInteger32()) { if (instr->hydrogen_value()->representation().IsInteger32()) {
if (right->IsConstantOperand()) { if (right->IsConstantOperand()) {
EmitCompareAndBranch(instr, EmitCompareAndBranch(instr, cond, ToRegister32(left),
cond, ToOperand32(right));
ToRegister32(left),
ToOperand32I(right));
} else { } else {
// Commute the operands and the condition. // Commute the operands and the condition.
EmitCompareAndBranch(instr, EmitCompareAndBranch(instr, CommuteCondition(cond),
CommuteCondition(cond), ToRegister32(right), ToOperand32(left));
ToRegister32(right),
ToOperand32I(left));
} }
} else { } else {
DCHECK(instr->hydrogen_value()->representation().IsSmi()); DCHECK(instr->hydrogen_value()->representation().IsSmi());
...@@ -3017,7 +2998,7 @@ void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { ...@@ -3017,7 +2998,7 @@ void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register base = ToRegister(instr->base_object()); Register base = ToRegister(instr->base_object());
if (instr->offset()->IsConstantOperand()) { if (instr->offset()->IsConstantOperand()) {
__ Add(result, base, ToOperand32I(instr->offset())); __ Add(result, base, ToOperand32(instr->offset()));
} else { } else {
__ Add(result, base, Operand(ToRegister32(instr->offset()), SXTW)); __ Add(result, base, Operand(ToRegister32(instr->offset()), SXTW));
} }
...@@ -4220,7 +4201,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { ...@@ -4220,7 +4201,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
if (instr->hydrogen()->representation().IsInteger32()) { if (instr->hydrogen()->representation().IsInteger32()) {
Register result = ToRegister32(instr->result()); Register result = ToRegister32(instr->result());
Register left = ToRegister32(instr->left()); Register left = ToRegister32(instr->left());
Operand right = ToOperand32I(instr->right()); Operand right = ToOperand32(instr->right());
__ Cmp(left, right); __ Cmp(left, right);
__ Csel(result, left, right, (op == HMathMinMax::kMathMax) ? ge : le); __ Csel(result, left, right, (op == HMathMinMax::kMathMax) ? ge : le);
...@@ -5571,7 +5552,7 @@ void LCodeGen::DoSubI(LSubI* instr) { ...@@ -5571,7 +5552,7 @@ void LCodeGen::DoSubI(LSubI* instr) {
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
Register result = ToRegister32(instr->result()); Register result = ToRegister32(instr->result());
Register left = ToRegister32(instr->left()); Register left = ToRegister32(instr->left());
Operand right = ToShiftedRightOperand32I(instr->right(), instr); Operand right = ToShiftedRightOperand32(instr->right(), instr);
if (can_overflow) { if (can_overflow) {
__ Subs(result, left, right); __ Subs(result, left, right);
......
...@@ -83,31 +83,17 @@ class LCodeGen: public LCodeGenBase { ...@@ -83,31 +83,17 @@ class LCodeGen: public LCodeGenBase {
enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 };
// Support for converting LOperands to assembler types. // Support for converting LOperands to assembler types.
// LOperand must be a register.
Register ToRegister(LOperand* op) const; Register ToRegister(LOperand* op) const;
Register ToRegister32(LOperand* op) const; Register ToRegister32(LOperand* op) const;
Operand ToOperand(LOperand* op); Operand ToOperand(LOperand* op);
Operand ToOperand32I(LOperand* op); Operand ToOperand32(LOperand* op);
Operand ToOperand32U(LOperand* op);
enum StackMode { kMustUseFramePointer, kCanUseStackPointer }; enum StackMode { kMustUseFramePointer, kCanUseStackPointer };
MemOperand ToMemOperand(LOperand* op, MemOperand ToMemOperand(LOperand* op,
StackMode stack_mode = kCanUseStackPointer) const; StackMode stack_mode = kCanUseStackPointer) const;
Handle<Object> ToHandle(LConstantOperand* op) const; Handle<Object> ToHandle(LConstantOperand* op) const;
template<class LI> template <class LI>
Operand ToShiftedRightOperand32I(LOperand* right, Operand ToShiftedRightOperand32(LOperand* right, LI* shift_info);
LI* shift_info) {
return ToShiftedRightOperand32(right, shift_info, SIGNED_INT32);
}
template<class LI>
Operand ToShiftedRightOperand32U(LOperand* right,
LI* shift_info) {
return ToShiftedRightOperand32(right, shift_info, UNSIGNED_INT32);
}
template<class LI>
Operand ToShiftedRightOperand32(LOperand* right,
LI* shift_info,
IntegerSignedness signedness);
int JSShiftAmountFromLConstant(LOperand* constant) { int JSShiftAmountFromLConstant(LOperand* constant) {
return ToInteger32(LConstantOperand::cast(constant)) & 0x1f; return ToInteger32(LConstantOperand::cast(constant)) & 0x1f;
...@@ -158,8 +144,6 @@ class LCodeGen: public LCodeGenBase { ...@@ -158,8 +144,6 @@ class LCodeGen: public LCodeGenBase {
Register object, Register object,
Register index); Register index);
Operand ToOperand32(LOperand* op, IntegerSignedness signedness);
static Condition TokenToCondition(Token::Value op, bool is_unsigned); static Condition TokenToCondition(Token::Value op, bool is_unsigned);
void EmitGoto(int block); void EmitGoto(int block);
void DoGap(LGap* instr); void DoGap(LGap* 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