OLD | NEW |
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 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2426 // cond(31-28) | 11101 (27-23)| D=?(22) | 11 (21-20) | 0001 (19-16) | | 2426 // cond(31-28) | 11101 (27-23)| D=?(22) | 11 (21-20) | 0001 (19-16) | |
2427 // Vd(15-12) | 101(11-9) | sz(8)=1 | 11 (7-6) | M(5)=? | 0(4) | Vm(3-0) | 2427 // Vd(15-12) | 101(11-9) | sz(8)=1 | 11 (7-6) | M(5)=? | 0(4) | Vm(3-0) |
2428 ASSERT(CpuFeatures::IsEnabled(VFP2)); | 2428 ASSERT(CpuFeatures::IsEnabled(VFP2)); |
2429 emit(cond | 0xE*B24 | B23 | 0x3*B20 | B16 | | 2429 emit(cond | 0xE*B24 | B23 | 0x3*B20 | B16 | |
2430 dst.code()*B12 | 0x5*B9 | B8 | 3*B6 | src.code()); | 2430 dst.code()*B12 | 0x5*B9 | B8 | 3*B6 | src.code()); |
2431 } | 2431 } |
2432 | 2432 |
2433 | 2433 |
2434 // Pseudo instructions. | 2434 // Pseudo instructions. |
2435 void Assembler::nop(int type) { | 2435 void Assembler::nop(int type) { |
2436 // This is mov rx, rx. | 2436 // ARMv6{K/T2} and v7 have an actual NOP instruction but it serializes |
2437 ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop. | 2437 // some of the CPU's pipeline and has to issue. Older ARM chips simply used |
| 2438 // MOV Rx, Rx as NOP and it performs better even in newer CPUs. |
| 2439 // We therefore use MOV Rx, Rx, even on newer CPUs, and use Rx to encode |
| 2440 // a type. |
| 2441 ASSERT(0 <= type && type <= 14); // mov pc, pc isn't a nop. |
2438 emit(al | 13*B21 | type*B12 | type); | 2442 emit(al | 13*B21 | type*B12 | type); |
2439 } | 2443 } |
2440 | 2444 |
2441 | 2445 |
2442 bool Assembler::IsNop(Instr instr, int type) { | 2446 bool Assembler::IsNop(Instr instr, int type) { |
| 2447 ASSERT(0 <= type && type <= 14); // mov pc, pc isn't a nop. |
2443 // Check for mov rx, rx where x = type. | 2448 // Check for mov rx, rx where x = type. |
2444 ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop. | |
2445 return instr == (al | 13*B21 | type*B12 | type); | 2449 return instr == (al | 13*B21 | type*B12 | type); |
2446 } | 2450 } |
2447 | 2451 |
2448 | 2452 |
2449 bool Assembler::ImmediateFitsAddrMode1Instruction(int32_t imm32) { | 2453 bool Assembler::ImmediateFitsAddrMode1Instruction(int32_t imm32) { |
2450 uint32_t dummy1; | 2454 uint32_t dummy1; |
2451 uint32_t dummy2; | 2455 uint32_t dummy2; |
2452 return fits_shifter(imm32, &dummy1, &dummy2, NULL); | 2456 return fits_shifter(imm32, &dummy1, &dummy2, NULL); |
2453 } | 2457 } |
2454 | 2458 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 | 2717 |
2714 // Since a constant pool was just emitted, move the check offset forward by | 2718 // Since a constant pool was just emitted, move the check offset forward by |
2715 // the standard interval. | 2719 // the standard interval. |
2716 next_buffer_check_ = pc_offset() + kCheckPoolInterval; | 2720 next_buffer_check_ = pc_offset() + kCheckPoolInterval; |
2717 } | 2721 } |
2718 | 2722 |
2719 | 2723 |
2720 } } // namespace v8::internal | 2724 } } // namespace v8::internal |
2721 | 2725 |
2722 #endif // V8_TARGET_ARCH_ARM | 2726 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |