From 63ebbb68631caaf1de0588ece186af4018c33cfd Mon Sep 17 00:00:00 2001 From: buzbee Date: Fri, 3 Aug 2012 14:05:41 -0700 Subject: Quick compiler: fix NOT_LONG codegen The llvm ir-builder converts Not operands into xor w/ -1. Detect and restore original operation on the GBC to LIR path. Change-Id: I219bcdc6b2e3ee8bb6cfea4c0b159deb10207359 --- src/compiler/codegen/MethodBitcode.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/compiler/codegen') diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc index b38ba7759c..8e9f15fa76 100644 --- a/src/compiler/codegen/MethodBitcode.cc +++ b/src/compiler/codegen/MethodBitcode.cc @@ -2363,7 +2363,10 @@ void cvtBinOp(CompilationUnit* cUnit, OpKind op, llvm::Instruction* inst) Instruction::Code dalvikOp = getDalvikOpcode(op, false, rlDest.wide); RegLocation rlSrc2; if (constRhs != NULL) { - DCHECK_EQ(dalvikOp, Instruction::NOT_LONG); + // ir_builder converts NOT_LONG to xor src, -1. Restore + DCHECK_EQ(dalvikOp, Instruction::XOR_LONG); + DCHECK_EQ(-1L, constRhs->getSExtValue()); + dalvikOp = Instruction::NOT_LONG; rlSrc2 = rlSrc1; } else { rlSrc2 = getLoc(cUnit, rhs); -- cgit v1.2.3-59-g8ed1b