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

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

Issue 331803003: Emulate MLS on pre-ARMv6T2. Cleaned up thumbee vs. thumb2 confusion. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleaned up thumbee vs. thumb2 confusion. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | src/cpu.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // Only use statically determined features for cross compile (snapshot). 78 // Only use statically determined features for cross compile (snapshot).
79 if (cross_compile) return; 79 if (cross_compile) return;
80 80
81 #ifndef __arm__ 81 #ifndef __arm__
82 // For the simulator build, use whatever the flags specify. 82 // For the simulator build, use whatever the flags specify.
83 if (FLAG_enable_armv7) { 83 if (FLAG_enable_armv7) {
84 supported_ |= 1u << ARMv7; 84 supported_ |= 1u << ARMv7;
85 if (FLAG_enable_vfp3) supported_ |= 1u << VFP3; 85 if (FLAG_enable_vfp3) supported_ |= 1u << VFP3;
86 if (FLAG_enable_neon) supported_ |= 1u << NEON | 1u << VFP32DREGS; 86 if (FLAG_enable_neon) supported_ |= 1u << NEON | 1u << VFP32DREGS;
87 if (FLAG_enable_sudiv) supported_ |= 1u << SUDIV; 87 if (FLAG_enable_sudiv) supported_ |= 1u << SUDIV;
88 if (FLAG_enable_movw_movt) supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS; 88 if (FLAG_enable_movw_movt) supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS;
89 if (FLAG_enable_32dregs) supported_ |= 1u << VFP32DREGS; 89 if (FLAG_enable_32dregs) supported_ |= 1u << VFP32DREGS;
90 } 90 }
91 if (FLAG_enable_mls) supported_ |= 1u << MLS;
91 if (FLAG_enable_unaligned_accesses) supported_ |= 1u << UNALIGNED_ACCESSES; 92 if (FLAG_enable_unaligned_accesses) supported_ |= 1u << UNALIGNED_ACCESSES;
92 93
93 #else // __arm__ 94 #else // __arm__
94 // Probe for additional features at runtime. 95 // Probe for additional features at runtime.
95 CPU cpu; 96 CPU cpu;
96 if (FLAG_enable_vfp3 && cpu.has_vfp3()) { 97 if (FLAG_enable_vfp3 && cpu.has_vfp3()) {
97 // This implementation also sets the VFP flags if runtime 98 // This implementation also sets the VFP flags if runtime
98 // detection of VFP returns true. VFPv3 implies ARMv7, see ARM DDI 99 // detection of VFP returns true. VFPv3 implies ARMv7, see ARM DDI
99 // 0406B, page A1-6. 100 // 0406B, page A1-6.
100 supported_ |= 1u << VFP3 | 1u << ARMv7; 101 supported_ |= 1u << VFP3 | 1u << ARMv7;
101 } 102 }
102 103
103 if (FLAG_enable_neon && cpu.has_neon()) supported_ |= 1u << NEON; 104 if (FLAG_enable_neon && cpu.has_neon()) supported_ |= 1u << NEON;
104 if (FLAG_enable_sudiv && cpu.has_idiva()) supported_ |= 1u << SUDIV; 105 if (FLAG_enable_sudiv && cpu.has_idiva()) supported_ |= 1u << SUDIV;
106 if (FLAG_enable_mls && cpu.has_thumb2()) supported_ |= 1u << MLS;
105 107
106 if (cpu.architecture() >= 7) { 108 if (cpu.architecture() >= 7) {
107 if (FLAG_enable_armv7) supported_ |= 1u << ARMv7; 109 if (FLAG_enable_armv7) supported_ |= 1u << ARMv7;
108 if (FLAG_enable_unaligned_accesses) supported_ |= 1u << UNALIGNED_ACCESSES; 110 if (FLAG_enable_unaligned_accesses) supported_ |= 1u << UNALIGNED_ACCESSES;
109 // Use movw/movt for QUALCOMM ARMv7 cores. 111 // Use movw/movt for QUALCOMM ARMv7 cores.
110 if (FLAG_enable_movw_movt && cpu.implementer() == CPU::QUALCOMM) { 112 if (FLAG_enable_movw_movt && cpu.implementer() == CPU::QUALCOMM) {
111 supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS; 113 supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS;
112 } 114 }
113 } 115 }
114 116
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 // instruction using the label. 739 // instruction using the label.
738 // 740 //
739 // The linked labels form a link chain by making the branch offset 741 // The linked labels form a link chain by making the branch offset
740 // in the instruction steam to point to the previous branch 742 // in the instruction steam to point to the previous branch
741 // instruction using the same label. 743 // instruction using the same label.
742 // 744 //
743 // The link chain is terminated by a branch offset pointing to the 745 // The link chain is terminated by a branch offset pointing to the
744 // same position. 746 // same position.
745 747
746 748
747 int Assembler::target_at(int pos) { 749 int Assembler::target_at(int pos) {
748 Instr instr = instr_at(pos); 750 Instr instr = instr_at(pos);
749 if (is_uint24(instr)) { 751 if (is_uint24(instr)) {
750 // Emitted link to a label, not part of a branch. 752 // Emitted link to a label, not part of a branch.
751 return instr; 753 return instr;
752 } 754 }
753 ASSERT((instr & 7*B25) == 5*B25); // b, bl, or blx imm24 755 ASSERT((instr & 7*B25) == 5*B25); // b, bl, or blx imm24
754 int imm26 = ((instr & kImm24Mask) << 8) >> 6; 756 int imm26 = ((instr & kImm24Mask) << 8) >> 6;
755 if ((Instruction::ConditionField(instr) == kSpecialCondition) && 757 if ((Instruction::ConditionField(instr) == kSpecialCondition) &&
756 ((instr & B24) != 0)) { 758 ((instr & B24) != 0)) {
757 // blx uses bit 24 to encode bit 2 of imm26 759 // blx uses bit 24 to encode bit 2 of imm26
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 SBit s, Condition cond) { 1476 SBit s, Condition cond) {
1475 ASSERT(!dst.is(pc) && !src1.is(pc) && !src2.is(pc) && !srcA.is(pc)); 1477 ASSERT(!dst.is(pc) && !src1.is(pc) && !src2.is(pc) && !srcA.is(pc));
1476 emit(cond | A | s | dst.code()*B16 | srcA.code()*B12 | 1478 emit(cond | A | s | dst.code()*B16 | srcA.code()*B12 |
1477 src2.code()*B8 | B7 | B4 | src1.code()); 1479 src2.code()*B8 | B7 | B4 | src1.code());
1478 } 1480 }
1479 1481
1480 1482
1481 void Assembler::mls(Register dst, Register src1, Register src2, Register srcA, 1483 void Assembler::mls(Register dst, Register src1, Register src2, Register srcA,
1482 Condition cond) { 1484 Condition cond) {
1483 ASSERT(!dst.is(pc) && !src1.is(pc) && !src2.is(pc) && !srcA.is(pc)); 1485 ASSERT(!dst.is(pc) && !src1.is(pc) && !src2.is(pc) && !srcA.is(pc));
1486 ASSERT(IsEnabled(MLS));
1484 emit(cond | B22 | B21 | dst.code()*B16 | srcA.code()*B12 | 1487 emit(cond | B22 | B21 | dst.code()*B16 | srcA.code()*B12 |
1485 src2.code()*B8 | B7 | B4 | src1.code()); 1488 src2.code()*B8 | B7 | B4 | src1.code());
1486 } 1489 }
1487 1490
1488 1491
1489 void Assembler::sdiv(Register dst, Register src1, Register src2, 1492 void Assembler::sdiv(Register dst, Register src1, Register src2,
1490 Condition cond) { 1493 Condition cond) {
1491 ASSERT(!dst.is(pc) && !src1.is(pc) && !src2.is(pc)); 1494 ASSERT(!dst.is(pc) && !src1.is(pc) && !src2.is(pc));
1492 ASSERT(IsEnabled(SUDIV)); 1495 ASSERT(IsEnabled(SUDIV));
1493 emit(cond | B26 | B25| B24 | B20 | dst.code()*B16 | 0xf * B12 | 1496 emit(cond | B26 | B25| B24 | B20 | dst.code()*B16 | 0xf * B12 |
(...skipping 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after
3661 ASSERT((index_64bit == count_of_64bit_) && 3664 ASSERT((index_64bit == count_of_64bit_) &&
3662 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && 3665 (index_code_ptr == (index_64bit + count_of_code_ptr_)) &&
3663 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && 3666 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) &&
3664 (index_32bit == (index_heap_ptr + count_of_32bit_))); 3667 (index_32bit == (index_heap_ptr + count_of_32bit_)));
3665 } 3668 }
3666 3669
3667 3670
3668 } } // namespace v8::internal 3671 } } // namespace v8::internal
3669 3672
3670 #endif // V8_TARGET_ARCH_ARM 3673 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | src/cpu.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698