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

Unified Diff: src/arm/assembler-arm.cc

Issue 312173002: ARM: Use the shifter operand to merge in previous shift instructions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Ulan's comments Created 6 years, 6 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/arm/assembler-arm.h ('k') | src/arm/constants-arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/assembler-arm.cc
diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc
index c3f9ab0b9b2501997a7f83d154b1607c6fad6ca3..86a2b4e0d6d7e1cf7b9cfecb48a1f8196bdf420d 100644
--- a/src/arm/assembler-arm.cc
+++ b/src/arm/assembler-arm.cc
@@ -283,6 +283,7 @@ Operand::Operand(Handle<Object> handle) {
Operand::Operand(Register rm, ShiftOp shift_op, int shift_imm) {
ASSERT(is_uint5(shift_imm));
+ ASSERT(shift_op != NO_SHIFT);
rm_ = rm;
rs_ = no_reg;
@@ -303,7 +304,7 @@ Operand::Operand(Register rm, ShiftOp shift_op, int shift_imm) {
Operand::Operand(Register rm, ShiftOp shift_op, Register rs) {
- ASSERT(shift_op != RRX);
+ ASSERT((shift_op != RRX) && (shift_op != NO_SHIFT));
rm_ = rm;
rs_ = no_reg;
shift_op_ = shift_op;
@@ -946,16 +947,16 @@ void Assembler::next(Label* L) {
// If this returns true then you have to use the rotate_imm and immed_8
// that it returns, because it may have already changed the instruction
// to match them!
-static bool fits_shifter(uint32_t imm32,
- uint32_t* rotate_imm,
- uint32_t* immed_8,
- Instr* instr) {
+bool fits_shifter(uint32_t imm32,
+ uint32_t* rotate_imm,
+ uint32_t* immed_8,
+ Instr* instr) {
// imm32 must be unsigned.
for (int rot = 0; rot < 16; rot++) {
uint32_t imm8 = (imm32 << 2*rot) | (imm32 >> (32 - 2*rot));
if ((imm8 <= 0xff)) {
- *rotate_imm = rot;
- *immed_8 = imm8;
+ if (rotate_imm != NULL) *rotate_imm = rot;
+ if (immed_8 != NULL) *immed_8 = imm8;
return true;
}
}
@@ -971,7 +972,8 @@ static bool fits_shifter(uint32_t imm32,
if (imm32 < 0x10000) {
*instr ^= kMovwLeaveCCFlip;
*instr |= EncodeMovwImmediate(imm32);
- *rotate_imm = *immed_8 = 0; // Not used for movw.
+ if (rotate_imm != NULL) *rotate_imm = 0; // Not used for movw.
+ if (immed_8 != NULL) *immed_8 = 0; // Not used for movw.
return true;
}
}
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/constants-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698