From 1cc5f251df558b0e22cea5000626365eb644c727 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Wed, 22 Oct 2014 18:06:21 +0100 Subject: Implement int bit-wise not operation in the optimizing compiler. - Add support for the not-int (integer one's complement negate) instruction in the optimizing compiler. - Extend the HNot control-flow graph node type and make it inherit from HUnaryOperation. - Generate ARM, x86 and x86-64 code for integer HNeg nodes. - Exercise these additions in the codegen_test gtest, as there is not direct way to assess the support of not-int from a Java source. Indeed, compiling a Java expression such as `~a' using javac and then dx generates an xor-int/lit8 Dex instruction instead of the expected not-int Dex instruction. This is probably because the Java bytecode has an `ixor' instruction, but there's not instruction directly corresponding to a bit-wise not operation. Change-Id: I223aed75c4dac5785e04d99da0d22e8d699aee2b --- compiler/optimizing/builder.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/optimizing/builder.cc') diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 4d575cbdcf..f48f4c3990 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -748,6 +748,11 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, uint32 break; } + case Instruction::NOT_INT: { + Unop_12x(instruction, Primitive::kPrimInt); + break; + } + case Instruction::ADD_INT: { Binop_23x(instruction, Primitive::kPrimInt); break; -- cgit v1.2.3-59-g8ed1b