From 2a83e8f06031948741ae3dda3633433ddd669693 Mon Sep 17 00:00:00 2001 From: buzbee Date: Fri, 13 Jul 2012 16:42:30 -0700 Subject: Quick compiler, fix wide bug In Dalvik, 64-bit data items are represented as a pair of 32-bit registers. The Art compiler maintained this notation, while llvm expects properly typed data. During the conversion to bitcode, we must drop the high word of pairs, while correctly typing the low. This CL fixes several bugs related to this. "Placeholder" llvm Values are created only for the low word of pairs, and we now skip Phi node generation for high words. Doing this required a bit of tightening up of the size & type inference code (which previously was able to get away with ignoring high words). Also, I've moved shift operations into intrinics because Dalvik and llvm have different ideas about what a shift means. Bitcode generation is only supported for the Arm target at the moment. With this CL, all target tests pass and the phone boots. Some caveats: o Performance data is not yet meaningful, either compile or run times. o When configured for Quick, we run single-threaded. o In a small percentage of methods, we generate invalid llvm bitcode (missing exception edges). As-checked-in, llvm function generation is turned off to avoid missing edge complaints (to enable testing of the Quick backend). Change-Id: I66932ffb44d299fcaf0a112e0d1c217c49341ccf --- src/compiler/codegen/GenCommon.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/compiler/codegen/GenCommon.cc') diff --git a/src/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc index 9082a49ad3..b4b0f6a9e0 100644 --- a/src/compiler/codegen/GenCommon.cc +++ b/src/compiler/codegen/GenCommon.cc @@ -2062,16 +2062,19 @@ bool genArithOpIntLit(CompilationUnit* cUnit, Instruction::Code opcode, op = kOpXor; break; case Instruction::SHL_INT_LIT8: + case Instruction::SHL_INT: lit &= 31; shiftOp = true; op = kOpLsl; break; case Instruction::SHR_INT_LIT8: + case Instruction::SHR_INT: lit &= 31; shiftOp = true; op = kOpAsr; break; case Instruction::USHR_INT_LIT8: + case Instruction::USHR_INT: lit &= 31; shiftOp = true; op = kOpLsr; -- cgit v1.2.3-59-g8ed1b