diff options
| author | 2023-08-22 13:42:05 +0000 | |
|---|---|---|
| committer | 2023-08-23 07:09:37 +0000 | |
| commit | 00efa807dbbea45ec7c7da37578a5b97ae3fca8e (patch) | |
| tree | 3a0532b1b5dfe43f2ca74afb5a30a729f91ae482 /compiler | |
| parent | b5e5e93ddaa29b7c82b7a31b700eab07c700e9b2 (diff) | |
riscv64: [codegen] Implement VisitNot
Test: m test-art-host-gtest
Bug: 283082089
Change-Id: I13f717040e474cee43211386ff669d3a5997c280
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/optimizing/code_generator_riscv64.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/compiler/optimizing/code_generator_riscv64.cc b/compiler/optimizing/code_generator_riscv64.cc index 9d74d15ca4..e4160bdddd 100644 --- a/compiler/optimizing/code_generator_riscv64.cc +++ b/compiler/optimizing/code_generator_riscv64.cc @@ -2498,13 +2498,23 @@ void InstructionCodeGeneratorRISCV64::VisitNop(HNop* instruction) { } void LocationsBuilderRISCV64::VisitNot(HNot* instruction) { - UNUSED(instruction); - LOG(FATAL) << "Unimplemented"; + LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction); + locations->SetInAt(0, Location::RequiresRegister()); + locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap); } void InstructionCodeGeneratorRISCV64::VisitNot(HNot* instruction) { - UNUSED(instruction); - LOG(FATAL) << "Unimplemented"; + LocationSummary* locations = instruction->GetLocations(); + switch (instruction->GetResultType()) { + case DataType::Type::kInt32: + case DataType::Type::kInt64: + __ Not(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsRegister<XRegister>()); + break; + + default: + LOG(FATAL) << "Unexpected type for not operation " << instruction->GetResultType(); + UNREACHABLE(); + } } void LocationsBuilderRISCV64::VisitNotEqual(HNotEqual* instruction) { |