Add long bitwise not instruction in the optimizing compiler.
- Add support for the not-long (long integer one's
complement negation) instruction in the optimizing
compiler.
- Add a 64-bit NOT instruction (notq) to the x86-64
assembler.
- Generate ARM, x86 and x86-64 code for long HNot nodes.
- Gather not-related tests in test/416-optimizing-arith-not.
Change-Id: I2d5b75e9875664d6032d04f8401b2bbb84506948
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index aa0f06b..99fa11d 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -1360,9 +1360,9 @@
void InstructionCodeGeneratorX86::VisitNot(HNot* not_) {
LocationSummary* locations = not_->GetLocations();
- DCHECK_EQ(locations->InAt(0).As<Register>(), locations->Out().As<Register>());
+ Location in = locations->InAt(0);
Location out = locations->Out();
- DCHECK_EQ(locations->InAt(0).As<Register>(), out.As<Register>());
+ DCHECK(in.Equals(out));
switch (not_->InputAt(0)->GetType()) {
case Primitive::kPrimBoolean:
__ xorl(out.As<Register>(), Immediate(1));
@@ -1373,7 +1373,8 @@
break;
case Primitive::kPrimLong:
- LOG(FATAL) << "Not yet implemented type for not operation " << not_->GetResultType();
+ __ notl(out.AsRegisterPairLow<Register>());
+ __ notl(out.AsRegisterPairHigh<Register>());
break;
default: