Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
constants_riscv.h
Go to the documentation of this file.
1// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_CONSTANTS_RISCV_H_
6#define RUNTIME_VM_CONSTANTS_RISCV_H_
7
8#ifndef RUNTIME_VM_CONSTANTS_H_
9#error Do not include constants_riscv.h directly; use constants.h instead.
10#endif
11
12#include <sstream>
13
14#include "platform/assert.h"
15#include "platform/globals.h"
16#include "platform/utils.h"
17
18#include "vm/constants_base.h"
19#include "vm/flags.h"
20
21namespace dart {
22
23DECLARE_FLAG(bool, use_compressed_instructions);
24
25#if defined(TARGET_ARCH_RISCV32)
26typedef uint32_t uintx_t;
27typedef int32_t intx_t;
28constexpr intx_t kMaxIntX = kMaxInt32;
29constexpr uintx_t kMaxUIntX = kMaxUint32;
30constexpr intx_t kMinIntX = kMinInt32;
31#define XLEN 32
32#elif defined(TARGET_ARCH_RISCV64)
33typedef uint64_t uintx_t;
34typedef int64_t intx_t;
35constexpr intx_t kMaxIntX = kMaxInt64;
36constexpr uintx_t kMaxUIntX = kMaxUint64;
37constexpr intx_t kMinIntX = kMinInt64;
38#define XLEN 64
39#else
40#error What XLEN?
41#endif
42
44 // The correct name for this register is ZERO, but this conflicts with other
45 // globals.
46 ZR = 0,
47 RA = 1,
48 SP = 2,
49 GP = 3, // Shadow call stack on Fuchsia and Android
50 TP = 4,
51 T0 = 5,
52 T1 = 6,
53 T2 = 7,
54 FP = 8,
55 S1 = 9, // THR
56 A0 = 10,
57 A1 = 11,
58 A2 = 12, // CODE_REG
59 A3 = 13, // TMP
60 A4 = 14, // TMP2
61 A5 = 15, // PP, untagged
62 A6 = 16,
63 A7 = 17,
64 S2 = 18,
65 S3 = 19,
66 S4 = 20, // ARGS_DESC_REG
67 S5 = 21, // IC_DATA_REG
68 S6 = 22,
69 S7 = 23, // CALLEE_SAVED_TEMP2
70 S8 = 24, // CALLEE_SAVED_TEMP / FAR_TMP
71 S9 = 25, // DISPATCH_TABLE_REG
72 S10 = 26, // nullptr
73 S11 = 27, // WRITE_BARRIER_STATE
74 T3 = 28,
75 T4 = 29,
76 T5 = 30,
77 T6 = 31,
79 kNoRegister = -1,
80
82 S0 = FP,
83
84 // Note that some compressed instructions can only take registers x8-x15 for
85 // some of their operands, so to reduce code size we assign the most popular
86 // uses to these registers.
87
88 // If the base register of a load/store is not SP, both the base register and
89 // source/destination register must be in x8-x15 and the offset must be
90 // aligned to make use a compressed instruction. So either,
91 // - PP, CODE_REG and IC_DATA_REG should all be assigned to x8-x15 and we
92 // should hold PP untagged like on ARM64. This makes the loads in the call
93 // sequence shorter, but adds extra PP tagging/untagging on entry and
94 // return.
95 // - PP should be assigned to a C-preserved register to avoid spilling it on
96 // leaf runtime calls.
97};
98
100 FT0 = 0,
101 FT1 = 1,
102 FT2 = 2,
103 FT3 = 3,
104 FT4 = 4,
105 FT5 = 5,
106 FT6 = 6,
107 FT7 = 7,
108 FS0 = 8,
109 FS1 = 9,
110 FA0 = 10,
111 FA1 = 11,
112 FA2 = 12,
113 FA3 = 13,
114 FA4 = 14,
115 FA5 = 15,
116 FA6 = 16,
117 FA7 = 17,
118 FS2 = 18,
119 FS3 = 19,
120 FS4 = 20,
121 FS5 = 21,
122 FS6 = 22,
123 FS7 = 23,
124 FS8 = 24,
125 FS9 = 25,
126 FS10 = 26,
127 FS11 = 27,
128 FT8 = 28,
129 FT9 = 29,
130 FT10 = 30,
131 FT11 = 31,
133 kNoFpuRegister = -1,
134};
135
136// Register alias for floating point scratch register.
138
139// Architecture independent aliases.
140typedef FRegister FpuRegister;
141const FpuRegister FpuTMP = FTMP;
142const int kFpuRegisterSize = 8;
143typedef double fpu_register_t;
144
145extern const char* const cpu_reg_names[kNumberOfCpuRegisters];
146extern const char* const cpu_reg_abi_names[kNumberOfCpuRegisters];
147extern const char* const fpu_reg_names[kNumberOfFpuRegisters];
148
149// Register aliases.
150constexpr Register TMP = A3; // Used as scratch register by assembler.
151constexpr Register TMP2 = A4;
152constexpr Register FAR_TMP = S8;
153constexpr Register PP = A5; // Caches object pool pointer in generated code.
154constexpr Register DISPATCH_TABLE_REG = S9; // Dispatch table register.
155constexpr Register CODE_REG = A2;
156// Set when calling Dart functions in JIT mode, used by LazyCompileStub.
157constexpr Register FUNCTION_REG = T0;
158constexpr Register FPREG = FP; // Frame pointer register.
159constexpr Register SPREG = SP; // Stack pointer register.
160constexpr Register IC_DATA_REG = S5; // ICData/MegamorphicCache register.
161constexpr Register ARGS_DESC_REG = S4; // Arguments descriptor register.
162constexpr Register THR = S1; // Caches current thread in generated code.
163constexpr Register CALLEE_SAVED_TEMP = S8;
164constexpr Register CALLEE_SAVED_TEMP2 = S7;
166constexpr Register NULL_REG = S10; // Caches NullObject() value.
167#define DART_ASSEMBLER_HAS_NULL_REG 1
168
169// ABI for catch-clause entry point.
172
173// ABI for write barrier stub.
177
178// Common ABI for shared slow path stubs.
179struct SharedSlowPathStubABI {
180 static constexpr Register kResultReg = A0;
181};
182
183// ABI for instantiation stubs.
184struct InstantiationABI {
186 static constexpr Register kInstantiatorTypeArgumentsReg = T2;
187 static constexpr Register kFunctionTypeArgumentsReg = T3;
188 static constexpr Register kResultTypeArgumentsReg = A0;
189 static constexpr Register kResultTypeReg = A0;
190 static constexpr Register kScratchReg = T4;
191};
192
193// Registers in addition to those listed in InstantiationABI used inside the
194// implementation of the InstantiateTypeArguments stubs.
195struct InstantiateTAVInternalRegs {
196 // The set of registers that must be pushed/popped when probing a hash-based
197 // cache due to overlap with the registers in InstantiationABI.
198 static constexpr intptr_t kSavedRegisters = 0;
199
200 // Additional registers used to probe hash-based caches.
201 static constexpr Register kEntryStartReg = S2;
202 static constexpr Register kProbeMaskReg = S3;
203 static constexpr Register kProbeDistanceReg = S4;
204 static constexpr Register kCurrentEntryIndexReg = S5;
205};
206
207// Registers in addition to those listed in TypeTestABI used inside the
208// implementation of type testing stubs that are _not_ preserved.
209struct TTSInternalRegs {
210 static constexpr Register kInstanceTypeArgumentsReg = S2;
211 static constexpr Register kScratchReg = S3;
212 static constexpr Register kSubTypeArgumentReg = S4;
213 static constexpr Register kSuperTypeArgumentReg = S5;
214
215 // Must be pushed/popped whenever generic type arguments are being checked as
216 // they overlap with registers in TypeTestABI.
217 static constexpr intptr_t kSavedTypeArgumentRegisters = 0;
218
219 static constexpr intptr_t kInternalRegisters =
220 ((1 << kInstanceTypeArgumentsReg) | (1 << kScratchReg) |
223};
224
225// Registers in addition to those listed in TypeTestABI used inside the
226// implementation of subtype test cache stubs that are _not_ preserved.
227struct STCInternalRegs {
228 static constexpr Register kInstanceCidOrSignatureReg = S2;
232 static constexpr Register kCacheEntriesEndReg = S6;
233 static constexpr Register kCacheContentsSizeReg = A6;
234 static constexpr Register kProbeDistanceReg = A7;
235
236 static constexpr intptr_t kInternalRegisters =
242 (1 << kProbeDistanceReg);
243};
244
245// Calling convention when calling TypeTestingStub and SubtypeTestCacheStub.
246struct TypeTestABI {
247 static constexpr Register kInstanceReg = A0;
248 static constexpr Register kDstTypeReg = T1;
249 static constexpr Register kInstantiatorTypeArgumentsReg = T2;
250 static constexpr Register kFunctionTypeArgumentsReg = T3;
251 static constexpr Register kSubtypeTestCacheReg = T4;
252 static constexpr Register kScratchReg = T5;
253
254 // For calls to SubtypeNTestCacheStub. Must be distinct from the registers
255 // listed above.
256 static constexpr Register kSubtypeTestCacheResultReg = T0;
257 // For calls to InstanceOfStub.
258 static constexpr Register kInstanceOfResultReg = kInstanceReg;
259
260 static constexpr intptr_t kPreservedAbiRegisters =
261 (1 << kInstanceReg) | (1 << kDstTypeReg) |
263
264 static constexpr intptr_t kNonPreservedAbiRegisters =
267 (1 << kScratchReg) | (1 << kSubtypeTestCacheResultReg) | (1 << CODE_REG);
268
269 static constexpr intptr_t kAbiRegisters =
271};
272
273// Calling convention when calling AssertSubtypeStub.
274struct AssertSubtypeABI {
275 static constexpr Register kSubTypeReg = T1;
276 static constexpr Register kSuperTypeReg = T2;
277 static constexpr Register kInstantiatorTypeArgumentsReg = T3;
278 static constexpr Register kFunctionTypeArgumentsReg = T4;
279 static constexpr Register kDstNameReg = T5;
280
281 static constexpr intptr_t kAbiRegisters =
282 (1 << kSubTypeReg) | (1 << kSuperTypeReg) |
284 (1 << kDstNameReg);
285
286 // No result register, as AssertSubtype is only run for side effect
287 // (throws if the subtype check fails).
288};
289
290// ABI for InitStaticFieldStub.
291struct InitStaticFieldABI {
292 static constexpr Register kFieldReg = T2;
293 static constexpr Register kResultReg = A0;
294};
295
296// Registers used inside the implementation of InitLateStaticFieldStub.
297struct InitLateStaticFieldInternalRegs {
298 static constexpr Register kAddressReg = T3;
299 static constexpr Register kScratchReg = T4;
300};
301
302// ABI for InitInstanceFieldStub.
303struct InitInstanceFieldABI {
304 static constexpr Register kInstanceReg = T1;
305 static constexpr Register kFieldReg = T2;
306 static constexpr Register kResultReg = A0;
307};
308
309// Registers used inside the implementation of InitLateInstanceFieldStub.
310struct InitLateInstanceFieldInternalRegs {
311 static constexpr Register kAddressReg = T3;
312 static constexpr Register kScratchReg = T4;
313};
314
315// ABI for LateInitializationError stubs.
316struct LateInitializationErrorABI {
317 static constexpr Register kFieldReg = T2;
318};
319
320// ABI for ThrowStub.
321struct ThrowABI {
322 static constexpr Register kExceptionReg = A0;
323};
324
325// ABI for ReThrowStub.
326struct ReThrowABI {
327 static constexpr Register kExceptionReg = A0;
328 static constexpr Register kStackTraceReg = A1;
329};
330
331// ABI for AssertBooleanStub.
332struct AssertBooleanABI {
333 static constexpr Register kObjectReg = A0;
334};
335
336// ABI for RangeErrorStub.
337struct RangeErrorABI {
338 static constexpr Register kLengthReg = T1;
339 static constexpr Register kIndexReg = T2;
340};
341
342// ABI for AllocateObjectStub.
343struct AllocateObjectABI {
344 static constexpr Register kResultReg = A0;
345 static constexpr Register kTypeArgumentsReg = A1;
346 static constexpr Register kTagsReg = T2;
347};
348
349// ABI for AllocateClosureStub.
350struct AllocateClosureABI {
352 static constexpr Register kFunctionReg = T1;
353 static constexpr Register kContextReg = T2;
354 static constexpr Register kInstantiatorTypeArgsReg = T3;
355 static constexpr Register kScratchReg = T4;
356};
357
358// ABI for AllocateMintShared*Stub.
359struct AllocateMintABI {
361 static constexpr Register kTempReg = T2;
362};
363
364// ABI for Allocate{Mint,Double,Float32x4,Float64x2}Stub.
365struct AllocateBoxABI {
367 static constexpr Register kTempReg = T2;
368};
369
370// ABI for AllocateArrayStub.
371struct AllocateArrayABI {
373 static constexpr Register kLengthReg = T2;
374 static constexpr Register kTypeArgumentsReg = T1;
375};
376
377// ABI for AllocateRecordStub.
378struct AllocateRecordABI {
380 static constexpr Register kShapeReg = T1;
381 static constexpr Register kTemp1Reg = T2;
382 static constexpr Register kTemp2Reg = T3;
383};
384
385// ABI for AllocateSmallRecordStub (AllocateRecord2, AllocateRecord2Named,
386// AllocateRecord3, AllocateRecord3Named).
387struct AllocateSmallRecordABI {
389 static constexpr Register kShapeReg = T2;
390 static constexpr Register kValue0Reg = T3;
391 static constexpr Register kValue1Reg = T4;
392 static constexpr Register kValue2Reg = A1;
393 static constexpr Register kTempReg = T1;
394};
395
396// ABI for AllocateTypedDataArrayStub.
397struct AllocateTypedDataArrayABI {
399 static constexpr Register kLengthReg = T2;
400};
401
402// ABI for BoxDoubleStub.
403struct BoxDoubleStubABI {
404 static constexpr FpuRegister kValueReg = FA0;
405 static constexpr Register kTempReg = T1;
406 static constexpr Register kResultReg = A0;
407};
408
409// ABI for DoubleToIntegerStub.
410struct DoubleToIntegerStubABI {
411 static constexpr FpuRegister kInputReg = FA0;
412 static constexpr Register kRecognizedKindReg = T1;
413 static constexpr Register kResultReg = A0;
414};
415
416// ABI for SuspendStub (AwaitStub, AwaitWithTypeCheckStub, YieldAsyncStarStub,
417// SuspendSyncStarAtStartStub, SuspendSyncStarAtYieldStub).
418struct SuspendStubABI {
419 static constexpr Register kArgumentReg = A0;
420 static constexpr Register kTypeArgsReg = T0; // Can be the same as kTempReg
421 static constexpr Register kTempReg = T0;
422 static constexpr Register kFrameSizeReg = T1;
423 static constexpr Register kSuspendStateReg = T2;
424 static constexpr Register kFunctionDataReg = T3;
425 static constexpr Register kSrcFrameReg = T4;
426 static constexpr Register kDstFrameReg = T5;
427};
428
429// ABI for InitSuspendableFunctionStub (InitAsyncStub, InitAsyncStarStub,
430// InitSyncStarStub).
431struct InitSuspendableFunctionStubABI {
432 static constexpr Register kTypeArgsReg = A0;
433};
434
435// ABI for ResumeStub
436struct ResumeStubABI {
437 static constexpr Register kSuspendStateReg = T1;
438 static constexpr Register kTempReg = T0;
439 // Registers for the frame copying (the 1st part).
440 static constexpr Register kFrameSizeReg = T2;
441 static constexpr Register kSrcFrameReg = T3;
442 static constexpr Register kDstFrameReg = T4;
443 // Registers for control transfer.
444 // (the 2nd part, can reuse registers from the 1st part)
445 static constexpr Register kResumePcReg = T2;
446 // Can also reuse kSuspendStateReg but should not conflict with CODE_REG/PP.
447 static constexpr Register kExceptionReg = T3;
448 static constexpr Register kStackTraceReg = T4;
449};
450
451// ABI for ReturnStub (ReturnAsyncStub, ReturnAsyncNotFutureStub,
452// ReturnAsyncStarStub).
453struct ReturnStubABI {
454 static constexpr Register kSuspendStateReg = T1;
455};
456
457// ABI for AsyncExceptionHandlerStub.
458struct AsyncExceptionHandlerStubABI {
459 static constexpr Register kSuspendStateReg = T1;
460};
461
462// ABI for CloneSuspendStateStub.
463struct CloneSuspendStateStubABI {
464 static constexpr Register kSourceReg = A0;
465 static constexpr Register kDestinationReg = A1;
466 static constexpr Register kTempReg = T0;
467 static constexpr Register kFrameSizeReg = T1;
468 static constexpr Register kSrcFrameReg = T2;
469 static constexpr Register kDstFrameReg = T3;
470};
471
472// ABI for FfiAsyncCallbackSendStub.
473struct FfiAsyncCallbackSendStubABI {
474 static constexpr Register kArgsReg = A0;
475};
476
477// ABI for DispatchTableNullErrorStub and consequently for all dispatch
478// table calls (though normal functions will not expect or use this
479// register). This ABI is added to distinguish memory corruption errors from
480// null errors.
481struct DispatchTableNullErrorABI {
482 static constexpr Register kClassIdReg = A2;
483};
484
485typedef uint32_t RegList;
486const RegList kAllCpuRegistersList = 0xFFFFFFFF;
487const RegList kAllFpuRegistersList = 0xFFFFFFFF;
488
489#define R(reg) (static_cast<RegList>(1) << (reg))
490
491// C++ ABI call registers.
492
494 R(A0) | R(A1) | R(A2) | R(A3) | R(A4) | R(A5) | R(A6) | R(A7);
496 R(T2) | R(T3) | R(T4) | R(T5) | R(T6) |
497 R(RA);
498constexpr RegList kAbiPreservedCpuRegs = R(S1) | R(S2) | R(S3) | R(S4) | R(S5) |
499 R(S6) | R(S7) | R(S8) | R(S9) |
500 R(S10) | R(S11);
501constexpr int kAbiPreservedCpuRegCount = 11;
502
504 R(ZR) | R(TP) | R(GP) | R(SP) | R(FP) | R(TMP) | R(TMP2) | R(PP) | R(THR) |
506 R(FAR_TMP);
507constexpr intptr_t kNumberOfReservedCpuRegisters =
509// CPU registers available to Dart allocator.
511 kAllCpuRegistersList & ~kReservedCpuRegisters;
512constexpr int kNumberOfDartAvailableCpuRegs =
514// Registers X8-15 (S0-1,A0-5) have more compressed instructions available.
515constexpr int kRegisterAllocationBias = 8;
516// Registers available to Dart that are not preserved by runtime calls.
518 kDartAvailableCpuRegs & ~kAbiPreservedCpuRegs;
519
521 R(FA0) | R(FA1) | R(FA2) | R(FA3) | R(FA4) | R(FA5) | R(FA6) | R(FA7);
523 kAbiArgumentFpuRegs | R(FT0) | R(FT1) | R(FT2) | R(FT3) | R(FT4) | R(FT5) |
524 R(FT6) | R(FT7) | R(FT8) | R(FT9) | R(FT10) | R(FT11);
525constexpr RegList kAbiPreservedFpuRegs = R(FS0) | R(FS1) | R(FS2) | R(FS3) |
526 R(FS4) | R(FS5) | R(FS6) | R(FS7) |
527 R(FS8) | R(FS9) | R(FS10) | R(FS11);
528constexpr int kAbiPreservedFpuRegCount = 12;
529constexpr intptr_t kReservedFpuRegisters = 0;
530constexpr intptr_t kNumberOfReservedFpuRegisters = 0;
531
532constexpr int kStoreBufferWrapperSize = 26;
533
534class CallingConventions {
535 public:
536 static constexpr intptr_t kArgumentRegisters = kAbiArgumentCpuRegs;
537 static const Register ArgumentRegisters[];
538 static constexpr intptr_t kNumArgRegs = 8;
541
542 static const FpuRegister FpuArgumentRegisters[];
543 static constexpr intptr_t kFpuArgumentRegisters =
544 R(FA0) | R(FA1) | R(FA2) | R(FA3) | R(FA4) | R(FA5) | R(FA6) | R(FA7);
545 static constexpr intptr_t kNumFpuArgRegs = 8;
546
547 static constexpr bool kArgumentIntRegXorFpuReg = false;
548
549 static constexpr intptr_t kCalleeSaveCpuRegisters = kAbiPreservedCpuRegs;
550
551 // Whether larger than wordsize arguments are aligned to even registers.
556
557 // How stack arguments are aligned.
562
563 // How fields in compounds are aligned.
565
566 // Whether 1 or 2 byte-sized arguments or return values are passed extended
567 // to 4 bytes.
568#if XLEN == 32
572#else
576#endif
577
578 static constexpr Register kReturnReg = A0;
579 static constexpr Register kSecondReturnReg = A1;
580 static constexpr FpuRegister kReturnFpuReg = FA0;
581
582 // S0=FP, S1=THR
583 static constexpr Register kFfiAnyNonAbiRegister = S2;
584 static constexpr Register kFirstNonArgumentRegister = T0;
585 static constexpr Register kSecondNonArgumentRegister = T1;
586 static constexpr Register kStackPointerRegister = SPREG;
587
591};
592
593// Register based calling convention used for Dart functions.
594//
595// See |compiler::ComputeCallingConvention| for more details.
597 static constexpr Register kCpuRegistersForArgs[] = {kNoRegister};
598 static constexpr FpuRegister kFpuRegistersForArgs[] = {kNoFpuRegister};
599};
600
601// TODO(riscv): Architecture-independent parts of the compiler should use
602// compare-and-branch instead of condition codes.
604 kNoCondition = -1,
605 EQ = 0, // equal
606 NE = 1, // not equal
607 CS = 2, // carry set/unsigned higher or same
608 CC = 3, // carry clear/unsigned lower
609 MI = 4, // minus/negative
610 PL = 5, // plus/positive or zero
611 VS = 6, // overflow
612 VC = 7, // no overflow
613 HI = 8, // unsigned higher
614 LS = 9, // unsigned lower or same
615 GE = 10, // signed greater than or equal
616 LT = 11, // signed less than
617 GT = 12, // signed greater than
618 LE = 13, // signed less than or equal
619 AL = 14, // always (unconditional)
620 NV = 15, // special condition (refer to section C1.2.3)
622
623 // Platform-independent variants declared for all platforms
624 EQUAL = EQ,
625 ZERO = EQUAL,
626 NOT_EQUAL = NE,
628 LESS = LT,
629 LESS_EQUAL = LE,
631 GREATER = GT,
636 OVERFLOW = VS,
637 NO_OVERFLOW = VC,
638
640};
641
643 COMPILE_ASSERT((EQ ^ NE) == 1);
644 COMPILE_ASSERT((CS ^ CC) == 1);
645 COMPILE_ASSERT((MI ^ PL) == 1);
646 COMPILE_ASSERT((VS ^ VC) == 1);
647 COMPILE_ASSERT((HI ^ LS) == 1);
648 COMPILE_ASSERT((GE ^ LT) == 1);
649 COMPILE_ASSERT((GT ^ LE) == 1);
650 COMPILE_ASSERT((AL ^ NV) == 1);
651 ASSERT(c != AL);
653 return static_cast<Condition>(c ^ 1);
654}
655
657 TIMES_1 = 0,
658 TIMES_2 = 1,
659 TIMES_4 = 2,
660 TIMES_8 = 3,
661 TIMES_16 = 4,
662// We can't include vm/compiler/runtime_api.h, so just be explicit instead
663// of using (dart::)kWordSizeLog2.
664#if defined(TARGET_ARCH_IS_64_BIT)
665 // Used for Smi-boxed indices.
666 TIMES_HALF_WORD_SIZE = kInt64SizeLog2 - 1,
667 // Used for unboxed indices.
668 TIMES_WORD_SIZE = kInt64SizeLog2,
669#elif defined(TARGET_ARCH_IS_32_BIT)
670 // Used for Smi-boxed indices.
671 TIMES_HALF_WORD_SIZE = kInt32SizeLog2 - 1,
672 // Used for unboxed indices.
673 TIMES_WORD_SIZE = kInt32SizeLog2,
674#else
675#error "Unexpected word size"
676#endif
677#if !defined(DART_COMPRESSED_POINTERS)
678 TIMES_COMPRESSED_WORD_SIZE = TIMES_WORD_SIZE,
679#else
680 TIMES_COMPRESSED_WORD_SIZE = TIMES_HALF_WORD_SIZE,
681#endif
682 // Used for Smi-boxed indices.
684};
685
686const uword kBreakInstructionFiller = 0; // trap or c.trap
687
688inline int32_t SignExtend(int N, int32_t value) {
689 return static_cast<int32_t>(static_cast<uint32_t>(value) << (32 - N)) >>
690 (32 - N);
691}
692
693inline intx_t sign_extend(int32_t x) {
694 return static_cast<intx_t>(x);
695}
696inline intx_t sign_extend(int64_t x) {
697 return static_cast<intx_t>(x);
698}
699inline intx_t sign_extend(uint32_t x) {
700 return static_cast<intx_t>(static_cast<int32_t>(x));
701}
702inline intx_t sign_extend(uint64_t x) {
703 return static_cast<intx_t>(static_cast<int64_t>(x));
704}
705
706enum Opcode {
707 LUI = 0b0110111,
708 AUIPC = 0b0010111,
709 JAL = 0b1101111,
710 JALR = 0b1100111,
711 BRANCH = 0b1100011,
712 LOAD = 0b0000011,
713 STORE = 0b0100011,
714 OPIMM = 0b0010011,
715 OP = 0b0110011,
716 MISCMEM = 0b0001111,
717 SYSTEM = 0b1110011,
718 OP32 = 0b0111011,
719 OPIMM32 = 0b0011011,
720 AMO = 0b0101111,
721 LOADFP = 0b0000111,
722 STOREFP = 0b0100111,
723 FMADD = 0b1000011,
724 FMSUB = 0b1000111,
725 FNMSUB = 0b1001011,
726 FNMADD = 0b1001111,
727 OPFP = 0b1010011,
728};
729
731 ECALL = 0,
733};
734
735enum Funct3 {
736 F3_0 = 0,
737 F3_1 = 1,
738
739 BEQ = 0b000,
740 BNE = 0b001,
741 BLT = 0b100,
742 BGE = 0b101,
743 BLTU = 0b110,
744 BGEU = 0b111,
745
746 LB = 0b000,
747 LH = 0b001,
748 LW = 0b010,
749 LBU = 0b100,
750 LHU = 0b101,
751 LWU = 0b110,
752 LD = 0b011,
753
754 SB = 0b000,
755 SH = 0b001,
756 SW = 0b010,
757 SD = 0b011,
758
759 ADDI = 0b000,
760 SLLI = 0b001,
761 SLTI = 0b010,
762 SLTIU = 0b011,
763 XORI = 0b100,
764 SRI = 0b101,
765 ORI = 0b110,
766 ANDI = 0b111,
767
768 ADD = 0b000,
769 SLL = 0b001,
770 SLT = 0b010,
771 SLTU = 0b011,
772 XOR = 0b100,
773 SR = 0b101,
774 OR = 0b110,
775 AND = 0b111,
776
777 FENCE = 0b000,
778 FENCEI = 0b001,
779
780 CSRRW = 0b001,
781 CSRRS = 0b010,
782 CSRRC = 0b011,
783 CSRRWI = 0b101,
784 CSRRSI = 0b110,
785 CSRRCI = 0b111,
786
787 MUL = 0b000,
788 MULH = 0b001,
789 MULHSU = 0b010,
790 MULHU = 0b011,
791 DIV = 0b100,
792 DIVU = 0b101,
793 REM = 0b110,
794 REMU = 0b111,
795
796 MULW = 0b000,
797 DIVW = 0b100,
798 DIVUW = 0b101,
799 REMW = 0b110,
800 REMUW = 0b111,
801
802 WIDTH32 = 0b010,
803 WIDTH64 = 0b011,
804
805 S = 0b010,
806 D = 0b011,
807 J = 0b000,
808 JN = 0b001,
809 JX = 0b010,
810 FMIN = 0b000,
811 FMAX = 0b001,
812 FEQ = 0b010,
813 FLT = 0b001,
814 FLE = 0b000,
815
816 SH1ADD = 0b010,
817 SH2ADD = 0b100,
818 SH3ADD = 0b110,
819
820 F3_COUNT = 0b001,
821
822 MAX = 0b110,
823 MAXU = 0b111,
824 MIN = 0b100,
825 MINU = 0b101,
826 CLMUL = 0b001,
827 CLMULH = 0b011,
828 CLMULR = 0b010,
829
830 SEXT = 0b001,
831 ZEXT = 0b100,
832
833 ROL = 0b001,
834 ROR = 0b101,
835
836 BCLR = 0b001,
837 BEXT = 0b101,
838 F3_BINV = 0b001,
839 F3_BSET = 0b001,
840};
841
842enum Funct7 {
843 F7_0 = 0,
844 SRA = 0b0100000,
845 SUB = 0b0100000,
846 MULDIV = 0b0000001,
847
848 FADDS = 0b0000000,
849 FSUBS = 0b0000100,
850 FMULS = 0b0001000,
851 FDIVS = 0b0001100,
852 FSQRTS = 0b0101100,
853 FSGNJS = 0b0010000,
854 FMINMAXS = 0b0010100,
855 FCMPS = 0b1010000,
856 FCLASSS = 0b1110000,
857 FCVTintS = 0b1100000,
858 FCVTSint = 0b1101000,
859 FMVXW = 0b1110000,
860 FMVWX = 0b1111000,
861
862 FADDD = 0b0000001,
863 FSUBD = 0b0000101,
864 FMULD = 0b0001001,
865 FDIVD = 0b0001101,
866 FSQRTD = 0b0101101,
867 FSGNJD = 0b0010001,
868 FMINMAXD = 0b0010101,
869 FCVTS = 0b0100000,
870 FCVTD = 0b0100001,
871 FCMPD = 0b1010001,
872 FCLASSD = 0b1110001,
873 FCVTintD = 0b1100001,
874 FCVTDint = 0b1101001,
875 FMVXD = 0b1110001,
876 FMVDX = 0b1111001,
877
878 ADDUW = 0b0000100,
879 SHADD = 0b0010000,
880 SLLIUW = 0b0000100,
881 COUNT = 0b0110000,
882 MINMAXCLMUL = 0b0000101,
883 ROTATE = 0b0110000,
884 BCLRBEXT = 0b0100100,
885 BINV = 0b0110100,
886 BSET = 0b0010100,
887};
888
889enum Funct5 {
890 LR = 0b00010,
891 SC = 0b00011,
892 AMOSWAP = 0b00001,
893 AMOADD = 0b00000,
894 AMOXOR = 0b00100,
895 AMOAND = 0b01100,
896 AMOOR = 0b01000,
897 AMOMIN = 0b10000,
898 AMOMAX = 0b10100,
899 AMOMINU = 0b11000,
900 AMOMAXU = 0b11100,
901};
902
903enum Funct2 {
904 F2_S = 0b00,
905 F2_D = 0b01,
906};
907
909 RNE = 0b000, // Round to Nearest, ties to Even
910 RTZ = 0b001, // Round toward Zero
911 RDN = 0b010, // Round Down (toward negative infinity)
912 RUP = 0b011, // Round Up (toward positive infinity)
913 RMM = 0b100, // Round to nearest, ties to Max Magnitude
914 DYN = 0b111, // Dynamic rounding mode
915};
916
918 W = 0b00000,
919 WU = 0b00001,
920 L = 0b00010,
921 LU = 0b00011,
922};
923
936
938 kWrite = 1 << 0,
939 kRead = 1 << 1,
940 kOutput = 1 << 2,
941 kInput = 1 << 3,
945};
946
947const intptr_t kReleaseShift = 25;
948const intptr_t kAcquireShift = 26;
949
950#define DEFINE_REG_ENCODING(type, name, shift) \
951 inline bool Is##name(type r) { \
952 return static_cast<uint32_t>(r) < 32; \
953 } \
954 inline uint32_t Encode##name(type r) { \
955 ASSERT(Is##name(r)); \
956 return static_cast<uint32_t>(r) << shift; \
957 } \
958 inline type Decode##name(uint32_t encoding) { \
959 return type((encoding >> shift) & 31); \
960 }
961
969#undef DEFINE_REG_ENCODING
970
971#define DEFINE_FUNCT_ENCODING(type, name, shift, mask) \
972 inline bool Is##name(type f) { \
973 return (f & mask) == f; \
974 } \
975 inline uint32_t Encode##name(type f) { \
976 ASSERT(Is##name(f)); \
977 return f << shift; \
978 } \
979 inline type Decode##name(uint32_t encoding) { \
980 return static_cast<type>((encoding >> shift) & mask); \
981 }
982
989#if XLEN == 32
990DEFINE_FUNCT_ENCODING(uint32_t, Shamt, 20, 0x1F)
991#elif XLEN == 64
992DEFINE_FUNCT_ENCODING(uint32_t, Shamt, 20, 0x3F)
993#endif
995#undef DEFINE_FUNCT_ENCODING
996
997inline intx_t ImmLo(intx_t imm) {
998 return static_cast<intx_t>(static_cast<uintx_t>(imm) << (XLEN - 12)) >>
999 (XLEN - 12);
1000}
1001inline intx_t ImmHi(intx_t imm) {
1002 return static_cast<intx_t>(
1003 (static_cast<uintx_t>(imm) - static_cast<uintx_t>(ImmLo(imm)))
1004 << (XLEN - 32)) >>
1005 (XLEN - 32);
1006}
1007
1008inline bool IsBTypeImm(intptr_t imm) {
1009 return Utils::IsInt(12, imm) && Utils::IsAligned(imm, 2);
1010}
1011inline uint32_t EncodeBTypeImm(intptr_t imm) {
1012 ASSERT(IsBTypeImm(imm));
1013 uint32_t encoded = 0;
1014 encoded |= ((imm >> 12) & 0x1) << 31;
1015 encoded |= ((imm >> 5) & 0x3f) << 25;
1016 encoded |= ((imm >> 1) & 0xf) << 8;
1017 encoded |= ((imm >> 11) & 0x1) << 7;
1018 return encoded;
1019}
1020inline intptr_t DecodeBTypeImm(uint32_t encoded) {
1021 uint32_t imm = 0;
1022 imm |= (((encoded >> 31) & 0x1) << 12);
1023 imm |= (((encoded >> 25) & 0x3f) << 5);
1024 imm |= (((encoded >> 8) & 0xf) << 1);
1025 imm |= (((encoded >> 7) & 0x1) << 11);
1026 return SignExtend(12, imm);
1027}
1028
1029inline bool IsJTypeImm(intptr_t imm) {
1030 return Utils::IsInt(20, imm) && Utils::IsAligned(imm, 2);
1031}
1032inline uint32_t EncodeJTypeImm(intptr_t imm) {
1033 ASSERT(IsJTypeImm(imm));
1034 uint32_t encoded = 0;
1035 encoded |= ((imm >> 20) & 0x1) << 31;
1036 encoded |= ((imm >> 1) & 0x3ff) << 21;
1037 encoded |= ((imm >> 11) & 0x1) << 20;
1038 encoded |= ((imm >> 12) & 0xff) << 12;
1039 return encoded;
1040}
1041inline intptr_t DecodeJTypeImm(uint32_t encoded) {
1042 uint32_t imm = 0;
1043 imm |= (((encoded >> 31) & 0x1) << 20);
1044 imm |= (((encoded >> 21) & 0x3ff) << 1);
1045 imm |= (((encoded >> 20) & 0x1) << 11);
1046 imm |= (((encoded >> 12) & 0xff) << 12);
1047 return SignExtend(20, imm);
1048}
1049
1050inline bool IsITypeImm(intptr_t imm) {
1051 return Utils::IsInt(12, imm);
1052}
1053inline uint32_t EncodeITypeImm(intptr_t imm) {
1054 ASSERT(IsITypeImm(imm));
1055 return static_cast<uint32_t>(imm) << 20;
1056}
1057inline intptr_t DecodeITypeImm(uint32_t encoded) {
1058 return SignExtend(12, encoded >> 20);
1059}
1060
1061inline bool IsUTypeImm(intptr_t imm) {
1062 return Utils::IsInt(32, imm) && Utils::IsAligned(imm, 1 << 12);
1063}
1064inline uint32_t EncodeUTypeImm(intptr_t imm) {
1065 ASSERT(IsUTypeImm(imm));
1066 return imm;
1067}
1068inline intptr_t DecodeUTypeImm(uint32_t encoded) {
1069 return SignExtend(32, encoded & ~((1 << 12) - 1));
1070}
1071
1072inline bool IsSTypeImm(intptr_t imm) {
1073 return Utils::IsInt(12, imm);
1074}
1075inline uint32_t EncodeSTypeImm(intptr_t imm) {
1076 ASSERT(IsSTypeImm(imm));
1077 uint32_t encoded = 0;
1078 encoded |= ((imm >> 5) & 0x7f) << 25;
1079 encoded |= ((imm >> 0) & 0x1f) << 7;
1080 return encoded;
1081}
1082inline intptr_t DecodeSTypeImm(uint32_t encoded) {
1083 uint32_t imm = 0;
1084 imm |= (((encoded >> 25) & 0x7f) << 5);
1085 imm |= (((encoded >> 7) & 0x1f) << 0);
1086 return SignExtend(12, imm);
1087}
1088
1089inline bool IsCInstruction(uint16_t parcel) {
1090 return (parcel & 3) != 3;
1091}
1092
1093class Instr {
1094 public:
1095 explicit Instr(uint32_t encoding) : encoding_(encoding) {}
1096 uint32_t encoding() const { return encoding_; }
1097
1098 size_t length() const { return 4; }
1099
1100 Opcode opcode() const { return DecodeOpcode(encoding_); }
1101
1102 Register rd() const { return DecodeRd(encoding_); }
1103 Register rs1() const { return DecodeRs1(encoding_); }
1104 Register rs2() const { return DecodeRs2(encoding_); }
1105
1106 FRegister frd() const { return DecodeFRd(encoding_); }
1107 FRegister frs1() const { return DecodeFRs1(encoding_); }
1108 FRegister frs2() const { return DecodeFRs2(encoding_); }
1109 FRegister frs3() const { return DecodeFRs3(encoding_); }
1110
1111 Funct2 funct2() const { return DecodeFunct2(encoding_); }
1112 Funct3 funct3() const { return DecodeFunct3(encoding_); }
1113 Funct5 funct5() const { return DecodeFunct5(encoding_); }
1114 Funct7 funct7() const { return DecodeFunct7(encoding_); }
1115 Funct12 funct12() const { return DecodeFunct12(encoding_); }
1116
1117 uint32_t shamt() const { return DecodeShamt(encoding_); }
1118 RoundingMode rounding() const { return DecodeRoundingMode(encoding_); }
1119
1120 std::memory_order memory_order() const {
1121 bool acquire = ((encoding_ >> kAcquireShift) & 1) != 0;
1122 bool release = ((encoding_ >> kReleaseShift) & 1) != 0;
1123 if (acquire && release) return std::memory_order_acq_rel;
1124 if (acquire) return std::memory_order_acquire;
1125 if (release) return std::memory_order_release;
1126 return std::memory_order_relaxed;
1127 }
1128
1129 intx_t itype_imm() const { return DecodeITypeImm(encoding_); }
1130 intx_t stype_imm() const { return DecodeSTypeImm(encoding_); }
1131 intx_t btype_imm() const { return DecodeBTypeImm(encoding_); }
1132 intx_t utype_imm() const { return DecodeUTypeImm(encoding_); }
1133 intx_t jtype_imm() const { return DecodeJTypeImm(encoding_); }
1134
1135 uint32_t csr() const { return encoding_ >> 20; }
1136 uint32_t zimm() const { return rs1(); }
1137
1138 static constexpr uint32_t kBreakPointInstruction = 0;
1139 static constexpr uint32_t kInstrSize = 4;
1140 static constexpr uint32_t kSimulatorRedirectInstruction =
1141 ECALL << 20 | SYSTEM;
1142
1143 private:
1144 const uint32_t encoding_;
1145};
1146
1147#define DEFINE_REG_ENCODING(type, name, shift) \
1148 inline bool Is##name(type r) { \
1149 return static_cast<uint32_t>(r) < 32; \
1150 } \
1151 inline uint32_t Encode##name(type r) { \
1152 ASSERT(Is##name(r)); \
1153 return static_cast<uint32_t>(r) << shift; \
1154 } \
1155 inline type Decode##name(uint32_t encoding) { \
1156 return type((encoding >> shift) & 31); \
1157 }
1158
1159#define DEFINE_REG_PRIME_ENCODING(type, name, shift) \
1160 inline bool Is##name(type r) { \
1161 return (r >= 8) && (r < 16); \
1162 } \
1163 inline uint32_t Encode##name(type r) { \
1164 ASSERT(Is##name(r)); \
1165 return (static_cast<uint32_t>(r) & 7) << shift; \
1166 } \
1167 inline type Decode##name(uint32_t encoding) { \
1168 return type(((encoding >> shift) & 7) + 8); \
1169 }
1170
1183#undef DEFINE_REG_ENCODING
1184#undef DEFINE_REG_PRIME_ENCODING
1185
1186inline bool IsCSPLoad4Imm(intptr_t imm) {
1187 return Utils::IsUint(8, imm) && Utils::IsAligned(imm, 4);
1188}
1189inline uint32_t EncodeCSPLoad4Imm(intptr_t imm) {
1190 ASSERT(IsCSPLoad4Imm(imm));
1191 uint32_t encoding = 0;
1192 encoding |= ((imm >> 5) & 0x1) << 12;
1193 encoding |= ((imm >> 2) & 0x7) << 4;
1194 encoding |= ((imm >> 6) & 0x3) << 2;
1195 return encoding;
1196}
1197inline intx_t DecodeCSPLoad4Imm(uint32_t encoding) {
1198 uint32_t imm = 0;
1199 imm |= ((encoding >> 12) & 0x1) << 5;
1200 imm |= ((encoding >> 4) & 0x7) << 2;
1201 imm |= ((encoding >> 2) & 0x3) << 6;
1202 return imm;
1203}
1204
1205inline bool IsCSPLoad8Imm(intptr_t imm) {
1206 return Utils::IsUint(9, imm) && Utils::IsAligned(imm, 8);
1207}
1208inline uint32_t EncodeCSPLoad8Imm(intptr_t imm) {
1209 ASSERT(IsCSPLoad8Imm(imm));
1210 uint32_t encoding = 0;
1211 encoding |= ((imm >> 5) & 0x1) << 12;
1212 encoding |= ((imm >> 3) & 0x3) << 5;
1213 encoding |= ((imm >> 6) & 0x7) << 2;
1214 return encoding;
1215}
1216inline intx_t DecodeCSPLoad8Imm(uint32_t encoding) {
1217 uint32_t imm = 0;
1218 imm |= ((encoding >> 12) & 0x1) << 5;
1219 imm |= ((encoding >> 5) & 0x3) << 3;
1220 imm |= ((encoding >> 2) & 0x7) << 6;
1221 return imm;
1222}
1223
1224inline bool IsCSPStore4Imm(intptr_t imm) {
1225 return Utils::IsUint(8, imm) && Utils::IsAligned(imm, 4);
1226}
1227inline uint32_t EncodeCSPStore4Imm(intptr_t imm) {
1228 ASSERT(IsCSPStore4Imm(imm));
1229 uint32_t encoding = 0;
1230 encoding |= ((imm >> 2) & 0xF) << 9;
1231 encoding |= ((imm >> 6) & 0x3) << 7;
1232 return encoding;
1233}
1234inline intx_t DecodeCSPStore4Imm(uint32_t encoding) {
1235 uint32_t imm = 0;
1236 imm |= ((encoding >> 9) & 0xF) << 2;
1237 imm |= ((encoding >> 7) & 0x3) << 6;
1238 return imm;
1239}
1240
1241inline bool IsCSPStore8Imm(intptr_t imm) {
1242 return Utils::IsUint(9, imm) && Utils::IsAligned(imm, 8);
1243}
1244inline uint32_t EncodeCSPStore8Imm(intptr_t imm) {
1245 ASSERT(IsCSPStore8Imm(imm));
1246 uint32_t encoding = 0;
1247 encoding |= ((imm >> 3) & 0x7) << 10;
1248 encoding |= ((imm >> 6) & 0x7) << 7;
1249 return encoding;
1250}
1251inline intx_t DecodeCSPStore8Imm(uint32_t encoding) {
1252 uint32_t imm = 0;
1253 imm |= ((encoding >> 10) & 0x7) << 3;
1254 imm |= ((encoding >> 7) & 0x7) << 6;
1255 return imm;
1256}
1257
1258inline bool IsCMem4Imm(intptr_t imm) {
1259 return Utils::IsUint(7, imm) && Utils::IsAligned(imm, 4);
1260}
1261inline uint32_t EncodeCMem4Imm(intptr_t imm) {
1262 ASSERT(IsCMem4Imm(imm));
1263 uint32_t encoding = 0;
1264 encoding |= ((imm >> 3) & 0x7) << 10;
1265 encoding |= ((imm >> 2) & 0x1) << 6;
1266 encoding |= ((imm >> 6) & 0x1) << 5;
1267 return encoding;
1268}
1269inline intx_t DecodeCMem4Imm(uint32_t encoding) {
1270 uint32_t imm = 0;
1271 imm |= ((encoding >> 10) & 0x7) << 3;
1272 imm |= ((encoding >> 6) & 0x1) << 2;
1273 imm |= ((encoding >> 5) & 0x1) << 6;
1274 return imm;
1275}
1276
1277inline bool IsCMem8Imm(intptr_t imm) {
1278 return Utils::IsUint(8, imm) && Utils::IsAligned(imm, 8);
1279}
1280inline uint32_t EncodeCMem8Imm(intptr_t imm) {
1281 ASSERT(IsCMem8Imm(imm));
1282 uint32_t encoding = 0;
1283 encoding |= ((imm >> 3) & 0x7) << 10;
1284 encoding |= ((imm >> 6) & 0x3) << 5;
1285 return encoding;
1286}
1287inline intx_t DecodeCMem8Imm(uint32_t encoding) {
1288 uint32_t imm = 0;
1289 imm |= ((encoding >> 10) & 0x7) << 3;
1290 imm |= ((encoding >> 5) & 0x3) << 6;
1291 return imm;
1292}
1293
1294inline bool IsCJImm(intptr_t imm) {
1295 return Utils::IsInt(11, imm) && Utils::IsAligned(imm, 2);
1296}
1297inline uint32_t EncodeCJImm(intptr_t imm) {
1298 ASSERT(IsCJImm(imm));
1299 uint32_t encoding = 0;
1300 encoding |= ((imm >> 11) & 0x1) << 12;
1301 encoding |= ((imm >> 4) & 0x1) << 11;
1302 encoding |= ((imm >> 8) & 0x3) << 9;
1303 encoding |= ((imm >> 10) & 0x1) << 8;
1304 encoding |= ((imm >> 6) & 0x1) << 7;
1305 encoding |= ((imm >> 7) & 0x1) << 6;
1306 encoding |= ((imm >> 1) & 0x7) << 3;
1307 encoding |= ((imm >> 5) & 0x1) << 2;
1308 return encoding;
1309}
1310inline intx_t DecodeCJImm(uint32_t encoding) {
1311 uint32_t imm = 0;
1312 imm |= ((encoding >> 12) & 0x1) << 11;
1313 imm |= ((encoding >> 11) & 0x1) << 4;
1314 imm |= ((encoding >> 9) & 0x3) << 8;
1315 imm |= ((encoding >> 8) & 0x1) << 10;
1316 imm |= ((encoding >> 7) & 0x1) << 6;
1317 imm |= ((encoding >> 6) & 0x1) << 7;
1318 imm |= ((encoding >> 3) & 0x7) << 1;
1319 imm |= ((encoding >> 2) & 0x1) << 5;
1320 return SignExtend(11, imm);
1321}
1322
1323inline bool IsCBImm(intptr_t imm) {
1324 return Utils::IsInt(8, imm) && Utils::IsAligned(imm, 2);
1325}
1326inline uint32_t EncodeCBImm(intptr_t imm) {
1327 ASSERT(IsCBImm(imm));
1328 uint32_t encoding = 0;
1329 encoding |= ((imm >> 8) & 0x1) << 12;
1330 encoding |= ((imm >> 3) & 0x3) << 10;
1331 encoding |= ((imm >> 6) & 0x3) << 5;
1332 encoding |= ((imm >> 1) & 0x3) << 3;
1333 encoding |= ((imm >> 5) & 0x1) << 2;
1334 return encoding;
1335}
1336inline intx_t DecodeCBImm(uint32_t encoding) {
1337 uint32_t imm = 0;
1338 imm |= ((encoding >> 12) & 0x1) << 8;
1339 imm |= ((encoding >> 10) & 0x3) << 3;
1340 imm |= ((encoding >> 5) & 0x3) << 6;
1341 imm |= ((encoding >> 3) & 0x3) << 1;
1342 imm |= ((encoding >> 2) & 0x1) << 5;
1343 return SignExtend(8, imm);
1344}
1345
1346inline bool IsCIImm(intptr_t imm) {
1347 return Utils::IsInt(6, imm) && Utils::IsAligned(imm, 1);
1348}
1349inline uint32_t EncodeCIImm(intptr_t imm) {
1350 ASSERT(IsCIImm(imm));
1351 uint32_t encoding = 0;
1352 encoding |= ((imm >> 5) & 0x1) << 12;
1353 encoding |= ((imm >> 0) & 0x1F) << 2;
1354 return encoding;
1355}
1356inline intx_t DecodeCIImm(uint32_t encoding) {
1357 uint32_t imm = 0;
1358 imm |= ((encoding >> 12) & 0x1) << 5;
1359 imm |= ((encoding >> 2) & 0x1F) << 0;
1360 return SignExtend(6, imm);
1361}
1362
1363inline bool IsCUImm(intptr_t imm) {
1364 return Utils::IsInt(17, imm) && Utils::IsAligned(imm, 1 << 12);
1365}
1366inline uint32_t EncodeCUImm(intptr_t imm) {
1367 ASSERT(IsCUImm(imm));
1368 uint32_t encoding = 0;
1369 encoding |= ((imm >> 17) & 0x1) << 12;
1370 encoding |= ((imm >> 12) & 0x1F) << 2;
1371 return encoding;
1372}
1373inline intx_t DecodeCUImm(uint32_t encoding) {
1374 uint32_t imm = 0;
1375 imm |= ((encoding >> 12) & 0x1) << 17;
1376 imm |= ((encoding >> 2) & 0x1F) << 12;
1377 return SignExtend(17, imm);
1378}
1379
1380inline bool IsCI16Imm(intptr_t imm) {
1381 return Utils::IsInt(10, imm) && Utils::IsAligned(imm, 16);
1382}
1383inline uint32_t EncodeCI16Imm(intptr_t imm) {
1384 ASSERT(IsCI16Imm(imm));
1385 uint32_t encoding = 0;
1386 encoding |= ((imm >> 9) & 0x1) << 12;
1387 encoding |= ((imm >> 4) & 0x1) << 6;
1388 encoding |= ((imm >> 6) & 0x1) << 5;
1389 encoding |= ((imm >> 7) & 0x3) << 3;
1390 encoding |= ((imm >> 5) & 0x1) << 2;
1391 return encoding;
1392}
1393inline intx_t DecodeCI16Imm(uint32_t encoding) {
1394 uint32_t imm = 0;
1395 imm |= ((encoding >> 12) & 0x1) << 9;
1396 imm |= ((encoding >> 6) & 0x1) << 4;
1397 imm |= ((encoding >> 5) & 0x1) << 6;
1398 imm |= ((encoding >> 3) & 0x3) << 7;
1399 imm |= ((encoding >> 2) & 0x1) << 5;
1400 return SignExtend(10, imm);
1401}
1402
1403inline bool IsCI4SPNImm(intptr_t imm) {
1404 return Utils::IsUint(9, imm) && Utils::IsAligned(imm, 4);
1405}
1406inline uint32_t EncodeCI4SPNImm(intptr_t imm) {
1407 ASSERT(IsCI4SPNImm(imm));
1408 uint32_t encoding = 0;
1409 encoding |= ((imm >> 4) & 0x3) << 11;
1410 encoding |= ((imm >> 6) & 0xF) << 7;
1411 encoding |= ((imm >> 2) & 0x1) << 6;
1412 encoding |= ((imm >> 3) & 0x1) << 5;
1413 return encoding;
1414}
1415inline intx_t DecodeCI4SPNImm(uint32_t encoding) {
1416 uint32_t imm = 0;
1417 imm |= ((encoding >> 11) & 0x3) << 4;
1418 imm |= ((encoding >> 7) & 0xF) << 6;
1419 imm |= ((encoding >> 6) & 0x1) << 2;
1420 imm |= ((encoding >> 5) & 0x1) << 3;
1421 return imm;
1422}
1423
1425 C_OP_MASK = 0b1110000000000011,
1426
1427 C_ADDI4SPN = 0b0000000000000000,
1428 C_FLD = 0b0010000000000000,
1429 C_LW = 0b0100000000000000,
1430 C_FLW = 0b0110000000000000,
1431 C_LD = 0b0110000000000000,
1432 C_FSD = 0b1010000000000000,
1433 C_SW = 0b1100000000000000,
1434 C_FSW = 0b1110000000000000,
1435 C_SD = 0b1110000000000000,
1436
1437 C_ADDI = 0b0000000000000001,
1438 C_JAL = 0b0010000000000001,
1439 C_ADDIW = 0b0010000000000001,
1440 C_LI = 0b0100000000000001,
1441 C_ADDI16SP = 0b0110000000000001,
1442 C_LUI = 0b0110000000000001,
1443
1444 C_MISCALU = 0b1000000000000001,
1445 C_MISCALU_MASK = 0b1110110000000011,
1446 C_SRLI = 0b1000000000000001,
1447 C_SRAI = 0b1000010000000001,
1448 C_ANDI = 0b1000100000000001,
1449 C_RR = 0b1000110000000001,
1450 C_RR_MASK = 0b1111110001100011,
1451 C_SUB = 0b1000110000000001,
1452 C_XOR = 0b1000110000100001,
1453 C_OR = 0b1000110001000001,
1454 C_AND = 0b1000110001100001,
1455 C_SUBW = 0b1001110000000001,
1456 C_ADDW = 0b1001110000100001,
1457
1458 C_J = 0b1010000000000001,
1459 C_BEQZ = 0b1100000000000001,
1460 C_BNEZ = 0b1110000000000001,
1461
1462 C_SLLI = 0b0000000000000010,
1463 C_FLDSP = 0b0010000000000010,
1464 C_LWSP = 0b0100000000000010,
1465 C_FLWSP = 0b0110000000000010,
1466 C_LDSP = 0b0110000000000010,
1467 C_JR = 0b1000000000000010,
1468 C_MV = 0b1000000000000010,
1469 C_JALR = 0b1001000000000010,
1470 C_ADD = 0b1001000000000010,
1471 C_FSDSP = 0b1010000000000010,
1472 C_SWSP = 0b1100000000000010,
1473 C_FSWSP = 0b1110000000000010,
1474 C_SDSP = 0b1110000000000010,
1475
1476 C_NOP = 0b0000000000000001,
1477 C_EBREAK = 0b1001000000000010,
1478};
1479
1480class CInstr {
1481 public:
1482 explicit CInstr(uint16_t encoding) : encoding_(encoding) {}
1483 uint16_t encoding() const { return encoding_; }
1484
1485 static constexpr uint32_t kInstrSize = 2;
1486 size_t length() const { return kInstrSize; }
1487
1488 COpcode opcode() const { return COpcode(encoding_ & C_OP_MASK); }
1489
1490 Register rd() const { return DecodeCRd(encoding_); }
1491 Register rs1() const { return DecodeCRd(encoding_); }
1492 Register rs2() const { return DecodeCRs2(encoding_); }
1493 Register rdp() const { return DecodeCRdp(encoding_); }
1494 Register rs1p() const { return DecodeCRs1p(encoding_); }
1495 Register rs2p() const { return DecodeCRs2p(encoding_); }
1496 FRegister frd() const { return DecodeCFRd(encoding_); }
1497 FRegister frs1() const { return DecodeCFRd(encoding_); }
1498 FRegister frs2() const { return DecodeCFRs2(encoding_); }
1499 FRegister frdp() const { return DecodeCFRdp(encoding_); }
1500 FRegister frs1p() const { return DecodeCFRs1p(encoding_); }
1501 FRegister frs2p() const { return DecodeCFRs2p(encoding_); }
1502
1503 intx_t spload4_imm() { return DecodeCSPLoad4Imm(encoding_); }
1504 intx_t spload8_imm() { return DecodeCSPLoad8Imm(encoding_); }
1505 intx_t spstore4_imm() { return DecodeCSPStore4Imm(encoding_); }
1506 intx_t spstore8_imm() { return DecodeCSPStore8Imm(encoding_); }
1507 intx_t mem4_imm() { return DecodeCMem4Imm(encoding_); }
1508 intx_t mem8_imm() { return DecodeCMem8Imm(encoding_); }
1509 intx_t j_imm() { return DecodeCJImm(encoding_); }
1510 intx_t b_imm() { return DecodeCBImm(encoding_); }
1511 intx_t i_imm() { return DecodeCIImm(encoding_); }
1512 intx_t u_imm() { return DecodeCUImm(encoding_); }
1513 intx_t i16_imm() { return DecodeCI16Imm(encoding_); }
1514 intx_t i4spn_imm() { return DecodeCI4SPNImm(encoding_); }
1515
1516 private:
1517 const uint16_t encoding_;
1518};
1519
1520#define DEFINE_TYPED_ENUM_SET(name, storage_t) \
1521 class name##Set; \
1522 class name { \
1523 public: \
1524 constexpr explicit name(storage_t encoding) : encoding_(encoding) {} \
1525 constexpr storage_t encoding() const { \
1526 return encoding_; \
1527 } \
1528 constexpr bool operator==(const name& other) const { \
1529 return encoding_ == other.encoding_; \
1530 } \
1531 constexpr bool operator!=(const name& other) const { \
1532 return encoding_ != other.encoding_; \
1533 } \
1534 inline constexpr name##Set operator|(const name& other) const; \
1535 inline constexpr name##Set operator|(const name##Set& other) const; \
1536 \
1537 private: \
1538 const storage_t encoding_; \
1539 }; \
1540 inline std::ostream& operator<<(std::ostream& stream, const name& element) { \
1541 return stream << #name << "(" << element.encoding() << ")"; \
1542 } \
1543 class name##Set { \
1544 public: \
1545 constexpr /* implicit */ name##Set(name element) \
1546 : encoding_(1u << element.encoding()) {} \
1547 constexpr explicit name##Set(storage_t encoding) : encoding_(encoding) {} \
1548 constexpr static name##Set Empty() { \
1549 return name##Set(0); \
1550 } \
1551 constexpr bool Includes(const name r) const { \
1552 return (encoding_ & (1 << r.encoding())) != 0; \
1553 } \
1554 constexpr bool IncludesAll(const name##Set other) const { \
1555 return (encoding_ & other.encoding_) == other.encoding_; \
1556 } \
1557 constexpr bool IsEmpty() const { \
1558 return encoding_ == 0; \
1559 } \
1560 constexpr bool operator==(const name##Set& other) const { \
1561 return encoding_ == other.encoding_; \
1562 } \
1563 constexpr bool operator!=(const name##Set& other) const { \
1564 return encoding_ != other.encoding_; \
1565 } \
1566 constexpr name##Set operator|(const name& other) const { \
1567 return name##Set(encoding_ | (1 << other.encoding())); \
1568 } \
1569 constexpr name##Set operator|(const name##Set& other) const { \
1570 return name##Set(encoding_ | other.encoding_); \
1571 } \
1572 constexpr name##Set operator&(const name##Set& other) const { \
1573 return name##Set(encoding_ & other.encoding_); \
1574 } \
1575 \
1576 private: \
1577 storage_t encoding_; \
1578 }; \
1579 constexpr name##Set name::operator|(const name& other) const { \
1580 return name##Set((1u << encoding_) | (1u << other.encoding_)); \
1581 } \
1582 constexpr name##Set name::operator|(const name##Set& other) const { \
1583 return other | *this; \
1584 }
1585
1587static constexpr Extension RV_I(0); // Integer base
1588static constexpr Extension RV_M(1); // Multiply/divide
1589static constexpr Extension RV_A(2); // Atomic
1590static constexpr Extension RV_F(3); // Single-precision floating point
1591static constexpr Extension RV_D(4); // Double-precision floating point
1592static constexpr Extension RV_C(5); // Compressed instructions
1593static constexpr ExtensionSet RV_G = RV_I | RV_M | RV_A | RV_F | RV_D;
1594static constexpr ExtensionSet RV_GC = RV_G | RV_C;
1595static constexpr Extension RV_Zba(6); // Address generation
1596static constexpr Extension RV_Zbb(7); // Basic bit-manipulation
1597static constexpr Extension RV_Zbc(8); // Carry-less multiplication
1598static constexpr Extension RV_Zbs(9); // Single-bit instructions
1599static constexpr ExtensionSet RV_B = RV_Zba | RV_Zbb | RV_Zbc | RV_Zbs;
1600static constexpr ExtensionSet RV_GCB = RV_GC | RV_B;
1601
1602#undef R
1603
1605 return r;
1606}
1607#define LINK_REGISTER RA
1608
1609// No information available.
1610const intptr_t kPreferredLoopAlignment = 1;
1611
1612} // namespace dart
1613
1614#endif // RUNTIME_VM_CONSTANTS_RISCV_H_
SweepLineTestingPeer TP
#define COMPILE_ASSERT(expr)
Definition assert.h:339
#define N
Definition beziers.cpp:19
intx_t spstore4_imm()
Register rdp() const
Register rd() const
CInstr(uint16_t encoding)
Register rs1p() const
Register rs2() const
COpcode opcode() const
intx_t spstore8_imm()
FRegister frd() const
FRegister frs2p() const
Register rs1() const
static constexpr uint32_t kInstrSize
FRegister frdp() const
FRegister frs2() const
uint16_t encoding() const
FRegister frs1() const
FRegister frs1p() const
size_t length() const
Register rs2p() const
static constexpr ExtensionStrategy kArgumentStackExtension
static constexpr Register kSecondReturnReg
static constexpr intptr_t kCalleeSaveCpuRegisters
static constexpr AlignmentStrategy kArgumentRegisterAlignmentVarArgs
static constexpr AlignmentStrategy kFieldAlignment
static const FpuRegister FpuArgumentRegisters[]
static const Register ArgumentRegisters[]
static constexpr bool kArgumentIntRegXorFpuReg
static constexpr intptr_t kFpuArgumentRegisters
static constexpr FpuRegister kReturnFpuReg
static constexpr intptr_t kNumFpuArgRegs
static constexpr Register kPointerToReturnStructRegisterCall
static constexpr Register kFirstNonArgumentRegister
static constexpr Register kFfiAnyNonAbiRegister
static constexpr AlignmentStrategy kArgumentStackAlignmentVarArgs
static constexpr Register kPointerToReturnStructRegisterReturn
static constexpr AlignmentStrategy kArgumentRegisterAlignment
static constexpr ExtensionStrategy kReturnRegisterExtension
COMPILE_ASSERT(((R(kFirstNonArgumentRegister)|R(kSecondNonArgumentRegister)) &(kArgumentRegisters|R(kPointerToReturnStructRegisterCall)))==0)
static constexpr Register kStackPointerRegister
static constexpr Register kReturnReg
static constexpr intptr_t kArgumentRegisters
static constexpr Register kSecondNonArgumentRegister
static constexpr ExtensionStrategy kArgumentRegisterExtension
static constexpr intptr_t kNumArgRegs
static constexpr AlignmentStrategy kArgumentStackAlignment
intx_t btype_imm() const
intx_t utype_imm() const
FRegister frs1() const
uint32_t encoding() const
Funct7 funct7() const
Funct12 funct12() const
uint32_t shamt() const
Register rs2() const
static constexpr int32_t kBreakPointInstruction
Funct5 funct5() const
Opcode opcode() const
Funct3 funct3() const
FRegister frd() const
intx_t stype_imm() const
FRegister frs2() const
Instr(uint32_t encoding)
size_t length() const
std::memory_order memory_order() const
FRegister frs3() const
intx_t jtype_imm() const
Register rd() const
uint32_t zimm() const
Register rs1() const
intx_t itype_imm() const
Funct2 funct2() const
RoundingMode rounding() const
static constexpr int32_t kSimulatorRedirectInstruction
uint32_t csr() const
static bool IsInt(intptr_t N, T value)
Definition utils.h:298
static constexpr int CountOneBits32(uint32_t x)
Definition utils.h:145
static bool IsUint(intptr_t N, T value)
Definition utils.h:313
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
Definition utils.h:77
#define DEFINE_FUNCT_ENCODING(type, name, shift, mask)
#define DEFINE_REG_ENCODING(type, name, shift)
#define DEFINE_TYPED_ENUM_SET(name, storage_t)
#define DEFINE_REG_PRIME_ENCODING(type, name, shift)
#define ASSERT(E)
uint8_t value
#define DECLARE_FLAG(type, name)
Definition flags.h:14
#define R(r)
double x
ExtensionStrategy
@ kExtendedTo4
@ kExtendedTo8
constexpr int64_t kMaxInt64
Definition globals.h:486
static constexpr ExtensionSet RV_GCB
constexpr int64_t kMinInt64
Definition globals.h:485
const FpuRegister kNoFpuRegister
uint32_t EncodeBTypeImm(intptr_t imm)
uint32_t EncodeCBImm(intptr_t imm)
const Register kWriteBarrierSlotReg
const intptr_t kReleaseShift
@ TIMES_COMPRESSED_HALF_WORD_SIZE
@ TIMES_COMPRESSED_WORD_SIZE
bool IsCI16Imm(intptr_t imm)
const Register THR
static constexpr Extension RV_F(3)
uint32_t EncodeUTypeImm(intptr_t imm)
intx_t DecodeCBImm(uint32_t encoding)
static Condition InvertCondition(Condition c)
const RegList kAbiVolatileCpuRegs
constexpr Register FAR_TMP
const Register kExceptionObjectReg
bool IsCInstruction(uint16_t parcel)
static constexpr Extension RV_Zbs(9)
intptr_t DecodeBTypeImm(uint32_t encoded)
intx_t DecodeCMem8Imm(uint32_t encoding)
const RegList kReservedCpuRegisters
const Register kWriteBarrierObjectReg
const Register NULL_REG
int32_t SignExtend(int N, int32_t value)
static constexpr ExtensionSet RV_GC
const RegList kAllFpuRegistersList
constexpr int32_t kMinInt32
Definition globals.h:482
const Register kWriteBarrierValueReg
intx_t DecodeCSPLoad4Imm(uint32_t encoding)
intx_t DecodeCUImm(uint32_t encoding)
uint16_t RegList
uint32_t EncodeCSPStore4Imm(intptr_t imm)
const char *const fpu_reg_names[kNumberOfFpuRegisters]
bool IsCSPLoad4Imm(intptr_t imm)
constexpr uint64_t kMaxUint64
Definition globals.h:487
constexpr intptr_t kInt32SizeLog2
Definition globals.h:449
constexpr uint32_t kMaxUint32
Definition globals.h:484
bool IsCJImm(intptr_t imm)
uint32_t EncodeCJImm(intptr_t imm)
Register ConcreteRegister(LinkRegister)
bool IsCIImm(intptr_t imm)
uint32_t EncodeCSPLoad8Imm(intptr_t imm)
const FpuRegister FpuTMP
const Register CALLEE_SAVED_TEMP
static constexpr Extension RV_Zbc(8)
uintptr_t uword
Definition globals.h:501
const Register CODE_REG
constexpr uword kBreakInstructionFiller
@ kNoCondition
@ GREATER_EQUAL
@ UNSIGNED_GREATER
@ kInvalidCondition
@ UNSIGNED_GREATER_EQUAL
@ NO_OVERFLOW
@ UNSIGNED_LESS
@ kNumberOfConditions
@ UNSIGNED_LESS_EQUAL
const Register TMP2
const Register ARGS_DESC_REG
const Register DISPATCH_TABLE_REG
@ kNumberOfCpuRegisters
@ kNoRegister
const int kNumberOfFpuRegisters
const RegList kAbiPreservedCpuRegs
intptr_t DecodeITypeImm(uint32_t encoded)
constexpr RegList kAbiArgumentFpuRegs
intx_t sign_extend(int32_t x)
@ kFClassNegSubnormal
@ kFClassPosInfinity
@ kFClassQuietNan
@ kFClassSignallingNan
@ kFClassNegNormal
@ kFClassNegInfinity
@ kFClassPosSubnormal
@ kFClassPosNormal
const FRegister FTMP
intx_t DecodeCIImm(uint32_t encoding)
bool IsCSPStore8Imm(intptr_t imm)
intptr_t DecodeUTypeImm(uint32_t encoded)
intptr_t DecodeJTypeImm(uint32_t encoded)
constexpr RegList kDartAvailableCpuRegs
const intptr_t kAcquireShift
const Register TMP
const int kAbiPreservedCpuRegCount
uint32_t EncodeCMem8Imm(intptr_t imm)
intx_t ImmHi(intx_t imm)
const RegList kDartVolatileCpuRegs
const Register FPREG
uint32_t EncodeCUImm(intptr_t imm)
static constexpr ExtensionSet RV_B
uint32_t EncodeCI4SPNImm(intptr_t imm)
const intptr_t kStoreBufferWrapperSize
const int kAbiPreservedFpuRegCount
bool IsSTypeImm(intptr_t imm)
intx_t DecodeCSPStore4Imm(uint32_t encoding)
bool IsJTypeImm(intptr_t imm)
intx_t DecodeCMem4Imm(uint32_t encoding)
static constexpr Extension RV_A(2)
uint32_t EncodeCSPLoad4Imm(intptr_t imm)
intx_t DecodeCSPStore8Imm(uint32_t encoding)
constexpr int kRegisterAllocationBias
uint32_t EncodeCIImm(intptr_t imm)
bool IsITypeImm(intptr_t imm)
const Register FUNCTION_REG
constexpr intptr_t kNumberOfReservedCpuRegisters
bool IsCSPStore4Imm(intptr_t imm)
bool IsCUImm(intptr_t imm)
const Register IC_DATA_REG
bool IsUTypeImm(intptr_t imm)
bool IsCMem4Imm(intptr_t imm)
bool IsBTypeImm(intptr_t imm)
const char *const cpu_reg_names[kNumberOfCpuRegisters]
constexpr int32_t kMaxInt32
Definition globals.h:483
constexpr intptr_t kInt64SizeLog2
Definition globals.h:452
constexpr Register WRITE_BARRIER_STATE
static constexpr Extension RV_Zba(6)
intx_t DecodeCSPLoad8Imm(uint32_t encoding)
intx_t DecodeCI4SPNImm(uint32_t encoding)
static constexpr Extension RV_M(1)
static constexpr Extension RV_C(5)
uint32_t EncodeITypeImm(intptr_t imm)
uint32_t EncodeSTypeImm(intptr_t imm)
const Register PP
constexpr RegList kAbiPreservedFpuRegs
uint32_t EncodeCMem4Imm(intptr_t imm)
uint32_t EncodeCSPStore8Imm(intptr_t imm)
bool IsCSPLoad8Imm(intptr_t imm)
const RegList kAbiArgumentCpuRegs
bool IsCMem8Imm(intptr_t imm)
QRegister FpuRegister
uint32_t EncodeJTypeImm(intptr_t imm)
const Register kStackTraceObjectReg
const RegList kAllCpuRegistersList
intx_t DecodeCI16Imm(uint32_t encoding)
bool IsCBImm(intptr_t imm)
const intptr_t kPreferredLoopAlignment
simd128_value_t fpu_register_t
constexpr intptr_t kNumberOfReservedFpuRegisters
intx_t DecodeCJImm(uint32_t encoding)
const RegList kAbiVolatileFpuRegs
bool IsCI4SPNImm(intptr_t imm)
uint32_t EncodeCI16Imm(intptr_t imm)
const Register CALLEE_SAVED_TEMP2
const Register SPREG
static constexpr ExtensionSet RV_G
static constexpr Extension RV_D(4)
intptr_t DecodeSTypeImm(uint32_t encoded)
AlignmentStrategy
@ kAlignedToWordSizeAndValueSize
@ kAlignedToValueSize
@ kAlignedToWordSize
const char *const cpu_reg_abi_names[kNumberOfCpuRegisters]
intx_t ImmLo(intx_t imm)
static constexpr Extension RV_I(0)
const int kFpuRegisterSize
static constexpr Extension RV_Zbb(7)
constexpr int kNumberOfDartAvailableCpuRegs
constexpr intptr_t kReservedFpuRegisters
static constexpr Register kResultReg
static constexpr Register kLengthReg
static constexpr Register kTypeArgumentsReg
static constexpr Register kResultReg
static constexpr Register kTempReg
static constexpr Register kFunctionReg
static constexpr Register kContextReg
static constexpr Register kResultReg
static constexpr Register kInstantiatorTypeArgsReg
static constexpr Register kScratchReg
static constexpr Register kResultReg
static constexpr Register kTempReg
static constexpr Register kTypeArgumentsReg
static constexpr Register kResultReg
static constexpr Register kTagsReg
static constexpr Register kShapeReg
static constexpr Register kResultReg
static constexpr Register kTemp1Reg
static constexpr Register kTemp2Reg
static constexpr Register kResultReg
static constexpr Register kShapeReg
static constexpr Register kValue2Reg
static constexpr Register kValue0Reg
static constexpr Register kTempReg
static constexpr Register kValue1Reg
static constexpr Register kLengthReg
static constexpr Register kResultReg
static constexpr Register kObjectReg
static constexpr Register kSubTypeReg
static constexpr Register kSuperTypeReg
static constexpr Register kFunctionTypeArgumentsReg
static constexpr intptr_t kAbiRegisters
static constexpr Register kInstantiatorTypeArgumentsReg
static constexpr Register kDstNameReg
static constexpr Register kSuspendStateReg
static constexpr Register kTempReg
static constexpr Register kResultReg
static constexpr FpuRegister kValueReg
static constexpr Register kDestinationReg
static constexpr Register kSrcFrameReg
static constexpr Register kFrameSizeReg
static constexpr Register kSourceReg
static constexpr Register kTempReg
static constexpr Register kDstFrameReg
static constexpr Register kCpuRegistersForArgs[]
static constexpr FpuRegister kFpuRegistersForArgs[]
static constexpr Register kClassIdReg
static constexpr Register kResultReg
static constexpr Register kRecognizedKindReg
static constexpr FpuRegister kInputReg
static constexpr Register kArgsReg
static constexpr Register kFieldReg
static constexpr Register kResultReg
static constexpr Register kInstanceReg
static constexpr Register kAddressReg
static constexpr Register kScratchReg
static constexpr Register kAddressReg
static constexpr Register kScratchReg
static constexpr Register kResultReg
static constexpr Register kFieldReg
static constexpr Register kTypeArgsReg
static constexpr Register kEntryStartReg
static constexpr intptr_t kSavedRegisters
static constexpr Register kCurrentEntryIndexReg
static constexpr Register kProbeMaskReg
static constexpr Register kProbeDistanceReg
static constexpr Register kInstantiatorTypeArgumentsReg
static constexpr Register kScratchReg
static constexpr Register kResultTypeReg
static constexpr Register kUninstantiatedTypeArgumentsReg
static constexpr Register kResultTypeArgumentsReg
static constexpr Register kFunctionTypeArgumentsReg
static constexpr Register kFieldReg
static constexpr Register kLengthReg
static constexpr Register kIndexReg
static constexpr Register kStackTraceReg
static constexpr Register kExceptionReg
static constexpr Register kSrcFrameReg
static constexpr Register kDstFrameReg
static constexpr Register kFrameSizeReg
static constexpr Register kSuspendStateReg
static constexpr Register kExceptionReg
static constexpr Register kTempReg
static constexpr Register kResumePcReg
static constexpr Register kStackTraceReg
static constexpr Register kSuspendStateReg
static constexpr Register kCacheContentsSizeReg
static constexpr Register kInstanceInstantiatorTypeArgumentsReg
static constexpr intptr_t kInternalRegisters
static constexpr Register kInstanceParentFunctionTypeArgumentsReg
static constexpr Register kProbeDistanceReg
static constexpr Register kInstanceCidOrSignatureReg
static constexpr Register kCacheEntriesEndReg
static constexpr Register kInstanceDelayedFunctionTypeArgumentsReg
static constexpr Register kResultReg
static constexpr Register kSrcFrameReg
static constexpr Register kFunctionDataReg
static constexpr Register kSuspendStateReg
static constexpr Register kTempReg
static constexpr Register kArgumentReg
static constexpr Register kDstFrameReg
static constexpr Register kTypeArgsReg
static constexpr Register kFrameSizeReg
static constexpr intptr_t kInternalRegisters
static constexpr intptr_t kSavedTypeArgumentRegisters
static constexpr Register kSuperTypeArgumentReg
static constexpr Register kSubTypeArgumentReg
static constexpr Register kInstanceTypeArgumentsReg
static constexpr Register kScratchReg
static constexpr Register kExceptionReg
static constexpr Register kSubtypeTestCacheReg
static constexpr Register kDstTypeReg
static constexpr Register kInstanceReg
static constexpr Register kFunctionTypeArgumentsReg
static constexpr Register kInstantiatorTypeArgumentsReg
static constexpr intptr_t kNonPreservedAbiRegisters
static constexpr Register kSubtypeTestCacheResultReg
static constexpr intptr_t kPreservedAbiRegisters
static constexpr Register kScratchReg
static constexpr intptr_t kAbiRegisters
static constexpr Register kInstanceOfResultReg