| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Safe default is no features. | 45 // Safe default is no features. |
| 46 unsigned CpuFeatures::supported_ = 0; | 46 unsigned CpuFeatures::supported_ = 0; |
| 47 unsigned CpuFeatures::enabled_ = 0; | 47 unsigned CpuFeatures::enabled_ = 0; |
| 48 unsigned CpuFeatures::found_by_runtime_probing_ = 0; | 48 unsigned CpuFeatures::found_by_runtime_probing_ = 0; |
| 49 | 49 |
| 50 void CpuFeatures::Probe() { | 50 void CpuFeatures::Probe() { |
| 51 // If the compiler is allowed to use vfp then we can use vfp too in our | 51 // If the compiler is allowed to use vfp then we can use vfp too in our |
| 52 // code generation. | 52 // code generation. |
| 53 #if !defined(__arm__) | 53 #if !defined(__arm__) |
| 54 // For the simulator=arm build, always use VFP since the arm simulator has | 54 // For the simulator=arm build, use VFP when FLAG_enable_vfp3 is enabled. |
| 55 // VFP support. | 55 if (FLAG_enable_vfp3) { |
| 56 supported_ |= 1u << VFP3; | 56 supported_ |= 1u << VFP3; |
| 57 } |
| 58 // For the simulator=arm build, use ARMv7 when FLAG_enable_armv7 is enabled |
| 59 if (FLAG_enable_armv7) { |
| 60 supported_ |= 1u << ARMv7; |
| 61 } |
| 57 #else | 62 #else |
| 58 if (Serializer::enabled()) { | 63 if (Serializer::enabled()) { |
| 59 supported_ |= OS::CpuFeaturesImpliedByPlatform(); | 64 supported_ |= OS::CpuFeaturesImpliedByPlatform(); |
| 60 return; // No features if we might serialize. | 65 return; // No features if we might serialize. |
| 61 } | 66 } |
| 62 | 67 |
| 63 if (OS::ArmCpuHasFeature(VFP3)) { | 68 if (OS::ArmCpuHasFeature(VFP3)) { |
| 64 // This implementation also sets the VFP flags if | 69 // This implementation also sets the VFP flags if |
| 65 // runtime detection of VFP returns true. | 70 // runtime detection of VFP returns true. |
| 66 supported_ |= 1u << VFP3; | 71 supported_ |= 1u << VFP3; |
| 67 found_by_runtime_probing_ |= 1u << VFP3; | 72 found_by_runtime_probing_ |= 1u << VFP3; |
| 68 } | 73 } |
| 74 |
| 75 if (OS::ArmCpuHasFeature(ARMv7)) { |
| 76 supported_ |= 1u << ARMv7; |
| 77 found_by_runtime_probing_ |= 1u << ARMv7; |
| 78 } |
| 69 #endif | 79 #endif |
| 70 } | 80 } |
| 71 | 81 |
| 72 | 82 |
| 73 // ----------------------------------------------------------------------------- | 83 // ----------------------------------------------------------------------------- |
| 74 // Implementation of Register and CRegister | 84 // Implementation of Register and CRegister |
| 75 | 85 |
| 76 Register no_reg = { -1 }; | 86 Register no_reg = { -1 }; |
| 77 | 87 |
| 78 Register r0 = { 0 }; | 88 Register r0 = { 0 }; |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 | 853 |
| 844 | 854 |
| 845 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t | 855 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t |
| 846 WriteRecordedPositions(); | 856 WriteRecordedPositions(); |
| 847 ASSERT(!target.is(pc)); // use of pc is actually allowed, but discouraged | 857 ASSERT(!target.is(pc)); // use of pc is actually allowed, but discouraged |
| 848 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | B4 | target.code()); | 858 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | B4 | target.code()); |
| 849 } | 859 } |
| 850 | 860 |
| 851 | 861 |
| 852 // Data-processing instructions | 862 // Data-processing instructions |
| 863 |
| 864 // UBFX <Rd>,<Rn>,#<lsb>,#<width - 1> |
| 865 // Instruction details available in ARM DDI 0406A, A8-464. |
| 866 // cond(31-28) | 01111(27-23)| 1(22) | 1(21) | widthm1(20-16) | |
| 867 // Rd(15-12) | lsb(11-7) | 101(6-4) | Rn(3-0) |
| 868 void Assembler::ubfx(Register dst, Register src1, const Operand& src2, |
| 869 const Operand& src3, Condition cond) { |
| 870 ASSERT(!src2.rm_.is_valid() && !src3.rm_.is_valid()); |
| 871 ASSERT(static_cast<uint32_t>(src2.imm32_) <= 0x1f); |
| 872 ASSERT(static_cast<uint32_t>(src3.imm32_) <= 0x1f); |
| 873 emit(cond | 0x3F*B21 | src3.imm32_*B16 | |
| 874 dst.code()*B12 | src2.imm32_*B7 | 0x5*B4 | src1.code()); |
| 875 } |
| 876 |
| 877 |
| 853 void Assembler::and_(Register dst, Register src1, const Operand& src2, | 878 void Assembler::and_(Register dst, Register src1, const Operand& src2, |
| 854 SBit s, Condition cond) { | 879 SBit s, Condition cond) { |
| 855 addrmod1(cond | 0*B21 | s, src1, dst, src2); | 880 addrmod1(cond | 0*B21 | s, src1, dst, src2); |
| 856 } | 881 } |
| 857 | 882 |
| 858 | 883 |
| 859 void Assembler::eor(Register dst, Register src1, const Operand& src2, | 884 void Assembler::eor(Register dst, Register src1, const Operand& src2, |
| 860 SBit s, Condition cond) { | 885 SBit s, Condition cond) { |
| 861 addrmod1(cond | 1*B21 | s, src1, dst, src2); | 886 addrmod1(cond | 1*B21 | s, src1, dst, src2); |
| 862 } | 887 } |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1842 bind(&after_pool); | 1867 bind(&after_pool); |
| 1843 } | 1868 } |
| 1844 | 1869 |
| 1845 // Since a constant pool was just emitted, move the check offset forward by | 1870 // Since a constant pool was just emitted, move the check offset forward by |
| 1846 // the standard interval. | 1871 // the standard interval. |
| 1847 next_buffer_check_ = pc_offset() + kCheckConstInterval; | 1872 next_buffer_check_ = pc_offset() + kCheckConstInterval; |
| 1848 } | 1873 } |
| 1849 | 1874 |
| 1850 | 1875 |
| 1851 } } // namespace v8::internal | 1876 } } // namespace v8::internal |
| OLD | NEW |