| 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 are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // If the compiler is allowed to use fpu then we can use fpu too in our | 122 // If the compiler is allowed to use fpu then we can use fpu too in our |
| 123 // code generation. | 123 // code generation. |
| 124 #if !defined(__mips__) | 124 #if !defined(__mips__) |
| 125 // For the simulator build, use FPU. | 125 // For the simulator build, use FPU. |
| 126 supported_ |= static_cast<uint64_t>(1) << FPU; | 126 supported_ |= static_cast<uint64_t>(1) << FPU; |
| 127 #else | 127 #else |
| 128 // Probe for additional features not already known to be available. | 128 // Probe for additional features not already known to be available. |
| 129 if (OS::MipsCpuHasFeature(FPU)) { | 129 CPU cpu; |
| 130 if (cpu.has_fpu()) { |
| 130 // This implementation also sets the FPU flags if | 131 // This implementation also sets the FPU flags if |
| 131 // runtime detection of FPU returns true. | 132 // runtime detection of FPU returns true. |
| 132 supported_ |= static_cast<uint64_t>(1) << FPU; | 133 supported_ |= static_cast<uint64_t>(1) << FPU; |
| 133 found_by_runtime_probing_only_ |= static_cast<uint64_t>(1) << FPU; | 134 found_by_runtime_probing_only_ |= static_cast<uint64_t>(1) << FPU; |
| 134 } | 135 } |
| 135 #endif | 136 #endif |
| 136 } | 137 } |
| 137 | 138 |
| 138 | 139 |
| 139 int ToNumber(Register reg) { | 140 int ToNumber(Register reg) { |
| (...skipping 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2196 // 256 MB page. Note that with the jal/j instructions, we do not need to | 2197 // 256 MB page. Note that with the jal/j instructions, we do not need to |
| 2197 // load the register, but that code is left, since it makes it easy to | 2198 // load the register, but that code is left, since it makes it easy to |
| 2198 // revert this process. A further optimization could try replacing the | 2199 // revert this process. A further optimization could try replacing the |
| 2199 // li sequence with nops. | 2200 // li sequence with nops. |
| 2200 // This optimization can only be applied if the rt-code from instr2 is the | 2201 // This optimization can only be applied if the rt-code from instr2 is the |
| 2201 // register used for the jalr/jr. Finally, we have to skip 'jr ra', which is | 2202 // register used for the jalr/jr. Finally, we have to skip 'jr ra', which is |
| 2202 // mips return. Occasionally this lands after an li(). | 2203 // mips return. Occasionally this lands after an li(). |
| 2203 | 2204 |
| 2204 Instr instr3 = instr_at(pc + 2 * kInstrSize); | 2205 Instr instr3 = instr_at(pc + 2 * kInstrSize); |
| 2205 uint32_t ipc = reinterpret_cast<uint32_t>(pc + 3 * kInstrSize); | 2206 uint32_t ipc = reinterpret_cast<uint32_t>(pc + 3 * kInstrSize); |
| 2206 bool in_range = (ipc ^ static_cast<uint32_t>(itarget) >> | 2207 bool in_range = ((ipc ^ itarget) >> (kImm26Bits + kImmFieldShift)) == 0; |
| 2207 (kImm26Bits + kImmFieldShift)) == 0; | |
| 2208 uint32_t target_field = | 2208 uint32_t target_field = |
| 2209 static_cast<uint32_t>(itarget & kJumpAddrMask) >> kImmFieldShift; | 2209 static_cast<uint32_t>(itarget & kJumpAddrMask) >> kImmFieldShift; |
| 2210 bool patched_jump = false; | 2210 bool patched_jump = false; |
| 2211 | 2211 |
| 2212 #ifndef ALLOW_JAL_IN_BOUNDARY_REGION | 2212 #ifndef ALLOW_JAL_IN_BOUNDARY_REGION |
| 2213 // This is a workaround to the 24k core E156 bug (affect some 34k cores also). | 2213 // This is a workaround to the 24k core E156 bug (affect some 34k cores also). |
| 2214 // Since the excluded space is only 64KB out of 256MB (0.02 %), we will just | 2214 // Since the excluded space is only 64KB out of 256MB (0.02 %), we will just |
| 2215 // apply this workaround for all cores so we don't have to identify the core. | 2215 // apply this workaround for all cores so we don't have to identify the core. |
| 2216 if (in_range) { | 2216 if (in_range) { |
| 2217 // The 24k core E156 bug has some very specific requirements, we only check | 2217 // The 24k core E156 bug has some very specific requirements, we only check |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2295 } | 2295 } |
| 2296 | 2296 |
| 2297 if (patched) { | 2297 if (patched) { |
| 2298 CPU::FlushICache(pc+2, sizeof(Address)); | 2298 CPU::FlushICache(pc+2, sizeof(Address)); |
| 2299 } | 2299 } |
| 2300 } | 2300 } |
| 2301 | 2301 |
| 2302 } } // namespace v8::internal | 2302 } } // namespace v8::internal |
| 2303 | 2303 |
| 2304 #endif // V8_TARGET_ARCH_MIPS | 2304 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |