From d7df102ac896de5a477795cd75db3d0ccd81ed35 Mon Sep 17 00:00:00 2001 From: iveresov Date: Tue, 27 Apr 2010 11:19:12 -0700 Subject: [PATCH] 6946892: c1 shouldn't sign-extend to upper 32bits on x64 Summary: c1 does sign-extension when it loads ints and shorts from memory to 64-bit registers. This causes problems for c2 because it relies on the fact the int passed in a 64-bit register is zero-extended. Reviewed-by: never --- src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 966a01d86..6118e79b8 100644 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -1244,8 +1244,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch break; #endif // _L64 case T_INT: - // %%% could this be a movl? this is safer but longer instruction - __ movl2ptr(dest->as_register(), from_addr); + __ movl(dest->as_register(), from_addr); break; case T_LONG: { @@ -1303,7 +1302,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch __ shll(dest_reg, 24); __ sarl(dest_reg, 24); } - // These are unsigned so the zero extension on 64bit is just what we need break; } @@ -1315,8 +1313,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch } else { __ movw(dest_reg, from_addr); } - // This is unsigned so the zero extension on 64bit is just what we need - // __ movl2ptr(dest_reg, dest_reg); break; } @@ -1329,8 +1325,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch __ shll(dest_reg, 16); __ sarl(dest_reg, 16); } - // Might not be needed in 64bit but certainly doesn't hurt (except for code size) - __ movl2ptr(dest_reg, dest_reg); break; } -- GitLab