2609 tty->print_cr("r17 = 0x%016lx", regs[17]);
2610 tty->print_cr("r18 = 0x%016lx", regs[18]);
2611 tty->print_cr("r19 = 0x%016lx", regs[19]);
2612 tty->print_cr("r20 = 0x%016lx", regs[20]);
2613 tty->print_cr("r21 = 0x%016lx", regs[21]);
2614 tty->print_cr("r22 = 0x%016lx", regs[22]);
2615 tty->print_cr("r23 = 0x%016lx", regs[23]);
2616 tty->print_cr("r24 = 0x%016lx", regs[24]);
2617 tty->print_cr("r25 = 0x%016lx", regs[25]);
2618 tty->print_cr("r26 = 0x%016lx", regs[26]);
2619 tty->print_cr("r27 = 0x%016lx", regs[27]);
2620 tty->print_cr("r28 = 0x%016lx", regs[28]);
2621 tty->print_cr("r30 = 0x%016lx", regs[30]);
2622 tty->print_cr("r31 = 0x%016lx", regs[31]);
2623 BREAKPOINT;
2624 }
2625 }
2626 fatal("DEBUG MESSAGE: %s", msg);
2627 }
2628
2629 void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
2630 int step = 4 * wordSize;
2631 push(RegSet::range(r0, r18) - RegSet::of(rscratch1, rscratch2) - exclude, sp);
2632 sub(sp, sp, step);
2633 mov(rscratch1, -step);
2634 // Push v0-v7, v16-v31.
2635 for (int i = 31; i>= 4; i -= 4) {
2636 if (i <= v7->encoding() || i >= v16->encoding())
2637 st1(as_FloatRegister(i-3), as_FloatRegister(i-2), as_FloatRegister(i-1),
2638 as_FloatRegister(i), T1D, Address(post(sp, rscratch1)));
2639 }
2640 st1(as_FloatRegister(0), as_FloatRegister(1), as_FloatRegister(2),
2641 as_FloatRegister(3), T1D, Address(sp));
2642 }
2643
2644 void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) {
2645 for (int i = 0; i < 32; i += 4) {
2646 if (i <= v7->encoding() || i >= v16->encoding())
2647 ld1(as_FloatRegister(i), as_FloatRegister(i+1), as_FloatRegister(i+2),
2648 as_FloatRegister(i+3), T1D, Address(post(sp, 4 * wordSize)));
2649 }
2650
2651 pop(RegSet::range(r0, r18) - RegSet::of(rscratch1, rscratch2) - exclude, sp);
2652 }
2653
2654 void MacroAssembler::push_CPU_state(bool save_vectors) {
2655 int step = (save_vectors ? 8 : 4) * wordSize;
2656 push(0x3fffffff, sp); // integer registers except lr & sp
2657 mov(rscratch1, -step);
2658 sub(sp, sp, step);
2659 for (int i = 28; i >= 4; i -= 4) {
2660 st1(as_FloatRegister(i), as_FloatRegister(i+1), as_FloatRegister(i+2),
2661 as_FloatRegister(i+3), save_vectors ? T2D : T1D, Address(post(sp, rscratch1)));
2662 }
2663 st1(v0, v1, v2, v3, save_vectors ? T2D : T1D, sp);
2664 }
2665
2666 void MacroAssembler::pop_CPU_state(bool restore_vectors) {
2667 int step = (restore_vectors ? 8 : 4) * wordSize;
2668 for (int i = 0; i <= 28; i += 4)
2669 ld1(as_FloatRegister(i), as_FloatRegister(i+1), as_FloatRegister(i+2),
2670 as_FloatRegister(i+3), restore_vectors ? T2D : T1D, Address(post(sp, step)));
2671 pop(0x3fffffff, sp); // integer registers except lr & sp
|
2609 tty->print_cr("r17 = 0x%016lx", regs[17]);
2610 tty->print_cr("r18 = 0x%016lx", regs[18]);
2611 tty->print_cr("r19 = 0x%016lx", regs[19]);
2612 tty->print_cr("r20 = 0x%016lx", regs[20]);
2613 tty->print_cr("r21 = 0x%016lx", regs[21]);
2614 tty->print_cr("r22 = 0x%016lx", regs[22]);
2615 tty->print_cr("r23 = 0x%016lx", regs[23]);
2616 tty->print_cr("r24 = 0x%016lx", regs[24]);
2617 tty->print_cr("r25 = 0x%016lx", regs[25]);
2618 tty->print_cr("r26 = 0x%016lx", regs[26]);
2619 tty->print_cr("r27 = 0x%016lx", regs[27]);
2620 tty->print_cr("r28 = 0x%016lx", regs[28]);
2621 tty->print_cr("r30 = 0x%016lx", regs[30]);
2622 tty->print_cr("r31 = 0x%016lx", regs[31]);
2623 BREAKPOINT;
2624 }
2625 }
2626 fatal("DEBUG MESSAGE: %s", msg);
2627 }
2628
2629 RegSet MacroAssembler::call_clobbered_registers() {
2630 RegSet regs = RegSet::range(r0, r17) - RegSet::of(rscratch1, rscratch2);
2631 #ifndef _WIN64
2632 regs += r18_tls;
2633 #endif
2634 return regs;
2635 }
2636
2637 void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
2638 int step = 4 * wordSize;
2639 push(call_clobbered_registers() - exclude, sp);
2640 sub(sp, sp, step);
2641 mov(rscratch1, -step);
2642 // Push v0-v7, v16-v31.
2643 for (int i = 31; i>= 4; i -= 4) {
2644 if (i <= v7->encoding() || i >= v16->encoding())
2645 st1(as_FloatRegister(i-3), as_FloatRegister(i-2), as_FloatRegister(i-1),
2646 as_FloatRegister(i), T1D, Address(post(sp, rscratch1)));
2647 }
2648 st1(as_FloatRegister(0), as_FloatRegister(1), as_FloatRegister(2),
2649 as_FloatRegister(3), T1D, Address(sp));
2650 }
2651
2652 void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) {
2653 for (int i = 0; i < 32; i += 4) {
2654 if (i <= v7->encoding() || i >= v16->encoding())
2655 ld1(as_FloatRegister(i), as_FloatRegister(i+1), as_FloatRegister(i+2),
2656 as_FloatRegister(i+3), T1D, Address(post(sp, 4 * wordSize)));
2657 }
2658
2659 pop(call_clobbered_registers() - exclude, sp);
2660 }
2661
2662 void MacroAssembler::push_CPU_state(bool save_vectors) {
2663 int step = (save_vectors ? 8 : 4) * wordSize;
2664 push(0x3fffffff, sp); // integer registers except lr & sp
2665 mov(rscratch1, -step);
2666 sub(sp, sp, step);
2667 for (int i = 28; i >= 4; i -= 4) {
2668 st1(as_FloatRegister(i), as_FloatRegister(i+1), as_FloatRegister(i+2),
2669 as_FloatRegister(i+3), save_vectors ? T2D : T1D, Address(post(sp, rscratch1)));
2670 }
2671 st1(v0, v1, v2, v3, save_vectors ? T2D : T1D, sp);
2672 }
2673
2674 void MacroAssembler::pop_CPU_state(bool restore_vectors) {
2675 int step = (restore_vectors ? 8 : 4) * wordSize;
2676 for (int i = 0; i <= 28; i += 4)
2677 ld1(as_FloatRegister(i), as_FloatRegister(i+1), as_FloatRegister(i+2),
2678 as_FloatRegister(i+3), restore_vectors ? T2D : T1D, Address(post(sp, step)));
2679 pop(0x3fffffff, sp); // integer registers except lr & sp
|