Revert "Revert "Implement long negate instruction in the optimizing compiler.""
This reverts commit 30ca3d847fe72cfa33e1b2473100ea2d8bea4517.
Change-Id: I188ca8d460d55d3a9966bcf31e0588575afa77d2
diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc
index 4a05b89..892ca9d 100644
--- a/compiler/optimizing/code_generator_x86_64.cc
+++ b/compiler/optimizing/code_generator_x86_64.cc
@@ -976,11 +976,11 @@
new (GetGraph()->GetArena()) LocationSummary(neg, LocationSummary::kNoCall);
switch (neg->GetResultType()) {
case Primitive::kPrimInt:
+ case Primitive::kPrimLong:
locations->SetInAt(0, Location::RequiresRegister());
locations->SetOut(Location::SameAsFirstInput());
break;
- case Primitive::kPrimLong:
case Primitive::kPrimFloat:
case Primitive::kPrimDouble:
LOG(FATAL) << "Not yet implemented neg type " << neg->GetResultType();
@@ -1002,6 +1002,10 @@
break;
case Primitive::kPrimLong:
+ DCHECK(in.IsRegister());
+ __ negq(out.As<CpuRegister>());
+ break;
+
case Primitive::kPrimFloat:
case Primitive::kPrimDouble:
LOG(FATAL) << "Not yet implemented neg type " << neg->GetResultType();