Flutter Engine
The Flutter Engine
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 WIDTH8 = 0b000,
803 WIDTH16 = 0b001,
804 WIDTH32 = 0b010,
805 WIDTH64 = 0b011,
806
807 S = 0b010,
808 D = 0b011,
809 J = 0b000,
810 JN = 0b001,
811 JX = 0b010,
812 FMIN = 0b000,
813 FMAX = 0b001,
814 FEQ = 0b010,
815 FLT = 0b001,
816 FLE = 0b000,
817
818 SH1ADD = 0b010,
819 SH2ADD = 0b100,
820 SH3ADD = 0b110,
821
822 F3_COUNT = 0b001,
823
824 MAX = 0b110,
825 MAXU = 0b111,
826 MIN = 0b100,
827 MINU = 0b101,
828 CLMUL = 0b001,
829 CLMULH = 0b011,
830 CLMULR = 0b010,
831
832 SEXT = 0b001,
833 ZEXT = 0b100,
834
835 ROL = 0b001,
836 ROR = 0b101,
837
838 BCLR = 0b001,
839 BEXT = 0b101,
840 F3_BINV = 0b001,
841 F3_BSET = 0b001,
842};
843
844enum Funct7 {
845 F7_0 = 0,
846 SRA = 0b0100000,
847 SUB = 0b0100000,
848 MULDIV = 0b0000001,
849
850 FADDS = 0b0000000,
851 FSUBS = 0b0000100,
852 FMULS = 0b0001000,
853 FDIVS = 0b0001100,
854 FSQRTS = 0b0101100,
855 FSGNJS = 0b0010000,
856 FMINMAXS = 0b0010100,
857 FCMPS = 0b1010000,
858 FCLASSS = 0b1110000,
859 FCVTintS = 0b1100000,
860 FCVTSint = 0b1101000,
861 FMVXW = 0b1110000,
862 FMVWX = 0b1111000,
863
864 FADDD = 0b0000001,
865 FSUBD = 0b0000101,
866 FMULD = 0b0001001,
867 FDIVD = 0b0001101,
868 FSQRTD = 0b0101101,
869 FSGNJD = 0b0010001,
870 FMINMAXD = 0b0010101,
871 FCVTS = 0b0100000,
872 FCVTD = 0b0100001,
873 FCMPD = 0b1010001,
874 FCLASSD = 0b1110001,
875 FCVTintD = 0b1100001,
876 FCVTDint = 0b1101001,
877 FMVXD = 0b1110001,
878 FMVDX = 0b1111001,
879
880 ADDUW = 0b0000100,
881 SHADD = 0b0010000,
882 SLLIUW = 0b0000100,
883 COUNT = 0b0110000,
884 MINMAXCLMUL = 0b0000101,
885 ROTATE = 0b0110000,
886 BCLRBEXT = 0b0100100,
887 BINV = 0b0110100,
888 BSET = 0b0010100,
889};
890
891enum Funct5 {
892 LR = 0b00010,
893 SC = 0b00011,
894 AMOSWAP = 0b00001,
895 AMOADD = 0b00000,
896 AMOXOR = 0b00100,
897 AMOAND = 0b01100,
898 AMOOR = 0b01000,
899 AMOMIN = 0b10000,
900 AMOMAX = 0b10100,
901 AMOMINU = 0b11000,
902 AMOMAXU = 0b11100,
903 LOADORDERED = 0b00110,
904 STOREORDERED = 0b00111,
905};
906
907enum Funct2 {
908 F2_S = 0b00,
909 F2_D = 0b01,
910};
911
913 RNE = 0b000, // Round to Nearest, ties to Even
914 RTZ = 0b001, // Round toward Zero
915 RDN = 0b010, // Round Down (toward negative infinity)
916 RUP = 0b011, // Round Up (toward positive infinity)
917 RMM = 0b100, // Round to nearest, ties to Max Magnitude
918 DYN = 0b111, // Dynamic rounding mode
919};
920
922 W = 0b00000,
923 WU = 0b00001,
924 L = 0b00010,
925 LU = 0b00011,
926};
927
928enum FClass {
939};
940
942 kWrite = 1 << 0,
943 kRead = 1 << 1,
944 kOutput = 1 << 2,
945 kInput = 1 << 3,
949};
950
951const intptr_t kReleaseShift = 25;
952const intptr_t kAcquireShift = 26;
953
954#define DEFINE_REG_ENCODING(type, name, shift) \
955 inline bool Is##name(type r) { \
956 return static_cast<uint32_t>(r) < 32; \
957 } \
958 inline uint32_t Encode##name(type r) { \
959 ASSERT(Is##name(r)); \
960 return static_cast<uint32_t>(r) << shift; \
961 } \
962 inline type Decode##name(uint32_t encoding) { \
963 return type((encoding >> shift) & 31); \
964 }
965
973#undef DEFINE_REG_ENCODING
974
975#define DEFINE_FUNCT_ENCODING(type, name, shift, mask) \
976 inline bool Is##name(type f) { \
977 return (f & mask) == f; \
978 } \
979 inline uint32_t Encode##name(type f) { \
980 ASSERT(Is##name(f)); \
981 return f << shift; \
982 } \
983 inline type Decode##name(uint32_t encoding) { \
984 return static_cast<type>((encoding >> shift) & mask); \
985 }
986
993#if XLEN == 32
994DEFINE_FUNCT_ENCODING(uint32_t, Shamt, 20, 0x1F)
995#elif XLEN == 64
996DEFINE_FUNCT_ENCODING(uint32_t, Shamt, 20, 0x3F)
997#endif
999#undef DEFINE_FUNCT_ENCODING
1000
1001inline intx_t ImmLo(intx_t imm) {
1002 return static_cast<intx_t>(static_cast<uintx_t>(imm) << (XLEN - 12)) >>
1003 (XLEN - 12);
1004}
1005inline intx_t ImmHi(intx_t imm) {
1006 return static_cast<intx_t>(
1007 (static_cast<uintx_t>(imm) - static_cast<uintx_t>(ImmLo(imm)))
1008 << (XLEN - 32)) >>
1009 (XLEN - 32);
1010}
1011
1012inline bool IsBTypeImm(intptr_t imm) {
1013 return Utils::IsInt(12, imm) && Utils::IsAligned(imm, 2);
1014}
1015inline uint32_t EncodeBTypeImm(intptr_t imm) {
1016 ASSERT(IsBTypeImm(imm));
1017 uint32_t encoded = 0;
1018 encoded |= ((imm >> 12) & 0x1) << 31;
1019 encoded |= ((imm >> 5) & 0x3f) << 25;
1020 encoded |= ((imm >> 1) & 0xf) << 8;
1021 encoded |= ((imm >> 11) & 0x1) << 7;
1022 return encoded;
1023}
1024inline intptr_t DecodeBTypeImm(uint32_t encoded) {
1025 uint32_t imm = 0;
1026 imm |= (((encoded >> 31) & 0x1) << 12);
1027 imm |= (((encoded >> 25) & 0x3f) << 5);
1028 imm |= (((encoded >> 8) & 0xf) << 1);
1029 imm |= (((encoded >> 7) & 0x1) << 11);
1030 return SignExtend(12, imm);
1031}
1032
1033inline bool IsJTypeImm(intptr_t imm) {
1034 return Utils::IsInt(20, imm) && Utils::IsAligned(imm, 2);
1035}
1036inline uint32_t EncodeJTypeImm(intptr_t imm) {
1037 ASSERT(IsJTypeImm(imm));
1038 uint32_t encoded = 0;
1039 encoded |= ((imm >> 20) & 0x1) << 31;
1040 encoded |= ((imm >> 1) & 0x3ff) << 21;
1041 encoded |= ((imm >> 11) & 0x1) << 20;
1042 encoded |= ((imm >> 12) & 0xff) << 12;
1043 return encoded;
1044}
1045inline intptr_t DecodeJTypeImm(uint32_t encoded) {
1046 uint32_t imm = 0;
1047 imm |= (((encoded >> 31) & 0x1) << 20);
1048 imm |= (((encoded >> 21) & 0x3ff) << 1);
1049 imm |= (((encoded >> 20) & 0x1) << 11);
1050 imm |= (((encoded >> 12) & 0xff) << 12);
1051 return SignExtend(20, imm);
1052}
1053
1054inline bool IsITypeImm(intptr_t imm) {
1055 return Utils::IsInt(12, imm);
1056}
1057inline uint32_t EncodeITypeImm(intptr_t imm) {
1058 ASSERT(IsITypeImm(imm));
1059 return static_cast<uint32_t>(imm) << 20;
1060}
1061inline intptr_t DecodeITypeImm(uint32_t encoded) {
1062 return SignExtend(12, encoded >> 20);
1063}
1064
1065inline bool IsUTypeImm(intptr_t imm) {
1066 return Utils::IsInt(32, imm) && Utils::IsAligned(imm, 1 << 12);
1067}
1068inline uint32_t EncodeUTypeImm(intptr_t imm) {
1069 ASSERT(IsUTypeImm(imm));
1070 return imm;
1071}
1072inline intptr_t DecodeUTypeImm(uint32_t encoded) {
1073 return SignExtend(32, encoded & ~((1 << 12) - 1));
1074}
1075
1076inline bool IsSTypeImm(intptr_t imm) {
1077 return Utils::IsInt(12, imm);
1078}
1079inline uint32_t EncodeSTypeImm(intptr_t imm) {
1080 ASSERT(IsSTypeImm(imm));
1081 uint32_t encoded = 0;
1082 encoded |= ((imm >> 5) & 0x7f) << 25;
1083 encoded |= ((imm >> 0) & 0x1f) << 7;
1084 return encoded;
1085}
1086inline intptr_t DecodeSTypeImm(uint32_t encoded) {
1087 uint32_t imm = 0;
1088 imm |= (((encoded >> 25) & 0x7f) << 5);
1089 imm |= (((encoded >> 7) & 0x1f) << 0);
1090 return SignExtend(12, imm);
1091}
1092
1093inline bool IsCInstruction(uint16_t parcel) {
1094 return (parcel & 3) != 3;
1095}
1096
1097class Instr {
1098 public:
1099 explicit Instr(uint32_t encoding) : encoding_(encoding) {}
1100 uint32_t encoding() const { return encoding_; }
1101
1102 size_t length() const { return 4; }
1103
1104 Opcode opcode() const { return DecodeOpcode(encoding_); }
1105
1106 Register rd() const { return DecodeRd(encoding_); }
1107 Register rs1() const { return DecodeRs1(encoding_); }
1108 Register rs2() const { return DecodeRs2(encoding_); }
1109
1110 FRegister frd() const { return DecodeFRd(encoding_); }
1111 FRegister frs1() const { return DecodeFRs1(encoding_); }
1112 FRegister frs2() const { return DecodeFRs2(encoding_); }
1113 FRegister frs3() const { return DecodeFRs3(encoding_); }
1114
1115 Funct2 funct2() const { return DecodeFunct2(encoding_); }
1116 Funct3 funct3() const { return DecodeFunct3(encoding_); }
1117 Funct5 funct5() const { return DecodeFunct5(encoding_); }
1118 Funct7 funct7() const { return DecodeFunct7(encoding_); }
1119 Funct12 funct12() const { return DecodeFunct12(encoding_); }
1120
1121 uint32_t shamt() const { return DecodeShamt(encoding_); }
1122 RoundingMode rounding() const { return DecodeRoundingMode(encoding_); }
1123
1124 std::memory_order memory_order() const {
1125 bool acquire = ((encoding_ >> kAcquireShift) & 1) != 0;
1126 bool release = ((encoding_ >> kReleaseShift) & 1) != 0;
1127 if (acquire && release) return std::memory_order_acq_rel;
1128 if (acquire) return std::memory_order_acquire;
1129 if (release) return std::memory_order_release;
1130 return std::memory_order_relaxed;
1131 }
1132
1133 intx_t itype_imm() const { return DecodeITypeImm(encoding_); }
1134 intx_t stype_imm() const { return DecodeSTypeImm(encoding_); }
1135 intx_t btype_imm() const { return DecodeBTypeImm(encoding_); }
1136 intx_t utype_imm() const { return DecodeUTypeImm(encoding_); }
1137 intx_t jtype_imm() const { return DecodeJTypeImm(encoding_); }
1138
1139 uint32_t csr() const { return encoding_ >> 20; }
1140 uint32_t zimm() const { return rs1(); }
1141
1142 static constexpr uint32_t kBreakPointInstruction = 0;
1143 static constexpr uint32_t kInstrSize = 4;
1144 static constexpr uint32_t kSimulatorRedirectInstruction =
1145 ECALL << 20 | SYSTEM;
1146
1147 private:
1148 const uint32_t encoding_;
1149};
1150
1151#define DEFINE_REG_ENCODING(type, name, shift) \
1152 inline bool Is##name(type r) { \
1153 return static_cast<uint32_t>(r) < 32; \
1154 } \
1155 inline uint32_t Encode##name(type r) { \
1156 ASSERT(Is##name(r)); \
1157 return static_cast<uint32_t>(r) << shift; \
1158 } \
1159 inline type Decode##name(uint32_t encoding) { \
1160 return type((encoding >> shift) & 31); \
1161 }
1162
1163#define DEFINE_REG_PRIME_ENCODING(type, name, shift) \
1164 inline bool Is##name(type r) { \
1165 return (r >= 8) && (r < 16); \
1166 } \
1167 inline uint32_t Encode##name(type r) { \
1168 ASSERT(Is##name(r)); \
1169 return (static_cast<uint32_t>(r) & 7) << shift; \
1170 } \
1171 inline type Decode##name(uint32_t encoding) { \
1172 return type(((encoding >> shift) & 7) + 8); \
1173 }
1174
1187#undef DEFINE_REG_ENCODING
1188#undef DEFINE_REG_PRIME_ENCODING
1189
1190inline bool IsCSPLoad4Imm(intptr_t imm) {
1191 return Utils::IsUint(8, imm) && Utils::IsAligned(imm, 4);
1192}
1193inline uint32_t EncodeCSPLoad4Imm(intptr_t imm) {
1194 ASSERT(IsCSPLoad4Imm(imm));
1195 uint32_t encoding = 0;
1196 encoding |= ((imm >> 5) & 0x1) << 12;
1197 encoding |= ((imm >> 2) & 0x7) << 4;
1198 encoding |= ((imm >> 6) & 0x3) << 2;
1199 return encoding;
1200}
1201inline intx_t DecodeCSPLoad4Imm(uint32_t encoding) {
1202 uint32_t imm = 0;
1203 imm |= ((encoding >> 12) & 0x1) << 5;
1204 imm |= ((encoding >> 4) & 0x7) << 2;
1205 imm |= ((encoding >> 2) & 0x3) << 6;
1206 return imm;
1207}
1208
1209inline bool IsCSPLoad8Imm(intptr_t imm) {
1210 return Utils::IsUint(9, imm) && Utils::IsAligned(imm, 8);
1211}
1212inline uint32_t EncodeCSPLoad8Imm(intptr_t imm) {
1213 ASSERT(IsCSPLoad8Imm(imm));
1214 uint32_t encoding = 0;
1215 encoding |= ((imm >> 5) & 0x1) << 12;
1216 encoding |= ((imm >> 3) & 0x3) << 5;
1217 encoding |= ((imm >> 6) & 0x7) << 2;
1218 return encoding;
1219}
1220inline intx_t DecodeCSPLoad8Imm(uint32_t encoding) {
1221 uint32_t imm = 0;
1222 imm |= ((encoding >> 12) & 0x1) << 5;
1223 imm |= ((encoding >> 5) & 0x3) << 3;
1224 imm |= ((encoding >> 2) & 0x7) << 6;
1225 return imm;
1226}
1227
1228inline bool IsCSPStore4Imm(intptr_t imm) {
1229 return Utils::IsUint(8, imm) && Utils::IsAligned(imm, 4);
1230}
1231inline uint32_t EncodeCSPStore4Imm(intptr_t imm) {
1232 ASSERT(IsCSPStore4Imm(imm));
1233 uint32_t encoding = 0;
1234 encoding |= ((imm >> 2) & 0xF) << 9;
1235 encoding |= ((imm >> 6) & 0x3) << 7;
1236 return encoding;
1237}
1238inline intx_t DecodeCSPStore4Imm(uint32_t encoding) {
1239 uint32_t imm = 0;
1240 imm |= ((encoding >> 9) & 0xF) << 2;
1241 imm |= ((encoding >> 7) & 0x3) << 6;
1242 return imm;
1243}
1244
1245inline bool IsCSPStore8Imm(intptr_t imm) {
1246 return Utils::IsUint(9, imm) && Utils::IsAligned(imm, 8);
1247}
1248inline uint32_t EncodeCSPStore8Imm(intptr_t imm) {
1249 ASSERT(IsCSPStore8Imm(imm));
1250 uint32_t encoding = 0;
1251 encoding |= ((imm >> 3) & 0x7) << 10;
1252 encoding |= ((imm >> 6) & 0x7) << 7;
1253 return encoding;
1254}
1255inline intx_t DecodeCSPStore8Imm(uint32_t encoding) {
1256 uint32_t imm = 0;
1257 imm |= ((encoding >> 10) & 0x7) << 3;
1258 imm |= ((encoding >> 7) & 0x7) << 6;
1259 return imm;
1260}
1261
1262inline bool IsCMem4Imm(intptr_t imm) {
1263 return Utils::IsUint(7, imm) && Utils::IsAligned(imm, 4);
1264}
1265inline uint32_t EncodeCMem4Imm(intptr_t imm) {
1266 ASSERT(IsCMem4Imm(imm));
1267 uint32_t encoding = 0;
1268 encoding |= ((imm >> 3) & 0x7) << 10;
1269 encoding |= ((imm >> 2) & 0x1) << 6;
1270 encoding |= ((imm >> 6) & 0x1) << 5;
1271 return encoding;
1272}
1273inline intx_t DecodeCMem4Imm(uint32_t encoding) {
1274 uint32_t imm = 0;
1275 imm |= ((encoding >> 10) & 0x7) << 3;
1276 imm |= ((encoding >> 6) & 0x1) << 2;
1277 imm |= ((encoding >> 5) & 0x1) << 6;
1278 return imm;
1279}
1280
1281inline bool IsCMem8Imm(intptr_t imm) {
1282 return Utils::IsUint(8, imm) && Utils::IsAligned(imm, 8);
1283}
1284inline uint32_t EncodeCMem8Imm(intptr_t imm) {
1285 ASSERT(IsCMem8Imm(imm));
1286 uint32_t encoding = 0;
1287 encoding |= ((imm >> 3) & 0x7) << 10;
1288 encoding |= ((imm >> 6) & 0x3) << 5;
1289 return encoding;
1290}
1291inline intx_t DecodeCMem8Imm(uint32_t encoding) {
1292 uint32_t imm = 0;
1293 imm |= ((encoding >> 10) & 0x7) << 3;
1294 imm |= ((encoding >> 5) & 0x3) << 6;
1295 return imm;
1296}
1297
1298inline bool IsCJImm(intptr_t imm) {
1299 return Utils::IsInt(11, imm) && Utils::IsAligned(imm, 2);
1300}
1301inline uint32_t EncodeCJImm(intptr_t imm) {
1302 ASSERT(IsCJImm(imm));
1303 uint32_t encoding = 0;
1304 encoding |= ((imm >> 11) & 0x1) << 12;
1305 encoding |= ((imm >> 4) & 0x1) << 11;
1306 encoding |= ((imm >> 8) & 0x3) << 9;
1307 encoding |= ((imm >> 10) & 0x1) << 8;
1308 encoding |= ((imm >> 6) & 0x1) << 7;
1309 encoding |= ((imm >> 7) & 0x1) << 6;
1310 encoding |= ((imm >> 1) & 0x7) << 3;
1311 encoding |= ((imm >> 5) & 0x1) << 2;
1312 return encoding;
1313}
1314inline intx_t DecodeCJImm(uint32_t encoding) {
1315 uint32_t imm = 0;
1316 imm |= ((encoding >> 12) & 0x1) << 11;
1317 imm |= ((encoding >> 11) & 0x1) << 4;
1318 imm |= ((encoding >> 9) & 0x3) << 8;
1319 imm |= ((encoding >> 8) & 0x1) << 10;
1320 imm |= ((encoding >> 7) & 0x1) << 6;
1321 imm |= ((encoding >> 6) & 0x1) << 7;
1322 imm |= ((encoding >> 3) & 0x7) << 1;
1323 imm |= ((encoding >> 2) & 0x1) << 5;
1324 return SignExtend(11, imm);
1325}
1326
1327inline bool IsCBImm(intptr_t imm) {
1328 return Utils::IsInt(8, imm) && Utils::IsAligned(imm, 2);
1329}
1330inline uint32_t EncodeCBImm(intptr_t imm) {
1331 ASSERT(IsCBImm(imm));
1332 uint32_t encoding = 0;
1333 encoding |= ((imm >> 8) & 0x1) << 12;
1334 encoding |= ((imm >> 3) & 0x3) << 10;
1335 encoding |= ((imm >> 6) & 0x3) << 5;
1336 encoding |= ((imm >> 1) & 0x3) << 3;
1337 encoding |= ((imm >> 5) & 0x1) << 2;
1338 return encoding;
1339}
1340inline intx_t DecodeCBImm(uint32_t encoding) {
1341 uint32_t imm = 0;
1342 imm |= ((encoding >> 12) & 0x1) << 8;
1343 imm |= ((encoding >> 10) & 0x3) << 3;
1344 imm |= ((encoding >> 5) & 0x3) << 6;
1345 imm |= ((encoding >> 3) & 0x3) << 1;
1346 imm |= ((encoding >> 2) & 0x1) << 5;
1347 return SignExtend(8, imm);
1348}
1349
1350inline bool IsCIImm(intptr_t imm) {
1351 return Utils::IsInt(6, imm) && Utils::IsAligned(imm, 1);
1352}
1353inline uint32_t EncodeCIImm(intptr_t imm) {
1354 ASSERT(IsCIImm(imm));
1355 uint32_t encoding = 0;
1356 encoding |= ((imm >> 5) & 0x1) << 12;
1357 encoding |= ((imm >> 0) & 0x1F) << 2;
1358 return encoding;
1359}
1360inline intx_t DecodeCIImm(uint32_t encoding) {
1361 uint32_t imm = 0;
1362 imm |= ((encoding >> 12) & 0x1) << 5;
1363 imm |= ((encoding >> 2) & 0x1F) << 0;
1364 return SignExtend(6, imm);
1365}
1366
1367inline bool IsCUImm(intptr_t imm) {
1368 return Utils::IsInt(17, imm) && Utils::IsAligned(imm, 1 << 12);
1369}
1370inline uint32_t EncodeCUImm(intptr_t imm) {
1371 ASSERT(IsCUImm(imm));
1372 uint32_t encoding = 0;
1373 encoding |= ((imm >> 17) & 0x1) << 12;
1374 encoding |= ((imm >> 12) & 0x1F) << 2;
1375 return encoding;
1376}
1377inline intx_t DecodeCUImm(uint32_t encoding) {
1378 uint32_t imm = 0;
1379 imm |= ((encoding >> 12) & 0x1) << 17;
1380 imm |= ((encoding >> 2) & 0x1F) << 12;
1381 return SignExtend(17, imm);
1382}
1383
1384inline bool IsCI16Imm(intptr_t imm) {
1385 return Utils::IsInt(10, imm) && Utils::IsAligned(imm, 16);
1386}
1387inline uint32_t EncodeCI16Imm(intptr_t imm) {
1388 ASSERT(IsCI16Imm(imm));
1389 uint32_t encoding = 0;
1390 encoding |= ((imm >> 9) & 0x1) << 12;
1391 encoding |= ((imm >> 4) & 0x1) << 6;
1392 encoding |= ((imm >> 6) & 0x1) << 5;
1393 encoding |= ((imm >> 7) & 0x3) << 3;
1394 encoding |= ((imm >> 5) & 0x1) << 2;
1395 return encoding;
1396}
1397inline intx_t DecodeCI16Imm(uint32_t encoding) {
1398 uint32_t imm = 0;
1399 imm |= ((encoding >> 12) & 0x1) << 9;
1400 imm |= ((encoding >> 6) & 0x1) << 4;
1401 imm |= ((encoding >> 5) & 0x1) << 6;
1402 imm |= ((encoding >> 3) & 0x3) << 7;
1403 imm |= ((encoding >> 2) & 0x1) << 5;
1404 return SignExtend(10, imm);
1405}
1406
1407inline bool IsCI4SPNImm(intptr_t imm) {
1408 return Utils::IsUint(9, imm) && Utils::IsAligned(imm, 4);
1409}
1410inline uint32_t EncodeCI4SPNImm(intptr_t imm) {
1411 ASSERT(IsCI4SPNImm(imm));
1412 uint32_t encoding = 0;
1413 encoding |= ((imm >> 4) & 0x3) << 11;
1414 encoding |= ((imm >> 6) & 0xF) << 7;
1415 encoding |= ((imm >> 2) & 0x1) << 6;
1416 encoding |= ((imm >> 3) & 0x1) << 5;
1417 return encoding;
1418}
1419inline intx_t DecodeCI4SPNImm(uint32_t encoding) {
1420 uint32_t imm = 0;
1421 imm |= ((encoding >> 11) & 0x3) << 4;
1422 imm |= ((encoding >> 7) & 0xF) << 6;
1423 imm |= ((encoding >> 6) & 0x1) << 2;
1424 imm |= ((encoding >> 5) & 0x1) << 3;
1425 return imm;
1426}
1427
1429 C_OP_MASK = 0b1110000000000011,
1430
1431 C_ADDI4SPN = 0b0000000000000000,
1432 C_FLD = 0b0010000000000000,
1433 C_LW = 0b0100000000000000,
1434 C_FLW = 0b0110000000000000,
1435 C_LD = 0b0110000000000000,
1436 C_FSD = 0b1010000000000000,
1437 C_SW = 0b1100000000000000,
1438 C_FSW = 0b1110000000000000,
1439 C_SD = 0b1110000000000000,
1440
1441 C_ADDI = 0b0000000000000001,
1442 C_JAL = 0b0010000000000001,
1443 C_ADDIW = 0b0010000000000001,
1444 C_LI = 0b0100000000000001,
1445 C_ADDI16SP = 0b0110000000000001,
1446 C_LUI = 0b0110000000000001,
1447
1448 C_MISCALU = 0b1000000000000001,
1449 C_MISCALU_MASK = 0b1110110000000011,
1450 C_SRLI = 0b1000000000000001,
1451 C_SRAI = 0b1000010000000001,
1452 C_ANDI = 0b1000100000000001,
1453 C_RR = 0b1000110000000001,
1454 C_RR_MASK = 0b1111110001100011,
1455 C_SUB = 0b1000110000000001,
1456 C_XOR = 0b1000110000100001,
1457 C_OR = 0b1000110001000001,
1458 C_AND = 0b1000110001100001,
1459 C_SUBW = 0b1001110000000001,
1460 C_ADDW = 0b1001110000100001,
1461
1462 C_J = 0b1010000000000001,
1463 C_BEQZ = 0b1100000000000001,
1464 C_BNEZ = 0b1110000000000001,
1465
1466 C_SLLI = 0b0000000000000010,
1467 C_FLDSP = 0b0010000000000010,
1468 C_LWSP = 0b0100000000000010,
1469 C_FLWSP = 0b0110000000000010,
1470 C_LDSP = 0b0110000000000010,
1471 C_JR = 0b1000000000000010,
1472 C_MV = 0b1000000000000010,
1473 C_JALR = 0b1001000000000010,
1474 C_ADD = 0b1001000000000010,
1475 C_FSDSP = 0b1010000000000010,
1476 C_SWSP = 0b1100000000000010,
1477 C_FSWSP = 0b1110000000000010,
1478 C_SDSP = 0b1110000000000010,
1479
1480 C_NOP = 0b0000000000000001,
1481 C_EBREAK = 0b1001000000000010,
1482};
1483
1484class CInstr {
1485 public:
1486 explicit CInstr(uint16_t encoding) : encoding_(encoding) {}
1487 uint16_t encoding() const { return encoding_; }
1488
1489 static constexpr uint32_t kInstrSize = 2;
1490 size_t length() const { return kInstrSize; }
1491
1492 COpcode opcode() const { return COpcode(encoding_ & C_OP_MASK); }
1493
1494 Register rd() const { return DecodeCRd(encoding_); }
1495 Register rs1() const { return DecodeCRd(encoding_); }
1496 Register rs2() const { return DecodeCRs2(encoding_); }
1497 Register rdp() const { return DecodeCRdp(encoding_); }
1498 Register rs1p() const { return DecodeCRs1p(encoding_); }
1499 Register rs2p() const { return DecodeCRs2p(encoding_); }
1500 FRegister frd() const { return DecodeCFRd(encoding_); }
1501 FRegister frs1() const { return DecodeCFRd(encoding_); }
1502 FRegister frs2() const { return DecodeCFRs2(encoding_); }
1503 FRegister frdp() const { return DecodeCFRdp(encoding_); }
1504 FRegister frs1p() const { return DecodeCFRs1p(encoding_); }
1505 FRegister frs2p() const { return DecodeCFRs2p(encoding_); }
1506
1507 intx_t spload4_imm() { return DecodeCSPLoad4Imm(encoding_); }
1508 intx_t spload8_imm() { return DecodeCSPLoad8Imm(encoding_); }
1509 intx_t spstore4_imm() { return DecodeCSPStore4Imm(encoding_); }
1510 intx_t spstore8_imm() { return DecodeCSPStore8Imm(encoding_); }
1511 intx_t mem4_imm() { return DecodeCMem4Imm(encoding_); }
1512 intx_t mem8_imm() { return DecodeCMem8Imm(encoding_); }
1513 intx_t j_imm() { return DecodeCJImm(encoding_); }
1514 intx_t b_imm() { return DecodeCBImm(encoding_); }
1515 intx_t i_imm() { return DecodeCIImm(encoding_); }
1516 intx_t u_imm() { return DecodeCUImm(encoding_); }
1517 intx_t i16_imm() { return DecodeCI16Imm(encoding_); }
1518 intx_t i4spn_imm() { return DecodeCI4SPNImm(encoding_); }
1519
1520 private:
1521 const uint16_t encoding_;
1522};
1523
1524#define DEFINE_TYPED_ENUM_SET(name, storage_t) \
1525 class name##Set; \
1526 class name { \
1527 public: \
1528 constexpr explicit name(storage_t encoding) : encoding_(encoding) {} \
1529 constexpr storage_t encoding() const { \
1530 return encoding_; \
1531 } \
1532 constexpr bool operator==(const name& other) const { \
1533 return encoding_ == other.encoding_; \
1534 } \
1535 constexpr bool operator!=(const name& other) const { \
1536 return encoding_ != other.encoding_; \
1537 } \
1538 inline constexpr name##Set operator|(const name& other) const; \
1539 inline constexpr name##Set operator|(const name##Set& other) const; \
1540 \
1541 private: \
1542 const storage_t encoding_; \
1543 }; \
1544 inline std::ostream& operator<<(std::ostream& stream, const name& element) { \
1545 return stream << #name << "(" << element.encoding() << ")"; \
1546 } \
1547 class name##Set { \
1548 public: \
1549 constexpr /* implicit */ name##Set(name element) \
1550 : encoding_(1u << element.encoding()) {} \
1551 constexpr explicit name##Set(storage_t encoding) : encoding_(encoding) {} \
1552 constexpr static name##Set Empty() { \
1553 return name##Set(0); \
1554 } \
1555 constexpr bool Includes(const name r) const { \
1556 return (encoding_ & (1 << r.encoding())) != 0; \
1557 } \
1558 constexpr bool IncludesAll(const name##Set other) const { \
1559 return (encoding_ & other.encoding_) == other.encoding_; \
1560 } \
1561 constexpr bool IsEmpty() const { \
1562 return encoding_ == 0; \
1563 } \
1564 constexpr bool operator==(const name##Set& other) const { \
1565 return encoding_ == other.encoding_; \
1566 } \
1567 constexpr bool operator!=(const name##Set& other) const { \
1568 return encoding_ != other.encoding_; \
1569 } \
1570 constexpr name##Set operator|(const name& other) const { \
1571 return name##Set(encoding_ | (1 << other.encoding())); \
1572 } \
1573 constexpr name##Set operator|(const name##Set& other) const { \
1574 return name##Set(encoding_ | other.encoding_); \
1575 } \
1576 constexpr name##Set operator&(const name##Set& other) const { \
1577 return name##Set(encoding_ & other.encoding_); \
1578 } \
1579 \
1580 private: \
1581 storage_t encoding_; \
1582 }; \
1583 constexpr name##Set name::operator|(const name& other) const { \
1584 return name##Set((1u << encoding_) | (1u << other.encoding_)); \
1585 } \
1586 constexpr name##Set name::operator|(const name##Set& other) const { \
1587 return other | *this; \
1588 }
1589
1591static constexpr Extension RV_I(0); // Integer base
1592static constexpr Extension RV_M(1); // Multiply/divide
1593static constexpr Extension RV_A(2); // Atomic
1594static constexpr Extension RV_F(3); // Single-precision floating point
1595static constexpr Extension RV_D(4); // Double-precision floating point
1596static constexpr Extension RV_C(5); // Compressed instructions
1597static constexpr ExtensionSet RV_G = RV_I | RV_M | RV_A | RV_F | RV_D;
1598static constexpr ExtensionSet RV_GC = RV_G | RV_C;
1599static constexpr Extension RV_Zba(6); // Address generation
1600static constexpr Extension RV_Zbb(7); // Basic bit-manipulation
1601static constexpr Extension RV_Zbs(8); // Single-bit instructions
1602static constexpr ExtensionSet RV_B = RV_Zba | RV_Zbb | RV_Zbs;
1603static constexpr ExtensionSet RV_GCB = RV_GC | RV_B;
1604static constexpr Extension RV_Zbc(9); // Carry-less multiplication
1605static constexpr Extension RV_Zalasr(10); // Load-acquire, store-release
1606
1607#undef R
1608
1610 return r;
1611}
1612#define LINK_REGISTER RA
1613
1614// No information available.
1615const intptr_t kPreferredLoopAlignment = 1;
1616
1617} // namespace dart
1618
1619#endif // RUNTIME_VM_CONSTANTS_RISCV_H_
SweepLineTestingPeer TP
#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 i4spn_imm()
intx_t spstore8_imm()
intx_t spload4_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
intx_t spload8_imm()
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:313
static constexpr int CountOneBits32(uint32_t x)
Definition: utils.h:160
static bool IsUint(intptr_t N, T value)
Definition: utils.h:328
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
Definition: utils.h:92
#define DEFINE_FUNCT_ENCODING(type, name, shift, mask)
#define DEFINE_REG_ENCODING(type, name, shift)
#define R(reg)
#define DEFINE_TYPED_ENUM_SET(name, storage_t)
#define DEFINE_REG_PRIME_ENCODING(type, name, shift)
#define ASSERT(E)
uint8_t value
double x
Definition: dart_vm.cc:33
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_16
@ TIMES_COMPRESSED_HALF_WORD_SIZE
@ TIMES_COMPRESSED_WORD_SIZE
bool IsCI16Imm(intptr_t imm)
const Register THR
static constexpr Extension RV_F(3)
@ STOREORDERED
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)
intptr_t DecodeBTypeImm(uint32_t encoded)
intx_t DecodeCMem8Imm(uint32_t encoding)
const RegList kReservedCpuRegisters
const Register kWriteBarrierObjectReg
static constexpr Extension RV_Zbc(9)
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
@ C_MISCALU_MASK
uintptr_t uword
Definition: globals.h:501
const Register CODE_REG
constexpr uword kBreakInstructionFiller
@ kNoCondition
@ OVERFLOW
@ GREATER_EQUAL
@ UNSIGNED_GREATER
@ kInvalidCondition
@ UNSIGNED_GREATER_EQUAL
@ NOT_ZERO
@ NO_OVERFLOW
@ LESS_EQUAL
@ UNSIGNED_LESS
@ NOT_EQUAL
@ kNumberOfConditions
@ UNSIGNED_LESS_EQUAL
const Register TMP2
const Register ARGS_DESC_REG
static constexpr Extension RV_Zalasr(10)
const Register DISPATCH_TABLE_REG
@ kNumberOfCpuRegisters
Definition: constants_arm.h:98
@ kNoRegister
Definition: constants_arm.h:99
const int kNumberOfFpuRegisters
const RegList kAbiPreservedCpuRegs
intptr_t DecodeITypeImm(uint32_t encoded)
constexpr RegList kAbiArgumentFpuRegs
intx_t sign_extend(int32_t x)
@ kFClassNegZero
@ kFClassNegSubnormal
@ kFClassPosInfinity
@ kFClassQuietNan
@ kFClassSignallingNan
@ kFClassPosZero
@ 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
static constexpr Extension RV_Zbs(8)
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
COMPILE_ASSERT(kUnreachableReference==WeakTable::kNoValue)
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
DECLARE_FLAG(bool, show_invisible_frames)
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