| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 void MacroAssembler::Move(Register dst, Register src) { | 212 void MacroAssembler::Move(Register dst, Register src) { |
| 213 if (!dst.is(src)) { | 213 if (!dst.is(src)) { |
| 214 mov(dst, src); | 214 mov(dst, src); |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 | 217 |
| 218 | 218 |
| 219 void MacroAssembler::And(Register dst, Register src1, const Operand& src2, | 219 void MacroAssembler::And(Register dst, Register src1, const Operand& src2, |
| 220 Condition cond) { | 220 Condition cond) { |
| 221 if (!CpuFeatures::IsSupported(ARMv7) || src2.is_single_instruction()) { | 221 if (!Isolate::Current()->cpu_features()->IsSupported(ARMv7) || |
| 222 src2.is_single_instruction()) { |
| 222 and_(dst, src1, src2, LeaveCC, cond); | 223 and_(dst, src1, src2, LeaveCC, cond); |
| 223 return; | 224 return; |
| 224 } | 225 } |
| 225 int32_t immediate = src2.immediate(); | 226 int32_t immediate = src2.immediate(); |
| 226 if (immediate == 0) { | 227 if (immediate == 0) { |
| 227 mov(dst, Operand(0), LeaveCC, cond); | 228 mov(dst, Operand(0), LeaveCC, cond); |
| 228 return; | 229 return; |
| 229 } | 230 } |
| 230 if (IsPowerOf2(immediate + 1) && ((immediate & 1) != 0)) { | 231 if (IsPowerOf2(immediate + 1) && ((immediate & 1) != 0)) { |
| 231 ubfx(dst, src1, 0, WhichPowerOf2(immediate + 1), cond); | 232 ubfx(dst, src1, 0, WhichPowerOf2(immediate + 1), cond); |
| 232 return; | 233 return; |
| 233 } | 234 } |
| 234 and_(dst, src1, src2, LeaveCC, cond); | 235 and_(dst, src1, src2, LeaveCC, cond); |
| 235 } | 236 } |
| 236 | 237 |
| 237 | 238 |
| 238 void MacroAssembler::Ubfx(Register dst, Register src1, int lsb, int width, | 239 void MacroAssembler::Ubfx(Register dst, Register src1, int lsb, int width, |
| 239 Condition cond) { | 240 Condition cond) { |
| 240 ASSERT(lsb < 32); | 241 ASSERT(lsb < 32); |
| 241 if (!CpuFeatures::IsSupported(ARMv7)) { | 242 if (!Isolate::Current()->cpu_features()->IsSupported(ARMv7)) { |
| 242 int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1); | 243 int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1); |
| 243 and_(dst, src1, Operand(mask), LeaveCC, cond); | 244 and_(dst, src1, Operand(mask), LeaveCC, cond); |
| 244 if (lsb != 0) { | 245 if (lsb != 0) { |
| 245 mov(dst, Operand(dst, LSR, lsb), LeaveCC, cond); | 246 mov(dst, Operand(dst, LSR, lsb), LeaveCC, cond); |
| 246 } | 247 } |
| 247 } else { | 248 } else { |
| 248 ubfx(dst, src1, lsb, width, cond); | 249 ubfx(dst, src1, lsb, width, cond); |
| 249 } | 250 } |
| 250 } | 251 } |
| 251 | 252 |
| 252 | 253 |
| 253 void MacroAssembler::Sbfx(Register dst, Register src1, int lsb, int width, | 254 void MacroAssembler::Sbfx(Register dst, Register src1, int lsb, int width, |
| 254 Condition cond) { | 255 Condition cond) { |
| 255 ASSERT(lsb < 32); | 256 ASSERT(lsb < 32); |
| 256 if (!CpuFeatures::IsSupported(ARMv7)) { | 257 if (!Isolate::Current()->cpu_features()->IsSupported(ARMv7)) { |
| 257 int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1); | 258 int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1); |
| 258 and_(dst, src1, Operand(mask), LeaveCC, cond); | 259 and_(dst, src1, Operand(mask), LeaveCC, cond); |
| 259 int shift_up = 32 - lsb - width; | 260 int shift_up = 32 - lsb - width; |
| 260 int shift_down = lsb + shift_up; | 261 int shift_down = lsb + shift_up; |
| 261 if (shift_up != 0) { | 262 if (shift_up != 0) { |
| 262 mov(dst, Operand(dst, LSL, shift_up), LeaveCC, cond); | 263 mov(dst, Operand(dst, LSL, shift_up), LeaveCC, cond); |
| 263 } | 264 } |
| 264 if (shift_down != 0) { | 265 if (shift_down != 0) { |
| 265 mov(dst, Operand(dst, ASR, shift_down), LeaveCC, cond); | 266 mov(dst, Operand(dst, ASR, shift_down), LeaveCC, cond); |
| 266 } | 267 } |
| (...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1798 | 1799 |
| 1799 void CodePatcher::Emit(Address addr) { | 1800 void CodePatcher::Emit(Address addr) { |
| 1800 masm()->emit(reinterpret_cast<Instr>(addr)); | 1801 masm()->emit(reinterpret_cast<Instr>(addr)); |
| 1801 } | 1802 } |
| 1802 #endif // ENABLE_DEBUGGER_SUPPORT | 1803 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1803 | 1804 |
| 1804 | 1805 |
| 1805 } } // namespace v8::internal | 1806 } } // namespace v8::internal |
| 1806 | 1807 |
| 1807 #endif // V8_TARGET_ARCH_ARM | 1808 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |