提交 f06b82f4 编写于 作者: I iveresov

6942223: c1 64 bit fixes

Summary: This fixes lir_cmp_l2i on x64 and sparc 64bit, and the debug info generation.
Reviewed-by: never
上级 660cd8f2
...@@ -1728,9 +1728,13 @@ void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Op ...@@ -1728,9 +1728,13 @@ void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Op
ShouldNotReachHere(); ShouldNotReachHere();
} }
} else if (code == lir_cmp_l2i) { } else if (code == lir_cmp_l2i) {
#ifdef _LP64
__ lcmp(left->as_register_lo(), right->as_register_lo(), dst->as_register());
#else
__ lcmp(left->as_register_hi(), left->as_register_lo(), __ lcmp(left->as_register_hi(), left->as_register_lo(),
right->as_register_hi(), right->as_register_lo(), right->as_register_hi(), right->as_register_lo(),
dst->as_register()); dst->as_register());
#endif
} else { } else {
ShouldNotReachHere(); ShouldNotReachHere();
} }
......
...@@ -3365,6 +3365,13 @@ void Assembler::shrdl(Register dst, Register src) { ...@@ -3365,6 +3365,13 @@ void Assembler::shrdl(Register dst, Register src) {
#else // LP64 #else // LP64
void Assembler::set_byte_if_not_zero(Register dst) {
int enc = prefix_and_encode(dst->encoding(), true);
emit_byte(0x0F);
emit_byte(0x95);
emit_byte(0xE0 | enc);
}
// 64bit only pieces of the assembler // 64bit only pieces of the assembler
// This should only be used by 64bit instructions that can use rip-relative // This should only be used by 64bit instructions that can use rip-relative
// it cannot be used by instructions that want an immediate value. // it cannot be used by instructions that want an immediate value.
......
...@@ -2690,19 +2690,14 @@ void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Op ...@@ -2690,19 +2690,14 @@ void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Op
} else { } else {
assert(code == lir_cmp_l2i, "check"); assert(code == lir_cmp_l2i, "check");
#ifdef _LP64 #ifdef _LP64
Register dest = dst->as_register(); Label done;
__ xorptr(dest, dest); Register dest = dst->as_register();
Label high, done; __ cmpptr(left->as_register_lo(), right->as_register_lo());
__ cmpptr(left->as_register_lo(), right->as_register_lo()); __ movl(dest, -1);
__ jcc(Assembler::equal, done); __ jccb(Assembler::less, done);
__ jcc(Assembler::greater, high); __ set_byte_if_not_zero(dest);
__ decrement(dest); __ movzbl(dest, dest);
__ jmp(done); __ bind(done);
__ bind(high);
__ increment(dest);
__ bind(done);
#else #else
__ lcmp2int(left->as_register_hi(), __ lcmp2int(left->as_register_hi(),
left->as_register_lo(), left->as_register_lo(),
......
...@@ -2608,12 +2608,17 @@ int LinearScan::append_scope_value_for_operand(LIR_Opr opr, GrowableArray<ScopeV ...@@ -2608,12 +2608,17 @@ int LinearScan::append_scope_value_for_operand(LIR_Opr opr, GrowableArray<ScopeV
} else if (opr->is_double_xmm()) { } else if (opr->is_double_xmm()) {
assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation"); assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation");
VMReg rname_first = opr->as_xmm_double_reg()->as_VMReg(); VMReg rname_first = opr->as_xmm_double_reg()->as_VMReg();
# ifdef _LP64
first = new LocationValue(Location::new_reg_loc(Location::dbl, rname_first));
second = &_int_0_scope_value;
# else
first = new LocationValue(Location::new_reg_loc(Location::normal, rname_first)); first = new LocationValue(Location::new_reg_loc(Location::normal, rname_first));
// %%% This is probably a waste but we'll keep things as they were for now // %%% This is probably a waste but we'll keep things as they were for now
if (true) { if (true) {
VMReg rname_second = rname_first->next(); VMReg rname_second = rname_first->next();
second = new LocationValue(Location::new_reg_loc(Location::normal, rname_second)); second = new LocationValue(Location::new_reg_loc(Location::normal, rname_second));
} }
# endif
#endif #endif
} else if (opr->is_double_fpu()) { } else if (opr->is_double_fpu()) {
...@@ -2639,13 +2644,17 @@ int LinearScan::append_scope_value_for_operand(LIR_Opr opr, GrowableArray<ScopeV ...@@ -2639,13 +2644,17 @@ int LinearScan::append_scope_value_for_operand(LIR_Opr opr, GrowableArray<ScopeV
#endif #endif
VMReg rname_first = frame_map()->fpu_regname(opr->fpu_regnrHi()); VMReg rname_first = frame_map()->fpu_regname(opr->fpu_regnrHi());
#ifdef _LP64
first = new LocationValue(Location::new_reg_loc(Location::dbl, rname_first));
second = &_int_0_scope_value;
#else
first = new LocationValue(Location::new_reg_loc(Location::normal, rname_first)); first = new LocationValue(Location::new_reg_loc(Location::normal, rname_first));
// %%% This is probably a waste but we'll keep things as they were for now // %%% This is probably a waste but we'll keep things as they were for now
if (true) { if (true) {
VMReg rname_second = rname_first->next(); VMReg rname_second = rname_first->next();
second = new LocationValue(Location::new_reg_loc(Location::normal, rname_second)); second = new LocationValue(Location::new_reg_loc(Location::normal, rname_second));
} }
#endif
} else { } else {
ShouldNotReachHere(); ShouldNotReachHere();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册