diff options
-rw-r--r-- | compiler/optimizing/code_generator_riscv64.h | 1 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics_riscv64.cc | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator_riscv64.h b/compiler/optimizing/code_generator_riscv64.h index 7076af05c1..2f507362d8 100644 --- a/compiler/optimizing/code_generator_riscv64.h +++ b/compiler/optimizing/code_generator_riscv64.h @@ -84,7 +84,6 @@ static constexpr size_t kRuntimeParameterFpuRegistersLength = V(SystemArrayCopyChar) \ V(SystemArrayCopyInt) \ V(SystemArrayCopy) \ - V(ThreadCurrentThread) \ V(FP16Ceil) \ V(FP16Compare) \ V(FP16Floor) \ diff --git a/compiler/optimizing/intrinsics_riscv64.cc b/compiler/optimizing/intrinsics_riscv64.cc index 794c30bb9f..5bddeb0938 100644 --- a/compiler/optimizing/intrinsics_riscv64.cc +++ b/compiler/optimizing/intrinsics_riscv64.cc @@ -1300,6 +1300,19 @@ void VarHandleSlowPathRISCV64::EmitByteArrayViewCode(CodeGenerator* codegen_in) __ J(GetExitLabel()); } +void IntrinsicLocationsBuilderRISCV64::VisitThreadCurrentThread(HInvoke* invoke) { + LocationSummary* locations = + new (allocator_) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified); + locations->SetOut(Location::RequiresRegister()); +} + +void IntrinsicCodeGeneratorRISCV64::VisitThreadCurrentThread(HInvoke* invoke) { + Riscv64Assembler* assembler = GetAssembler(); + XRegister out = invoke->GetLocations()->Out().AsRegister<XRegister>(); + + __ Loadwu(out, TR, Thread::PeerOffset<kRiscv64PointerSize>().Int32Value()); +} + #define MARK_UNIMPLEMENTED(Name) UNIMPLEMENTED_INTRINSIC(RISCV64, Name) UNIMPLEMENTED_INTRINSIC_LIST_RISCV64(MARK_UNIMPLEMENTED); #undef MARK_UNIMPLEMENTED |