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

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

Issue 23072023: MIPS: Fix bug that prevents JALR to JAL optimizations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | no next file » | no next file with comments »
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 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 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 // 256 MB page. Note that with the jal/j instructions, we do not need to 2196 // 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 2197 // 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 2198 // revert this process. A further optimization could try replacing the
2199 // li sequence with nops. 2199 // li sequence with nops.
2200 // This optimization can only be applied if the rt-code from instr2 is the 2200 // 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 2201 // register used for the jalr/jr. Finally, we have to skip 'jr ra', which is
2202 // mips return. Occasionally this lands after an li(). 2202 // mips return. Occasionally this lands after an li().
2203 2203
2204 Instr instr3 = instr_at(pc + 2 * kInstrSize); 2204 Instr instr3 = instr_at(pc + 2 * kInstrSize);
2205 uint32_t ipc = reinterpret_cast<uint32_t>(pc + 3 * kInstrSize); 2205 uint32_t ipc = reinterpret_cast<uint32_t>(pc + 3 * kInstrSize);
2206 bool in_range = (ipc ^ static_cast<uint32_t>(itarget) >> 2206 bool in_range = ((ipc ^ itarget) >> (kImm26Bits + kImmFieldShift)) == 0;
2207 (kImm26Bits + kImmFieldShift)) == 0;
2208 uint32_t target_field = 2207 uint32_t target_field =
2209 static_cast<uint32_t>(itarget & kJumpAddrMask) >> kImmFieldShift; 2208 static_cast<uint32_t>(itarget & kJumpAddrMask) >> kImmFieldShift;
2210 bool patched_jump = false; 2209 bool patched_jump = false;
2211 2210
2212 #ifndef ALLOW_JAL_IN_BOUNDARY_REGION 2211 #ifndef ALLOW_JAL_IN_BOUNDARY_REGION
2213 // This is a workaround to the 24k core E156 bug (affect some 34k cores also). 2212 // 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 2213 // 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. 2214 // apply this workaround for all cores so we don't have to identify the core.
2216 if (in_range) { 2215 if (in_range) {
2217 // The 24k core E156 bug has some very specific requirements, we only check 2216 // 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
2295 } 2294 }
2296 2295
2297 if (patched) { 2296 if (patched) {
2298 CPU::FlushICache(pc+2, sizeof(Address)); 2297 CPU::FlushICache(pc+2, sizeof(Address));
2299 } 2298 }
2300 } 2299 }
2301 2300
2302 } } // namespace v8::internal 2301 } } // namespace v8::internal
2303 2302
2304 #endif // V8_TARGET_ARCH_MIPS 2303 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698