1472N/A * or visit www.oracle.com if you need additional information or have any
1879N/A#include "precompiled.hpp"
1879N/A#include "c1/c1_Instruction.hpp"
1879N/A#include "c1/c1_LinearScan.hpp"
1879N/A#include "utilities/bitMap.inline.hpp"
0N/A if (ComputeExactFPURegisterUsage) {
0N/A create_unhandled_lists(&intervals_in_register, &intervals_in_memory, is_in_fpu_register, NULL);
0N/A for (int i = 0; i < num_blocks; i++) {
0N/A assert(interval->assigned_regHi() == -1, "must not have hi register (doubles stored in one register)");
0N/A if (TraceFPURegisterUsage) {
0N/A if (TraceFPURegisterUsage) {
0N/A tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->print_cr("");
0N/A for (int i = 0; i < num_blocks; i++) {
0N/A if (TraceFPUStack) {
0N/A if (TraceFPUStack) {
0N/A _debug_information_computed = false;
0N/A if (TraceFPUStack) {
0N/A if (!processed_merge) {
0N/A processed_merge = true;
0N/A assert(!required_merge || branch->cond() == lir_cond_always, "splitting of critical edges should prevent FPU stack mismatches at cond branches");
0N/A if (!processed_merge) {
0N/A _debug_information_computed = true;
0N/A if (TraceFPUStack) {
0N/A if (TraceFPUStack) {
0N/A case lir_branch:
0N/A if (TraceFPUStack) {
0N/A LIR_Op1* fxch_op = new LIR_Op1(lir_fxch, LIR_OprFact::intConst(offset), LIR_OprFact::illegalOpr);
0N/A if (TraceFPUStack) {
0N/A tty->print("Exchanged register: %d New state: ", sim()->get_slot(0)); sim()->print(); tty->cr();
0N/A if (TraceFPUStack) {
0N/A if (TraceFPUStack) {
0N/A tty->print("Inserted copy (%d -> %d) New state: ", fpu_num(from), fpu_num(to)); sim()->print(); tty->cr();
0N/A insert_free(0);
0N/A case lir_return: {
0N/A case lir_convert: {
0N/A case lir_roundfp: {
0N/A assert(!left->is_xmm_register() && !right->is_xmm_register() && !res->is_xmm_register(), "not for xmm registers");
0N/A case lir_cmp_fd2i:
0N/A case lir_ucmp_fd2i: {
0N/A case lir_mul_strictfp:
0N/A case lir_div_strictfp: {
3752N/A assert(op2->tmp1_opr()->is_fpu_register(), "strict operations need temporary fpu stack slot");
3752N/A assert(op2->tmp1_opr()->is_fpu_register(), "temp is used as the second temporary register");
3752N/A assert(fpu_num(left) != fpu_num(right) && fpu_num(right) != fpu_num(op2->tmp1_opr()) && fpu_num(op2->tmp1_opr()) != fpu_num(res), "need distinct temp registers");
3752N/A assert(fpu_num(left) != fpu_num(right) && fpu_num(left) != fpu_num(op2->tmp1_opr()) && fpu_num(left) != fpu_num(op2->tmp2_opr()) && fpu_num(left) != fpu_num(res), "need distinct temp registers");
3752N/A assert(fpu_num(right) != fpu_num(op2->tmp1_opr()) && fpu_num(right) != fpu_num(op2->tmp2_opr()) && fpu_num(right) != fpu_num(res), "need distinct temp registers");
3752N/A assert(fpu_num(op2->tmp1_opr()) != fpu_num(op2->tmp2_opr()) && fpu_num(op2->tmp1_opr()) != fpu_num(res), "need distinct temp registers");
0N/A case lir_24bit_FPU:
0N/A case lir_reset_FPU:
0N/A assert(false, "operations not allowed in lir. If one of these operations is needed, check if they have fpu operands");
0N/A case lir_fpop_raw:
0N/A LIR_Op1* move = new LIR_Op1(lir_move, LIR_OprFact::doubleConst(0), LIR_OprFact::double_fpu(reg)->make_fpu_stack_offset());
0N/A if (TraceFPUStack) {
0N/A if (TraceFPUStack) {
0N/A tty->print("Exchanged register: %d New state: ", cur_sim->get_slot(slot)); cur_sim->print(); tty->cr();
0N/A if (TraceFPUStack) {
0N/Abool FpuStackAllocator::merge_rename(FpuStackSim* cur_sim, FpuStackSim* sux_sim, int start_slot, int change_slot) {
0N/A if (TraceFPUStack) {
0N/A tty->print("Renamed register %d to %d New state: ", reg, new_reg); cur_sim->print(); tty->cr();
0N/Avoid FpuStackAllocator::merge_fpu_stack(LIR_List* instrs, FpuStackSim* cur_sim, FpuStackSim* sux_sim) {
0N/A if (TraceFPUStack) {
0N/A // size difference between cur and sux that must be resolved by adding or removing values form the stack
0N/A if (!ComputeExactFPURegisterUsage) {
0N/A assert(cur_sim->stack_size() >= sux_sim->stack_size(), "stack size must be equal or greater now");
0N/A while (size_diff > 0 || (cur_sim->stack_size() > 0 && cur_sim->get_slot(0) != sux_sim->get_slot(0))) {
0N/A assert(cur_sim->stack_size() == 0 || cur_sim->get_slot(0) != reg, "register must have been changed");
0N/A while (finished_slot >= 0 && cur_sim->get_slot(finished_slot) == sux_sim->get_slot(finished_slot)) {
0N/A if (finished_slot >= 0) {
0N/A if (TraceFPUStack) {
0N/Avoid FpuStackAllocator::merge_cleanup_fpu_stack(LIR_List* instrs, FpuStackSim* cur_sim, BitMap& live_fpu_regs) {
0N/A if (TraceFPUStack) {
0N/A if (TraceFPUStack) {
0N/A if (TraceFPUStack) {
0N/A if (ComputeExactFPURegisterUsage) {
0N/A if (TraceFPUStack) {
0N/A for (int i = 0; i < number_of_sux; i++) {
0N/A if (TraceFPUStack) {
0N/A for (int i = 0; i < number_of_sux; i++) {