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

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

Issue 19560003: [v8-dev] ARM: Make double registers low/high safe (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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
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 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after
2366 // it breaks load locality. 2366 // it breaks load locality.
2367 RecordRelocInfo(imm); 2367 RecordRelocInfo(imm);
2368 vldr(dst, MemOperand(pc, 0)); 2368 vldr(dst, MemOperand(pc, 0));
2369 } else { 2369 } else {
2370 // Synthesise the double from ARM immediates. 2370 // Synthesise the double from ARM immediates.
2371 uint32_t lo, hi; 2371 uint32_t lo, hi;
2372 DoubleAsTwoUInt32(imm, &lo, &hi); 2372 DoubleAsTwoUInt32(imm, &lo, &hi);
2373 2373
2374 if (scratch.is(no_reg)) { 2374 if (scratch.is(no_reg)) {
2375 if (dst.code() < 16) { 2375 if (dst.code() < 16) {
2376 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code());
2376 // Move the low part of the double into the lower of the corresponsing S 2377 // Move the low part of the double into the lower of the corresponsing S
2377 // registers of D register dst. 2378 // registers of D register dst.
2378 mov(ip, Operand(lo)); 2379 mov(ip, Operand(lo));
2379 vmov(dst.low(), ip); 2380 vmov(loc.low(), ip);
2380 2381
2381 // Move the high part of the double into the higher of the 2382 // Move the high part of the double into the higher of the
2382 // corresponsing S registers of D register dst. 2383 // corresponsing S registers of D register dst.
2383 mov(ip, Operand(hi)); 2384 mov(ip, Operand(hi));
2384 vmov(dst.high(), ip); 2385 vmov(loc.high(), ip);
2385 } else { 2386 } else {
2386 // D16-D31 does not have S registers, so move the low and high parts 2387 // D16-D31 does not have S registers, so move the low and high parts
2387 // directly to the D register using vmov.32. 2388 // directly to the D register using vmov.32.
2388 // Note: This may be slower, so we only do this when we have to. 2389 // Note: This may be slower, so we only do this when we have to.
2389 mov(ip, Operand(lo)); 2390 mov(ip, Operand(lo));
2390 vmov(dst, VmovIndexLo, ip); 2391 vmov(dst, VmovIndexLo, ip);
2391 mov(ip, Operand(hi)); 2392 mov(ip, Operand(hi));
2392 vmov(dst, VmovIndexHi, ip); 2393 vmov(dst, VmovIndexHi, ip);
2393 } 2394 }
2394 } else { 2395 } else {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 // cond(31-28) | 1110(27-24) | 0(23) | opc1=0index(22-21) | 0(20) | 2440 // cond(31-28) | 1110(27-24) | 0(23) | opc1=0index(22-21) | 0(20) |
2440 // Vd(19-16) | Rt(15-12) | 1011(11-8) | D(7) | opc2=00(6-5) | 1(4) | 0000(3-0) 2441 // Vd(19-16) | Rt(15-12) | 1011(11-8) | D(7) | opc2=00(6-5) | 1(4) | 0000(3-0)
2441 ASSERT(index.index == 0 || index.index == 1); 2442 ASSERT(index.index == 0 || index.index == 1);
2442 int vd, d; 2443 int vd, d;
2443 dst.split_code(&vd, &d); 2444 dst.split_code(&vd, &d);
2444 emit(cond | 0xE*B24 | index.index*B21 | vd*B16 | src.code()*B12 | 0xB*B8 | 2445 emit(cond | 0xE*B24 | index.index*B21 | vd*B16 | src.code()*B12 | 0xB*B8 |
2445 d*B7 | B4); 2446 d*B7 | B4);
2446 } 2447 }
2447 2448
2448 2449
2450 void Assembler::vmov(const Register dst,
2451 const VmovIndex index,
2452 const DwVfpRegister src,
2453 const Condition cond) {
2454 // Dd[index] = Rt
2455 // Instruction details available in ARM DDI 0406C.b, A8.8.342.
2456 // cond(31-28) | 1110(27-24) | U=0(23) | opc1=0index(22-21) | 1(20) |
2457 // Vn(19-16) | Rt(15-12) | 1011(11-8) | N(7) | opc2=00(6-5) | 1(4) | 0000(3-0)
2458 ASSERT(index.index == 0 || index.index == 1);
2459 int vn, n;
2460 src.split_code(&vn, &n);
2461 emit(cond | 0xE*B24 | index.index*B21 | B20 | vn*B16 | dst.code()*B12 |
2462 0xB*B8 | n*B7 | B4);
2463 }
2464
2465
2449 void Assembler::vmov(const DwVfpRegister dst, 2466 void Assembler::vmov(const DwVfpRegister dst,
2450 const Register src1, 2467 const Register src1,
2451 const Register src2, 2468 const Register src2,
2452 const Condition cond) { 2469 const Condition cond) {
2453 // Dm = <Rt,Rt2>. 2470 // Dm = <Rt,Rt2>.
2454 // Instruction details available in ARM DDI 0406C.b, A8-948. 2471 // Instruction details available in ARM DDI 0406C.b, A8-948.
2455 // cond(31-28) | 1100(27-24)| 010(23-21) | op=0(20) | Rt2(19-16) | 2472 // cond(31-28) | 1100(27-24)| 010(23-21) | op=0(20) | Rt2(19-16) |
2456 // Rt(15-12) | 1011(11-8) | 00(7-6) | M(5) | 1(4) | Vm 2473 // Rt(15-12) | 1011(11-8) | 00(7-6) | M(5) | 1(4) | Vm
2457 ASSERT(!src1.is(pc) && !src2.is(pc)); 2474 ASSERT(!src1.is(pc) && !src2.is(pc));
2458 int vm, m; 2475 int vm, m;
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
3349 3366
3350 // Since a constant pool was just emitted, move the check offset forward by 3367 // Since a constant pool was just emitted, move the check offset forward by
3351 // the standard interval. 3368 // the standard interval.
3352 next_buffer_check_ = pc_offset() + kCheckPoolInterval; 3369 next_buffer_check_ = pc_offset() + kCheckPoolInterval;
3353 } 3370 }
3354 3371
3355 3372
3356 } } // namespace v8::internal 3373 } } // namespace v8::internal
3357 3374
3358 #endif // V8_TARGET_ARCH_ARM 3375 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698