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

Side by Side Diff: runtime/vm/assembler_arm.cc

Issue 593363003: Expands the use of Immediate and Operand wrappers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 } 2241 }
2242 2242
2243 2243
2244 void Assembler::MoveRegister(Register rd, Register rm, Condition cond) { 2244 void Assembler::MoveRegister(Register rd, Register rm, Condition cond) {
2245 if (rd != rm) { 2245 if (rd != rm) {
2246 mov(rd, Operand(rm), cond); 2246 mov(rd, Operand(rm), cond);
2247 } 2247 }
2248 } 2248 }
2249 2249
2250 2250
2251 void Assembler::Lsl(Register rd, Register rm, uint32_t shift_imm, 2251 void Assembler::Lsl(Register rd, Register rm, const Operand& shift_imm,
2252 Condition cond) { 2252 Condition cond) {
2253 ASSERT(shift_imm != 0); // Do not use Lsl if no shift is wanted. 2253 ASSERT(shift_imm.type() == 1);
2254 mov(rd, Operand(rm, LSL, shift_imm), cond); 2254 ASSERT(shift_imm.encoding() != 0); // Do not use Lsl if no shift is wanted.
2255 mov(rd, Operand(rm, LSL, shift_imm.encoding()), cond);
2255 } 2256 }
2256 2257
2257 2258
2258 void Assembler::Lsl(Register rd, Register rm, Register rs, Condition cond) { 2259 void Assembler::Lsl(Register rd, Register rm, Register rs, Condition cond) {
2259 mov(rd, Operand(rm, LSL, rs), cond); 2260 mov(rd, Operand(rm, LSL, rs), cond);
2260 } 2261 }
2261 2262
2262 2263
2263 void Assembler::Lsr(Register rd, Register rm, uint32_t shift_imm, 2264 void Assembler::Lsr(Register rd, Register rm, const Operand& shift_imm,
2264 Condition cond) { 2265 Condition cond) {
2265 ASSERT(shift_imm != 0); // Do not use Lsr if no shift is wanted. 2266 ASSERT(shift_imm.type() == 1);
2266 if (shift_imm == 32) shift_imm = 0; // Comply to UAL syntax. 2267 uint32_t shift = shift_imm.encoding();
2267 mov(rd, Operand(rm, LSR, shift_imm), cond); 2268 ASSERT(shift != 0); // Do not use Lsr if no shift is wanted.
2269 if (shift == 32) {
2270 shift = 0; // Comply to UAL syntax.
2271 }
2272 mov(rd, Operand(rm, LSR, shift), cond);
2268 } 2273 }
2269 2274
2270 2275
2271 void Assembler::Lsr(Register rd, Register rm, Register rs, Condition cond) { 2276 void Assembler::Lsr(Register rd, Register rm, Register rs, Condition cond) {
2272 mov(rd, Operand(rm, LSR, rs), cond); 2277 mov(rd, Operand(rm, LSR, rs), cond);
2273 } 2278 }
2274 2279
2275 2280
2276 void Assembler::Asr(Register rd, Register rm, uint32_t shift_imm, 2281 void Assembler::Asr(Register rd, Register rm, const Operand& shift_imm,
2277 Condition cond) { 2282 Condition cond) {
2278 ASSERT(shift_imm != 0); // Do not use Asr if no shift is wanted. 2283 ASSERT(shift_imm.type() == 1);
2279 if (shift_imm == 32) { 2284 uint32_t shift = shift_imm.encoding();
2280 shift_imm = 0; // Comply to UAL syntax. 2285 ASSERT(shift != 0); // Do not use Asr if no shift is wanted.
2286 if (shift == 32) {
2287 shift = 0; // Comply to UAL syntax.
2281 } 2288 }
2282 mov(rd, Operand(rm, ASR, shift_imm), cond); 2289 mov(rd, Operand(rm, ASR, shift), cond);
2283 } 2290 }
2284 2291
2285 2292
2286 void Assembler::Asrs(Register rd, Register rm, uint32_t shift_imm, 2293 void Assembler::Asrs(Register rd, Register rm, const Operand& shift_imm,
2287 Condition cond) { 2294 Condition cond) {
2288 ASSERT(shift_imm != 0); // Do not use Asr if no shift is wanted. 2295 ASSERT(shift_imm.type() == 1);
2289 if (shift_imm == 32) { 2296 uint32_t shift = shift_imm.encoding();
2290 shift_imm = 0; // Comply to UAL syntax. 2297 ASSERT(shift != 0); // Do not use Asr if no shift is wanted.
2298 if (shift == 32) {
2299 shift = 0; // Comply to UAL syntax.
2291 } 2300 }
2292 movs(rd, Operand(rm, ASR, shift_imm), cond); 2301 movs(rd, Operand(rm, ASR, shift), cond);
2293 } 2302 }
2294 2303
2295 2304
2296 void Assembler::Asr(Register rd, Register rm, Register rs, Condition cond) { 2305 void Assembler::Asr(Register rd, Register rm, Register rs, Condition cond) {
2297 mov(rd, Operand(rm, ASR, rs), cond); 2306 mov(rd, Operand(rm, ASR, rs), cond);
2298 } 2307 }
2299 2308
2300 2309
2301 void Assembler::Ror(Register rd, Register rm, uint32_t shift_imm, 2310 void Assembler::Ror(Register rd, Register rm, const Operand& shift_imm,
2302 Condition cond) { 2311 Condition cond) {
2303 ASSERT(shift_imm != 0); // Use Rrx instruction. 2312 ASSERT(shift_imm.type() == 1);
2304 mov(rd, Operand(rm, ROR, shift_imm), cond); 2313 ASSERT(shift_imm.encoding() != 0); // Use Rrx instruction.
2314 mov(rd, Operand(rm, ROR, shift_imm.encoding()), cond);
2305 } 2315 }
2306 2316
2307 2317
2308 void Assembler::Ror(Register rd, Register rm, Register rs, Condition cond) { 2318 void Assembler::Ror(Register rd, Register rm, Register rs, Condition cond) {
2309 mov(rd, Operand(rm, ROR, rs), cond); 2319 mov(rd, Operand(rm, ROR, rs), cond);
2310 } 2320 }
2311 2321
2312 2322
2313 void Assembler::Rrx(Register rd, Register rm, Condition cond) { 2323 void Assembler::Rrx(Register rd, Register rm, Condition cond) {
2314 mov(rd, Operand(rm, ROR, 0), cond); 2324 mov(rd, Operand(rm, ROR, 0), cond);
2315 } 2325 }
2316 2326
2317 2327
2318 void Assembler::SignFill(Register rd, Register rm, Condition cond) { 2328 void Assembler::SignFill(Register rd, Register rm, Condition cond) {
2319 Asr(rd, rm, 31, cond); 2329 Asr(rd, rm, Operand(31), cond);
2320 } 2330 }
2321 2331
2322 2332
2323 void Assembler::Vreciprocalqs(QRegister qd, QRegister qm) { 2333 void Assembler::Vreciprocalqs(QRegister qd, QRegister qm) {
2324 ASSERT(qm != QTMP); 2334 ASSERT(qm != QTMP);
2325 ASSERT(qd != QTMP); 2335 ASSERT(qd != QTMP);
2326 2336
2327 // Reciprocal estimate. 2337 // Reciprocal estimate.
2328 vrecpeqs(qd, qm); 2338 vrecpeqs(qd, qm);
2329 // 2 Newton-Raphson steps. 2339 // 2 Newton-Raphson steps.
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
3399 3409
3400 3410
3401 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3411 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3402 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3412 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3403 return fpu_reg_names[reg]; 3413 return fpu_reg_names[reg];
3404 } 3414 }
3405 3415
3406 } // namespace dart 3416 } // namespace dart
3407 3417
3408 #endif // defined TARGET_ARCH_ARM 3418 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698