diff options
author | Roland Levillain <rpl@google.com> | 2014-10-22 18:06:21 +0100 |
---|---|---|
committer | Roland Levillain <rpl@google.com> | 2014-10-23 10:12:06 +0100 |
commit | 1cc5f251df558b0e22cea5000626365eb644c727 (patch) | |
tree | 5e65a32366261646edce02283a185928adba79b5 /compiler/optimizing/builder.cc | |
parent | b08f4dcf90215ed49e0b796ab3e609bd605be8ba (diff) | |
download | art-1cc5f251df558b0e22cea5000626365eb644c727.tar.gz art-1cc5f251df558b0e22cea5000626365eb644c727.tar.bz2 art-1cc5f251df558b0e22cea5000626365eb644c727.zip |
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
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 4d575cbdc..f48f4c399 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<HNot>(instruction, Primitive::kPrimInt); + break; + } + case Instruction::ADD_INT: { Binop_23x<HAdd>(instruction, Primitive::kPrimInt); break; |