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

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

Issue 2318553002: [arm] Implement barriers on ARMv6 using CP15. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/disasm-arm.cc » ('j') | 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 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 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 } 2300 }
2301 2301
2302 2302
2303 void Assembler::svc(uint32_t imm24, Condition cond) { 2303 void Assembler::svc(uint32_t imm24, Condition cond) {
2304 DCHECK(is_uint24(imm24)); 2304 DCHECK(is_uint24(imm24));
2305 emit(cond | 15*B24 | imm24); 2305 emit(cond | 15*B24 | imm24);
2306 } 2306 }
2307 2307
2308 2308
2309 void Assembler::dmb(BarrierOption option) { 2309 void Assembler::dmb(BarrierOption option) {
2310 emit(kSpecialCondition | 0x57ff*B12 | 5*B4 | option); 2310 if (CpuFeatures::IsSupported(ARMv7)) {
2311 // Details available in ARM DDI 0406C.b, A8-378.
2312 emit(kSpecialCondition | 0x57ff * B12 | 5 * B4 | option);
2313 } else {
2314 // Details available in ARM DDI 0406C.b, B3-1750.
2315 // CP15DMB: CRn=c7, opc1=0, CRm=c10, opc2=5, Rt is ignored.
2316 mcr(p15, 0, r0, cr7, cr10, 5);
2317 }
2311 } 2318 }
2312 2319
2313 2320
2314 void Assembler::dsb(BarrierOption option) { 2321 void Assembler::dsb(BarrierOption option) {
2315 emit(kSpecialCondition | 0x57ff*B12 | 4*B4 | option); 2322 if (CpuFeatures::IsSupported(ARMv7)) {
2323 // Details available in ARM DDI 0406C.b, A8-380.
2324 emit(kSpecialCondition | 0x57ff * B12 | 4 * B4 | option);
2325 } else {
2326 // Details available in ARM DDI 0406C.b, B3-1750.
2327 // CP15DSB: CRn=c7, opc1=0, CRm=c10, opc2=4, Rt is ignored.
2328 mcr(p15, 0, r0, cr7, cr10, 4);
2329 }
2316 } 2330 }
2317 2331
2318 2332
2319 void Assembler::isb(BarrierOption option) { 2333 void Assembler::isb(BarrierOption option) {
2320 emit(kSpecialCondition | 0x57ff*B12 | 6*B4 | option); 2334 if (CpuFeatures::IsSupported(ARMv7)) {
2335 // Details available in ARM DDI 0406C.b, A8-389.
2336 emit(kSpecialCondition | 0x57ff * B12 | 6 * B4 | option);
2337 } else {
2338 // Details available in ARM DDI 0406C.b, B3-1750.
2339 // CP15ISB: CRn=c7, opc1=0, CRm=c5, opc2=4, Rt is ignored.
2340 mcr(p15, 0, r0, cr7, cr5, 4);
2341 }
2321 } 2342 }
2322 2343
2323 2344
2324 // Coprocessor instructions. 2345 // Coprocessor instructions.
2325 void Assembler::cdp(Coprocessor coproc, 2346 void Assembler::cdp(Coprocessor coproc,
2326 int opcode_1, 2347 int opcode_1,
2327 CRegister crd, 2348 CRegister crd,
2328 CRegister crn, 2349 CRegister crn,
2329 CRegister crm, 2350 CRegister crm,
2330 int opcode_2, 2351 int opcode_2,
(...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after
4366 DCHECK(is_uint12(offset)); 4387 DCHECK(is_uint12(offset));
4367 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 4388 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
4368 } 4389 }
4369 } 4390 }
4370 4391
4371 4392
4372 } // namespace internal 4393 } // namespace internal
4373 } // namespace v8 4394 } // namespace v8
4374 4395
4375 #endif // V8_TARGET_ARCH_ARM 4396 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698