797 assert(left->is_fpu_register(), "must be");
798 assert(res->is_fpu_register(), "must be");
799 assert(op2->tmp1_opr()->is_fpu_register(), "must be");
800
801 insert_free_if_dead(op2->tmp1_opr());
802 insert_free_if_dead(res, left);
803 insert_exchange(left);
804 do_rename(left, res);
805
806 new_left = to_fpu_stack_top(res);
807 new_res = new_left;
808
809 op2->set_fpu_stack_size(sim()->stack_size());
810 assert(sim()->stack_size() <= 7, "at least one stack slot must be free");
811 break;
812 }
813
814
815 case lir_tan:
816 case lir_sin:
817 case lir_cos:
818 case lir_exp: {
819 // sin, cos and exp need two temporary fpu stack slots, so there are two temporary
820 // registers (stored in right and temp of the operation).
821 // the stack allocator must guarantee that the stack slots are really free,
822 // otherwise there might be a stack overflow.
823 assert(left->is_fpu_register(), "must be");
824 assert(res->is_fpu_register(), "must be");
825 // assert(left->is_last_use(), "old value gets destroyed");
826 assert(right->is_fpu_register(), "right is used as the first temporary register");
827 assert(op2->tmp1_opr()->is_fpu_register(), "temp is used as the second temporary register");
828 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");
829
830 insert_free_if_dead(right);
831 insert_free_if_dead(op2->tmp1_opr());
832
833 insert_free_if_dead(res, left);
834 insert_exchange(left);
835 do_rename(left, res);
836
837 new_left = to_fpu_stack_top(res);
838 new_res = new_left;
|
797 assert(left->is_fpu_register(), "must be");
798 assert(res->is_fpu_register(), "must be");
799 assert(op2->tmp1_opr()->is_fpu_register(), "must be");
800
801 insert_free_if_dead(op2->tmp1_opr());
802 insert_free_if_dead(res, left);
803 insert_exchange(left);
804 do_rename(left, res);
805
806 new_left = to_fpu_stack_top(res);
807 new_res = new_left;
808
809 op2->set_fpu_stack_size(sim()->stack_size());
810 assert(sim()->stack_size() <= 7, "at least one stack slot must be free");
811 break;
812 }
813
814
815 case lir_tan:
816 case lir_sin:
817 case lir_cos: {
818 // sin, cos and exp need two temporary fpu stack slots, so there are two temporary
819 // registers (stored in right and temp of the operation).
820 // the stack allocator must guarantee that the stack slots are really free,
821 // otherwise there might be a stack overflow.
822 assert(left->is_fpu_register(), "must be");
823 assert(res->is_fpu_register(), "must be");
824 // assert(left->is_last_use(), "old value gets destroyed");
825 assert(right->is_fpu_register(), "right is used as the first temporary register");
826 assert(op2->tmp1_opr()->is_fpu_register(), "temp is used as the second temporary register");
827 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");
828
829 insert_free_if_dead(right);
830 insert_free_if_dead(op2->tmp1_opr());
831
832 insert_free_if_dead(res, left);
833 insert_exchange(left);
834 do_rename(left, res);
835
836 new_left = to_fpu_stack_top(res);
837 new_res = new_left;
|