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

Side by Side Diff: src/arm/assembler-arm.cc

Issue 5140002: Generate inline code for contextual loads on ARM.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 390 }
391 } 391 }
392 392
393 393
394 void Assembler::CodeTargetAlign() { 394 void Assembler::CodeTargetAlign() {
395 // Preferred alignment of jump targets on some ARM chips. 395 // Preferred alignment of jump targets on some ARM chips.
396 Align(8); 396 Align(8);
397 } 397 }
398 398
399 399
400 bool Assembler::IsNop(Instr instr, int type) { 400 bool Assembler::IsNop(Instr instr, NopMarkerTypes type) {
401 // Check for mov rx, rx. 401 // Check for mov rx, rx.
402 ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop. 402 ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop.
403 return instr == (al | 13*B21 | type*B12 | type); 403 return instr == (al | 13*B21 | type*B12 | type);
404 } 404 }
405 405
406 406
407 bool Assembler::IsBranch(Instr instr) { 407 bool Assembler::IsBranch(Instr instr) {
408 return (instr & (B27 | B25)) == (B27 | B25); 408 return (instr & (B27 | B25)) == (B27 | B25);
409 } 409 }
410 410
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 bool Assembler::IsStrRegFpNegOffset(Instr instr) { 503 bool Assembler::IsStrRegFpNegOffset(Instr instr) {
504 return ((instr & kLdrStrInstrTypeMask) == kStrRegFpNegOffsetPattern); 504 return ((instr & kLdrStrInstrTypeMask) == kStrRegFpNegOffsetPattern);
505 } 505 }
506 506
507 507
508 bool Assembler::IsLdrRegFpNegOffset(Instr instr) { 508 bool Assembler::IsLdrRegFpNegOffset(Instr instr) {
509 return ((instr & kLdrStrInstrTypeMask) == kLdrRegFpNegOffsetPattern); 509 return ((instr & kLdrStrInstrTypeMask) == kLdrRegFpNegOffsetPattern);
510 } 510 }
511 511
512 512
513 bool Assembler::IsLdrPcImmediateOffset(Instr instr) {
514 // Check the instruction is indeed a
515 // ldr<cond> <Rd>, [pc +/- offset_12].
516 return (instr & 0x0f7f0000) == 0x051f0000;
517 }
518
519
513 // Labels refer to positions in the (to be) generated code. 520 // Labels refer to positions in the (to be) generated code.
514 // There are bound, linked, and unused labels. 521 // There are bound, linked, and unused labels.
515 // 522 //
516 // Bound labels refer to known positions in the already 523 // Bound labels refer to known positions in the already
517 // generated code. pos() is the position the label refers to. 524 // generated code. pos() is the position the label refers to.
518 // 525 //
519 // Linked labels refer to unknown positions in the code 526 // Linked labels refer to unknown positions in the code
520 // to be generated; pos() is the position of the last 527 // to be generated; pos() is the position of the last
521 // instruction using the label. 528 // instruction using the label.
522 529
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 SBit s, Condition cond) { 1113 SBit s, Condition cond) {
1107 addrmod1(cond | 12*B21 | s, src1, dst, src2); 1114 addrmod1(cond | 12*B21 | s, src1, dst, src2);
1108 } 1115 }
1109 1116
1110 1117
1111 void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) { 1118 void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) {
1112 if (dst.is(pc)) { 1119 if (dst.is(pc)) {
1113 positions_recorder()->WriteRecordedPositions(); 1120 positions_recorder()->WriteRecordedPositions();
1114 } 1121 }
1115 // Don't allow nop instructions in the form mov rn, rn to be generated using 1122 // Don't allow nop instructions in the form mov rn, rn to be generated using
1116 // the mov instruction. They must be generated using nop(int) 1123 // the mov instruction. They must be generated using nop(NopMarkerTypes) or
1117 // pseudo instructions. 1124 // MarkCode(NopMarkerTypes) pseudo instructions.
1118 ASSERT(!(src.is_reg() && src.rm().is(dst) && s == LeaveCC && cond == al)); 1125 ASSERT(!(src.is_reg() && src.rm().is(dst) && s == LeaveCC && cond == al));
1119 addrmod1(cond | 13*B21 | s, r0, dst, src); 1126 addrmod1(cond | 13*B21 | s, r0, dst, src);
1120 } 1127 }
1121 1128
1122 1129
1123 void Assembler::movw(Register reg, uint32_t immediate, Condition cond) { 1130 void Assembler::movw(Register reg, uint32_t immediate, Condition cond) {
1124 ASSERT(immediate < 0x10000); 1131 ASSERT(immediate < 0x10000);
1125 mov(reg, Operand(immediate), LeaveCC, cond); 1132 mov(reg, Operand(immediate), LeaveCC, cond);
1126 } 1133 }
1127 1134
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
2362 const Condition cond) { 2369 const Condition cond) {
2363 // cond(31-28) | 11101 (27-23)| D=?(22) | 11 (21-20) | 0001 (19-16) | 2370 // cond(31-28) | 11101 (27-23)| D=?(22) | 11 (21-20) | 0001 (19-16) |
2364 // Vd(15-12) | 101(11-9) | sz(8)=1 | 11 (7-6) | M(5)=? | 0(4) | Vm(3-0) 2371 // Vd(15-12) | 101(11-9) | sz(8)=1 | 11 (7-6) | M(5)=? | 0(4) | Vm(3-0)
2365 ASSERT(CpuFeatures::IsEnabled(VFP3)); 2372 ASSERT(CpuFeatures::IsEnabled(VFP3));
2366 emit(cond | 0xE*B24 | B23 | 0x3*B20 | B16 | 2373 emit(cond | 0xE*B24 | B23 | 0x3*B20 | B16 |
2367 dst.code()*B12 | 0x5*B9 | B8 | 3*B6 | src.code()); 2374 dst.code()*B12 | 0x5*B9 | B8 | 3*B6 | src.code());
2368 } 2375 }
2369 2376
2370 2377
2371 // Pseudo instructions. 2378 // Pseudo instructions.
2372 void Assembler::nop(int type) { 2379 void Assembler::nop(NopMarkerTypes type) {
2373 // This is mov rx, rx. 2380 // This is mov rx, rx.
2374 ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop. 2381 ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop.
2375 emit(al | 13*B21 | type*B12 | type); 2382 emit(al | 13*B21 | type*B12 | type);
2376 } 2383 }
2377 2384
2378 2385
2379 bool Assembler::ImmediateFitsAddrMode1Instruction(int32_t imm32) { 2386 bool Assembler::ImmediateFitsAddrMode1Instruction(int32_t imm32) {
2380 uint32_t dummy1; 2387 uint32_t dummy1;
2381 uint32_t dummy2; 2388 uint32_t dummy2;
2382 return fits_shifter(imm32, &dummy1, &dummy2, NULL); 2389 return fits_shifter(imm32, &dummy1, &dummy2, NULL);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 2607
2601 // Since a constant pool was just emitted, move the check offset forward by 2608 // Since a constant pool was just emitted, move the check offset forward by
2602 // the standard interval. 2609 // the standard interval.
2603 next_buffer_check_ = pc_offset() + kCheckConstInterval; 2610 next_buffer_check_ = pc_offset() + kCheckConstInterval;
2604 } 2611 }
2605 2612
2606 2613
2607 } } // namespace v8::internal 2614 } } // namespace v8::internal
2608 2615
2609 #endif // V8_TARGET_ARCH_ARM 2616 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698