11cb0ef41Sopenharmony_ci// Copyright 2021 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#ifndef V8_CODEGEN_RISCV64_REGISTER_RISCV64_H_ 61cb0ef41Sopenharmony_ci#define V8_CODEGEN_RISCV64_REGISTER_RISCV64_H_ 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci#include "src/codegen/register-base.h" 91cb0ef41Sopenharmony_ci#include "src/codegen/riscv64/constants-riscv64.h" 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_cinamespace v8 { 121cb0ef41Sopenharmony_cinamespace internal { 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci// clang-format off 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci#define GENERAL_REGISTERS(V) \ 171cb0ef41Sopenharmony_ci V(zero_reg) V(ra) V(sp) V(gp) V(tp) V(t0) V(t1) V(t2) \ 181cb0ef41Sopenharmony_ci V(fp) V(s1) V(a0) V(a1) V(a2) V(a3) V(a4) V(a5) \ 191cb0ef41Sopenharmony_ci V(a6) V(a7) V(s2) V(s3) V(s4) V(s5) V(s6) V(s7) V(s8) V(s9) \ 201cb0ef41Sopenharmony_ci V(s10) V(s11) V(t3) V(t4) V(t5) V(t6) 211cb0ef41Sopenharmony_ci 221cb0ef41Sopenharmony_ci// s3: scratch register s4: scratch register 2 used in code-generator-riscv64 231cb0ef41Sopenharmony_ci// s6: roots in Javascript code s7: context register 241cb0ef41Sopenharmony_ci// s11: PtrComprCageBaseRegister 251cb0ef41Sopenharmony_ci// t3 t5 : scratch register used in scratch_register_list 261cb0ef41Sopenharmony_ci// t6 : call reg. 271cb0ef41Sopenharmony_ci// t0 t1 t2 t4:caller saved scratch register can be used in macroassembler and 281cb0ef41Sopenharmony_ci// builtin-riscv64 291cb0ef41Sopenharmony_ci#define ALWAYS_ALLOCATABLE_GENERAL_REGISTERS(V) \ 301cb0ef41Sopenharmony_ci V(a0) V(a1) V(a2) V(a3) \ 311cb0ef41Sopenharmony_ci V(a4) V(a5) V(a6) V(a7) V(t0) \ 321cb0ef41Sopenharmony_ci V(t1) V(t2) V(t4) V(s7) V(s8) V(s9) V(s10) 331cb0ef41Sopenharmony_ci 341cb0ef41Sopenharmony_ci#ifdef V8_COMPRESS_POINTERS_IN_SHARED_CAGE 351cb0ef41Sopenharmony_ci#define MAYBE_ALLOCATABLE_GENERAL_REGISTERS(V) 361cb0ef41Sopenharmony_ci#else 371cb0ef41Sopenharmony_ci#define MAYBE_ALLOCATABLE_GENERAL_REGISTERS(V) V(s11) 381cb0ef41Sopenharmony_ci#endif 391cb0ef41Sopenharmony_ci 401cb0ef41Sopenharmony_ci#define ALLOCATABLE_GENERAL_REGISTERS(V) \ 411cb0ef41Sopenharmony_ci ALWAYS_ALLOCATABLE_GENERAL_REGISTERS(V) \ 421cb0ef41Sopenharmony_ci MAYBE_ALLOCATABLE_GENERAL_REGISTERS(V) 431cb0ef41Sopenharmony_ci 441cb0ef41Sopenharmony_ci#define DOUBLE_REGISTERS(V) \ 451cb0ef41Sopenharmony_ci V(ft0) V(ft1) V(ft2) V(ft3) V(ft4) V(ft5) V(ft6) V(ft7) \ 461cb0ef41Sopenharmony_ci V(fs0) V(fs1) V(fa0) V(fa1) V(fa2) V(fa3) V(fa4) V(fa5) \ 471cb0ef41Sopenharmony_ci V(fa6) V(fa7) V(fs2) V(fs3) V(fs4) V(fs5) V(fs6) V(fs7) \ 481cb0ef41Sopenharmony_ci V(fs8) V(fs9) V(fs10) V(fs11) V(ft8) V(ft9) V(ft10) V(ft11) 491cb0ef41Sopenharmony_ci 501cb0ef41Sopenharmony_ci#define FLOAT_REGISTERS DOUBLE_REGISTERS 511cb0ef41Sopenharmony_ci#define VECTOR_REGISTERS(V) \ 521cb0ef41Sopenharmony_ci V(v0) V(v1) V(v2) V(v3) V(v4) V(v5) V(v6) V(v7) \ 531cb0ef41Sopenharmony_ci V(v8) V(v9) V(v10) V(v11) V(v12) V(v13) V(v14) V(v15) \ 541cb0ef41Sopenharmony_ci V(v16) V(v17) V(v18) V(v19) V(v20) V(v21) V(v22) V(v23) \ 551cb0ef41Sopenharmony_ci V(v24) V(v25) V(v26) V(v27) V(v28) V(v29) V(v30) V(v31) 561cb0ef41Sopenharmony_ci 571cb0ef41Sopenharmony_ci#define ALLOCATABLE_SIMD128_REGISTERS(V) \ 581cb0ef41Sopenharmony_ci V(v1) V(v2) V(v3) V(v4) V(v5) V(v6) V(v7) \ 591cb0ef41Sopenharmony_ci V(v10) V(v11) V(v12) V(v13) V(v14) V(v15) V(v16) \ 601cb0ef41Sopenharmony_ci V(v17) V(v18) V(v19) V(v20) V(v21) V(v22) V(v26) \ 611cb0ef41Sopenharmony_ci V(v27) V(v28) V(v29) V(v30) V(v31) 621cb0ef41Sopenharmony_ci 631cb0ef41Sopenharmony_ci#define ALLOCATABLE_DOUBLE_REGISTERS(V) \ 641cb0ef41Sopenharmony_ci V(ft1) V(ft2) V(ft3) V(ft4) V(ft5) V(ft6) V(ft7) V(ft8) \ 651cb0ef41Sopenharmony_ci V(ft9) V(ft10) V(ft11) V(fa0) V(fa1) V(fa2) V(fa3) V(fa4) V(fa5) \ 661cb0ef41Sopenharmony_ci V(fa6) V(fa7) 671cb0ef41Sopenharmony_ci 681cb0ef41Sopenharmony_ci// Returns the number of padding slots needed for stack pointer alignment. 691cb0ef41Sopenharmony_ciconstexpr int ArgumentPaddingSlots(int argument_count) { 701cb0ef41Sopenharmony_ci // No argument padding required. 711cb0ef41Sopenharmony_ci return 0; 721cb0ef41Sopenharmony_ci} 731cb0ef41Sopenharmony_ci 741cb0ef41Sopenharmony_ci// clang-format on 751cb0ef41Sopenharmony_ci 761cb0ef41Sopenharmony_ci// Note that the bit values must match those used in actual instruction 771cb0ef41Sopenharmony_ci// encoding. 781cb0ef41Sopenharmony_ciconst int kNumRegs = 32; 791cb0ef41Sopenharmony_ci 801cb0ef41Sopenharmony_ciconst int kUndefIndex = -1; 811cb0ef41Sopenharmony_ci// Map with indexes on stack that corresponds to codes of saved registers. 821cb0ef41Sopenharmony_ciconst int kSafepointRegisterStackIndexMap[kNumRegs] = {kUndefIndex, // zero_reg 831cb0ef41Sopenharmony_ci kUndefIndex, // ra 841cb0ef41Sopenharmony_ci kUndefIndex, // sp 851cb0ef41Sopenharmony_ci kUndefIndex, // gp 861cb0ef41Sopenharmony_ci kUndefIndex, // tp 871cb0ef41Sopenharmony_ci 0, // t0 881cb0ef41Sopenharmony_ci 1, // t1 891cb0ef41Sopenharmony_ci 2, // t2 901cb0ef41Sopenharmony_ci 3, // s0/fp 911cb0ef41Sopenharmony_ci 4, // s1 921cb0ef41Sopenharmony_ci 5, // a0 931cb0ef41Sopenharmony_ci 6, // a1 941cb0ef41Sopenharmony_ci 7, // a2 951cb0ef41Sopenharmony_ci 8, // a3 961cb0ef41Sopenharmony_ci 9, // a4 971cb0ef41Sopenharmony_ci 10, // a5 981cb0ef41Sopenharmony_ci 11, // a6 991cb0ef41Sopenharmony_ci 12, // a7 1001cb0ef41Sopenharmony_ci 13, // s2 1011cb0ef41Sopenharmony_ci 14, // s3 1021cb0ef41Sopenharmony_ci 15, // s4 1031cb0ef41Sopenharmony_ci 16, // s5 1041cb0ef41Sopenharmony_ci 17, // s6 1051cb0ef41Sopenharmony_ci 18, // s7 1061cb0ef41Sopenharmony_ci 19, // s8 1071cb0ef41Sopenharmony_ci 10, // s9 1081cb0ef41Sopenharmony_ci 21, // s10 1091cb0ef41Sopenharmony_ci 22, // s11 1101cb0ef41Sopenharmony_ci kUndefIndex, // t3 1111cb0ef41Sopenharmony_ci 23, // t4 1121cb0ef41Sopenharmony_ci kUndefIndex, // t5 1131cb0ef41Sopenharmony_ci kUndefIndex}; // t6 1141cb0ef41Sopenharmony_ci// CPU Registers. 1151cb0ef41Sopenharmony_ci// 1161cb0ef41Sopenharmony_ci// 1) We would prefer to use an enum, but enum values are assignment- 1171cb0ef41Sopenharmony_ci// compatible with int, which has caused code-generation bugs. 1181cb0ef41Sopenharmony_ci// 1191cb0ef41Sopenharmony_ci// 2) We would prefer to use a class instead of a struct but we don't like 1201cb0ef41Sopenharmony_ci// the register initialization to depend on the particular initialization 1211cb0ef41Sopenharmony_ci// order (which appears to be different on OS X, Linux, and Windows for the 1221cb0ef41Sopenharmony_ci// installed versions of C++ we tried). Using a struct permits C-style 1231cb0ef41Sopenharmony_ci// "initialization". Also, the Register objects cannot be const as this 1241cb0ef41Sopenharmony_ci// forces initialization stubs in MSVC, making us dependent on initialization 1251cb0ef41Sopenharmony_ci// order. 1261cb0ef41Sopenharmony_ci// 1271cb0ef41Sopenharmony_ci// 3) By not using an enum, we are possibly preventing the compiler from 1281cb0ef41Sopenharmony_ci// doing certain constant folds, which may significantly reduce the 1291cb0ef41Sopenharmony_ci// code generated for some assembly instructions (because they boil down 1301cb0ef41Sopenharmony_ci// to a few constants). If this is a problem, we could change the code 1311cb0ef41Sopenharmony_ci// such that we use an enum in optimized mode, and the struct in debug 1321cb0ef41Sopenharmony_ci// mode. This way we get the compile-time error checking in debug mode 1331cb0ef41Sopenharmony_ci// and best performance in optimized code. 1341cb0ef41Sopenharmony_ci 1351cb0ef41Sopenharmony_ci// ----------------------------------------------------------------------------- 1361cb0ef41Sopenharmony_ci// Implementation of Register and FPURegister. 1371cb0ef41Sopenharmony_ci 1381cb0ef41Sopenharmony_cienum RegisterCode { 1391cb0ef41Sopenharmony_ci#define REGISTER_CODE(R) kRegCode_##R, 1401cb0ef41Sopenharmony_ci GENERAL_REGISTERS(REGISTER_CODE) 1411cb0ef41Sopenharmony_ci#undef REGISTER_CODE 1421cb0ef41Sopenharmony_ci kRegAfterLast 1431cb0ef41Sopenharmony_ci}; 1441cb0ef41Sopenharmony_ci 1451cb0ef41Sopenharmony_ciclass Register : public RegisterBase<Register, kRegAfterLast> { 1461cb0ef41Sopenharmony_ci public: 1471cb0ef41Sopenharmony_ci#if defined(V8_TARGET_LITTLE_ENDIAN) 1481cb0ef41Sopenharmony_ci static constexpr int kMantissaOffset = 0; 1491cb0ef41Sopenharmony_ci static constexpr int kExponentOffset = 4; 1501cb0ef41Sopenharmony_ci#elif defined(V8_TARGET_BIG_ENDIAN) 1511cb0ef41Sopenharmony_ci static constexpr int kMantissaOffset = 4; 1521cb0ef41Sopenharmony_ci static constexpr int kExponentOffset = 0; 1531cb0ef41Sopenharmony_ci#else 1541cb0ef41Sopenharmony_ci#error Unknown endianness 1551cb0ef41Sopenharmony_ci#endif 1561cb0ef41Sopenharmony_ci 1571cb0ef41Sopenharmony_ci private: 1581cb0ef41Sopenharmony_ci friend class RegisterBase; 1591cb0ef41Sopenharmony_ci explicit constexpr Register(int code) : RegisterBase(code) {} 1601cb0ef41Sopenharmony_ci}; 1611cb0ef41Sopenharmony_ci 1621cb0ef41Sopenharmony_ci// s7: context register 1631cb0ef41Sopenharmony_ci// s3: scratch register 1641cb0ef41Sopenharmony_ci// s4: scratch register 2 1651cb0ef41Sopenharmony_ci#define DECLARE_REGISTER(R) \ 1661cb0ef41Sopenharmony_ci constexpr Register R = Register::from_code(kRegCode_##R); 1671cb0ef41Sopenharmony_ciGENERAL_REGISTERS(DECLARE_REGISTER) 1681cb0ef41Sopenharmony_ci#undef DECLARE_REGISTER 1691cb0ef41Sopenharmony_ci 1701cb0ef41Sopenharmony_ciconstexpr Register no_reg = Register::no_reg(); 1711cb0ef41Sopenharmony_ci 1721cb0ef41Sopenharmony_ciint ToNumber(Register reg); 1731cb0ef41Sopenharmony_ci 1741cb0ef41Sopenharmony_ciRegister ToRegister(int num); 1751cb0ef41Sopenharmony_ci 1761cb0ef41Sopenharmony_ciconstexpr bool kPadArguments = false; 1771cb0ef41Sopenharmony_ciconstexpr AliasingKind kFPAliasing = AliasingKind::kIndependent; 1781cb0ef41Sopenharmony_ciconstexpr bool kSimdMaskRegisters = false; 1791cb0ef41Sopenharmony_ci 1801cb0ef41Sopenharmony_cienum DoubleRegisterCode { 1811cb0ef41Sopenharmony_ci#define REGISTER_CODE(R) kDoubleCode_##R, 1821cb0ef41Sopenharmony_ci DOUBLE_REGISTERS(REGISTER_CODE) 1831cb0ef41Sopenharmony_ci#undef REGISTER_CODE 1841cb0ef41Sopenharmony_ci kDoubleAfterLast 1851cb0ef41Sopenharmony_ci}; 1861cb0ef41Sopenharmony_ci 1871cb0ef41Sopenharmony_cienum VRegisterCode { 1881cb0ef41Sopenharmony_ci#define REGISTER_CODE(R) kVRCode_##R, 1891cb0ef41Sopenharmony_ci VECTOR_REGISTERS(REGISTER_CODE) 1901cb0ef41Sopenharmony_ci#undef REGISTER_CODE 1911cb0ef41Sopenharmony_ci kVRAfterLast 1921cb0ef41Sopenharmony_ci}; 1931cb0ef41Sopenharmony_ciclass VRegister : public RegisterBase<VRegister, kVRAfterLast> { 1941cb0ef41Sopenharmony_ci friend class RegisterBase; 1951cb0ef41Sopenharmony_ci 1961cb0ef41Sopenharmony_ci public: 1971cb0ef41Sopenharmony_ci explicit constexpr VRegister(int code) : RegisterBase(code) {} 1981cb0ef41Sopenharmony_ci}; 1991cb0ef41Sopenharmony_ci 2001cb0ef41Sopenharmony_ci// Coprocessor register. 2011cb0ef41Sopenharmony_ciclass FPURegister : public RegisterBase<FPURegister, kDoubleAfterLast> { 2021cb0ef41Sopenharmony_ci public: 2031cb0ef41Sopenharmony_ci // TODO(plind): Warning, inconsistent numbering here. kNumFPURegisters refers 2041cb0ef41Sopenharmony_ci // to number of 32-bit FPU regs, but kNumAllocatableRegisters refers to 2051cb0ef41Sopenharmony_ci // number of Double regs (64-bit regs, or FPU-reg-pairs). 2061cb0ef41Sopenharmony_ci 2071cb0ef41Sopenharmony_ci FPURegister low() const { 2081cb0ef41Sopenharmony_ci // TODO(plind): Create DCHECK for FR=0 mode. This usage suspect for FR=1. 2091cb0ef41Sopenharmony_ci // Find low reg of a Double-reg pair, which is the reg itself. 2101cb0ef41Sopenharmony_ci return FPURegister::from_code(code()); 2111cb0ef41Sopenharmony_ci } 2121cb0ef41Sopenharmony_ci FPURegister high() const { 2131cb0ef41Sopenharmony_ci // TODO(plind): Create DCHECK for FR=0 mode. This usage illegal in FR=1. 2141cb0ef41Sopenharmony_ci // Find high reg of a Doubel-reg pair, which is reg + 1. 2151cb0ef41Sopenharmony_ci return FPURegister::from_code(code() + 1); 2161cb0ef41Sopenharmony_ci } 2171cb0ef41Sopenharmony_ci 2181cb0ef41Sopenharmony_ci // FIXME(riscv64): In Rvv, Vector regs is different from Float Regs. But in 2191cb0ef41Sopenharmony_ci // this cl, in order to facilitate modification, it is assumed that the vector 2201cb0ef41Sopenharmony_ci // register and floating point register are shared. 2211cb0ef41Sopenharmony_ci VRegister toV() const { 2221cb0ef41Sopenharmony_ci DCHECK(base::IsInRange(static_cast<int>(code()), 0, kVRAfterLast - 1)); 2231cb0ef41Sopenharmony_ci return VRegister(code()); 2241cb0ef41Sopenharmony_ci } 2251cb0ef41Sopenharmony_ci 2261cb0ef41Sopenharmony_ci private: 2271cb0ef41Sopenharmony_ci friend class RegisterBase; 2281cb0ef41Sopenharmony_ci explicit constexpr FPURegister(int code) : RegisterBase(code) {} 2291cb0ef41Sopenharmony_ci}; 2301cb0ef41Sopenharmony_ci 2311cb0ef41Sopenharmony_ci 2321cb0ef41Sopenharmony_ci// A few double registers are reserved: one as a scratch register and one to 2331cb0ef41Sopenharmony_ci// hold 0.0. 2341cb0ef41Sopenharmony_ci// fs9: 0.0 2351cb0ef41Sopenharmony_ci// fs11: scratch register. 2361cb0ef41Sopenharmony_ci 2371cb0ef41Sopenharmony_ci// For O32 ABI, Floats and Doubles refer to same set of 32 32-bit registers. 2381cb0ef41Sopenharmony_ciusing FloatRegister = FPURegister; 2391cb0ef41Sopenharmony_ci 2401cb0ef41Sopenharmony_ciusing DoubleRegister = FPURegister; 2411cb0ef41Sopenharmony_ci 2421cb0ef41Sopenharmony_ciusing Simd128Register = VRegister; 2431cb0ef41Sopenharmony_ci 2441cb0ef41Sopenharmony_ci#define DECLARE_DOUBLE_REGISTER(R) \ 2451cb0ef41Sopenharmony_ci constexpr DoubleRegister R = DoubleRegister::from_code(kDoubleCode_##R); 2461cb0ef41Sopenharmony_ciDOUBLE_REGISTERS(DECLARE_DOUBLE_REGISTER) 2471cb0ef41Sopenharmony_ci#undef DECLARE_DOUBLE_REGISTER 2481cb0ef41Sopenharmony_ci 2491cb0ef41Sopenharmony_ciconstexpr DoubleRegister no_dreg = DoubleRegister::no_reg(); 2501cb0ef41Sopenharmony_ci 2511cb0ef41Sopenharmony_ci#define DECLARE_VECTOR_REGISTER(R) \ 2521cb0ef41Sopenharmony_ci constexpr VRegister R = VRegister::from_code(kVRCode_##R); 2531cb0ef41Sopenharmony_ciVECTOR_REGISTERS(DECLARE_VECTOR_REGISTER) 2541cb0ef41Sopenharmony_ci#undef DECLARE_VECTOR_REGISTER 2551cb0ef41Sopenharmony_ci 2561cb0ef41Sopenharmony_ciconst VRegister no_msareg = VRegister::no_reg(); 2571cb0ef41Sopenharmony_ci 2581cb0ef41Sopenharmony_ci// Register aliases. 2591cb0ef41Sopenharmony_ci// cp is assumed to be a callee saved register. 2601cb0ef41Sopenharmony_ciconstexpr Register kRootRegister = s6; 2611cb0ef41Sopenharmony_ciconstexpr Register cp = s7; 2621cb0ef41Sopenharmony_ciconstexpr Register kScratchReg = s3; 2631cb0ef41Sopenharmony_ciconstexpr Register kScratchReg2 = s4; 2641cb0ef41Sopenharmony_ci 2651cb0ef41Sopenharmony_ciconstexpr DoubleRegister kScratchDoubleReg = ft0; 2661cb0ef41Sopenharmony_ci 2671cb0ef41Sopenharmony_ciconstexpr DoubleRegister kDoubleRegZero = fs9; 2681cb0ef41Sopenharmony_ci 2691cb0ef41Sopenharmony_ci// Define {RegisterName} methods for the register types. 2701cb0ef41Sopenharmony_ciDEFINE_REGISTER_NAMES(Register, GENERAL_REGISTERS) 2711cb0ef41Sopenharmony_ciDEFINE_REGISTER_NAMES(FPURegister, DOUBLE_REGISTERS) 2721cb0ef41Sopenharmony_ciDEFINE_REGISTER_NAMES(VRegister, VECTOR_REGISTERS) 2731cb0ef41Sopenharmony_ci 2741cb0ef41Sopenharmony_ci// Give alias names to registers for calling conventions. 2751cb0ef41Sopenharmony_ciconstexpr Register kReturnRegister0 = a0; 2761cb0ef41Sopenharmony_ciconstexpr Register kReturnRegister1 = a1; 2771cb0ef41Sopenharmony_ciconstexpr Register kReturnRegister2 = a2; 2781cb0ef41Sopenharmony_ciconstexpr Register kJSFunctionRegister = a1; 2791cb0ef41Sopenharmony_ciconstexpr Register kContextRegister = s7; 2801cb0ef41Sopenharmony_ciconstexpr Register kAllocateSizeRegister = a1; 2811cb0ef41Sopenharmony_ciconstexpr Register kInterpreterAccumulatorRegister = a0; 2821cb0ef41Sopenharmony_ciconstexpr Register kInterpreterBytecodeOffsetRegister = t0; 2831cb0ef41Sopenharmony_ciconstexpr Register kInterpreterBytecodeArrayRegister = t1; 2841cb0ef41Sopenharmony_ciconstexpr Register kInterpreterDispatchTableRegister = t2; 2851cb0ef41Sopenharmony_ci 2861cb0ef41Sopenharmony_ciconstexpr Register kJavaScriptCallArgCountRegister = a0; 2871cb0ef41Sopenharmony_ciconstexpr Register kJavaScriptCallCodeStartRegister = a2; 2881cb0ef41Sopenharmony_ciconstexpr Register kJavaScriptCallTargetRegister = kJSFunctionRegister; 2891cb0ef41Sopenharmony_ciconstexpr Register kJavaScriptCallNewTargetRegister = a3; 2901cb0ef41Sopenharmony_ciconstexpr Register kJavaScriptCallExtraArg1Register = a2; 2911cb0ef41Sopenharmony_ci 2921cb0ef41Sopenharmony_ciconstexpr Register kOffHeapTrampolineRegister = t6; 2931cb0ef41Sopenharmony_ciconstexpr Register kRuntimeCallFunctionRegister = a1; 2941cb0ef41Sopenharmony_ciconstexpr Register kRuntimeCallArgCountRegister = a0; 2951cb0ef41Sopenharmony_ciconstexpr Register kRuntimeCallArgvRegister = a2; 2961cb0ef41Sopenharmony_ciconstexpr Register kWasmInstanceRegister = a0; 2971cb0ef41Sopenharmony_ciconstexpr Register kWasmCompileLazyFuncIndexRegister = t0; 2981cb0ef41Sopenharmony_ci 2991cb0ef41Sopenharmony_ciconstexpr DoubleRegister kFPReturnRegister0 = fa0; 3001cb0ef41Sopenharmony_ciconstexpr VRegister kSimd128ScratchReg = v24; 3011cb0ef41Sopenharmony_ciconstexpr VRegister kSimd128ScratchReg2 = v23; 3021cb0ef41Sopenharmony_ciconstexpr VRegister kSimd128ScratchReg3 = v8; 3031cb0ef41Sopenharmony_ciconstexpr VRegister kSimd128RegZero = v25; 3041cb0ef41Sopenharmony_ci 3051cb0ef41Sopenharmony_ci#ifdef V8_COMPRESS_POINTERS_IN_SHARED_CAGE 3061cb0ef41Sopenharmony_ciconstexpr Register kPtrComprCageBaseRegister = s11; // callee save 3071cb0ef41Sopenharmony_ci#else 3081cb0ef41Sopenharmony_ciconstexpr Register kPtrComprCageBaseRegister = kRootRegister; 3091cb0ef41Sopenharmony_ci#endif 3101cb0ef41Sopenharmony_ci 3111cb0ef41Sopenharmony_ci} // namespace internal 3121cb0ef41Sopenharmony_ci} // namespace v8 3131cb0ef41Sopenharmony_ci 3141cb0ef41Sopenharmony_ci#endif // V8_CODEGEN_RISCV64_REGISTER_RISCV64_H_ 315