691 a->fmr(F19, F19); // 28
692
693 // ;; 12
694 a->fmr(F20, F20); // 29
695 a->nop(); // 30
696 a->fmr(F21, F21); // 31
697
698 // ;; 13
699 a->fmr(F22, F22); // 32
700 }
701
702 // -------- sector 32 -------------
703 // ;; 14
704 a->cmpdi(CCR0, R4, unroll); // 33
705 a->bge(CCR0, l2); // 34
706
707 a->blr();
708 uint32_t *code_end = (uint32_t *)a->pc();
709 a->flush();
710
711 double loop1_seconds,loop2_seconds, rel_diff;
712 uint64_t start1, stop1;
713
714 start1 = os::current_thread_cpu_time(false);
715 (*test1)();
716 stop1 = os::current_thread_cpu_time(false);
717 loop1_seconds = (stop1- start1) / (1000 *1000 *1000.0);
718
719
720 start1 = os::current_thread_cpu_time(false);
721 (*test2)();
722 stop1 = os::current_thread_cpu_time(false);
723
724 loop2_seconds = (stop1 - start1) / (1000 *1000 *1000.0);
725
726 rel_diff = (loop2_seconds - loop1_seconds) / loop1_seconds *100;
727
728 if (PrintAssembly) {
729 ttyLocker ttyl;
730 tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
731 Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
732 tty->print_cr("Time loop1 :%f", loop1_seconds);
733 tty->print_cr("Time loop2 :%f", loop2_seconds);
734 tty->print_cr("(time2 - time1) / time1 = %f %%", rel_diff);
735
736 if (rel_diff > 12.0) {
737 tty->print_cr("Section Size 8 Instructions");
738 } else{
739 tty->print_cr("Section Size 32 Instructions or Power5");
740 }
741 }
742
743 #if 0 // TODO: PPC port
744 // Set sector size (if not set explicitly).
745 if (FLAG_IS_DEFAULT(Power6SectorSize128PPC64)) {
746 if (rel_diff > 12.0) {
747 PdScheduling::power6SectorSize = 0x20;
748 } else {
749 PdScheduling::power6SectorSize = 0x80;
750 }
751 } else if (Power6SectorSize128PPC64) {
|
691 a->fmr(F19, F19); // 28
692
693 // ;; 12
694 a->fmr(F20, F20); // 29
695 a->nop(); // 30
696 a->fmr(F21, F21); // 31
697
698 // ;; 13
699 a->fmr(F22, F22); // 32
700 }
701
702 // -------- sector 32 -------------
703 // ;; 14
704 a->cmpdi(CCR0, R4, unroll); // 33
705 a->bge(CCR0, l2); // 34
706
707 a->blr();
708 uint32_t *code_end = (uint32_t *)a->pc();
709 a->flush();
710
711 cb.insts()->set_end((u_char*)code_end);
712
713 double loop1_seconds,loop2_seconds, rel_diff;
714 uint64_t start1, stop1;
715
716 start1 = os::current_thread_cpu_time(false);
717 (*test1)();
718 stop1 = os::current_thread_cpu_time(false);
719 loop1_seconds = (stop1- start1) / (1000 *1000 *1000.0);
720
721
722 start1 = os::current_thread_cpu_time(false);
723 (*test2)();
724 stop1 = os::current_thread_cpu_time(false);
725
726 loop2_seconds = (stop1 - start1) / (1000 *1000 *1000.0);
727
728 rel_diff = (loop2_seconds - loop1_seconds) / loop1_seconds *100;
729
730 if (PrintAssembly || PrintStubCode) {
731 ttyLocker ttyl;
732 tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
733 // Use existing decode function. This enables the [MachCode] format which is needed to DecodeErrorFile.
734 Disassembler::decode(&cb, (u_char*)code, (u_char*)code_end, tty);
735 tty->print_cr("Time loop1 :%f", loop1_seconds);
736 tty->print_cr("Time loop2 :%f", loop2_seconds);
737 tty->print_cr("(time2 - time1) / time1 = %f %%", rel_diff);
738
739 if (rel_diff > 12.0) {
740 tty->print_cr("Section Size 8 Instructions");
741 } else{
742 tty->print_cr("Section Size 32 Instructions or Power5");
743 }
744 }
745
746 #if 0 // TODO: PPC port
747 // Set sector size (if not set explicitly).
748 if (FLAG_IS_DEFAULT(Power6SectorSize128PPC64)) {
749 if (rel_diff > 12.0) {
750 PdScheduling::power6SectorSize = 0x20;
751 } else {
752 PdScheduling::power6SectorSize = 0x80;
753 }
754 } else if (Power6SectorSize128PPC64) {
|