v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
base-constants-riscv.h
Go to the documentation of this file.
1// Copyright 2022 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_CODEGEN_RISCV_BASE_CONSTANTS_RISCV_H_
6#define V8_CODEGEN_RISCV_BASE_CONSTANTS_RISCV_H_
7
8#include "src/base/logging.h"
9#include "src/base/macros.h"
10#include "src/common/globals.h"
11#include "src/flags/flags.h"
12
13#ifdef DEBUG
14#define UNIMPLEMENTED_RISCV() \
15 v8::internal::PrintF("%s, \tline %d: \tfunction %s not implemented. \n", \
16 __FILE__, __LINE__, __func__);
17#else
18#define UNIMPLEMENTED_RISCV()
19#endif
20
21#define UNSUPPORTED_RISCV() \
22 v8::internal::PrintF("Unsupported instruction %d.\n", __LINE__); \
23 UNIMPLEMENTED();
24
26
27#if defined(V8_TARGET_LITTLE_ENDIAN)
28static const Endianness kArchEndian = kLittle;
29#elif defined(V8_TARGET_BIG_ENDIAN)
30static const Endianness kArchEndian = kBig;
31#else
32#error Unknown endianness
33#endif
34
35#if defined(V8_TARGET_LITTLE_ENDIAN)
36const uint32_t kLeastSignificantByteInInt32Offset = 0;
37const uint32_t kLessSignificantWordInDoublewordOffset = 0;
38#elif defined(V8_TARGET_BIG_ENDIAN)
39const uint32_t kLeastSignificantByteInInt32Offset = 3;
40const uint32_t kLessSignificantWordInDoublewordOffset = 4;
41#else
42#error Unknown endianness
43#endif
44
45#ifndef __STDC_FORMAT_MACROS
46#define __STDC_FORMAT_MACROS
47#endif
48#include <inttypes.h>
49
50// Defines constants and accessor classes to assemble, disassemble and
51// simulate RISC-V instructions.
52//
53// See: The RISC-V Instruction Set Manual
54// Volume I: User-Level ISA
55// Try https://content.riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf.
56namespace v8 {
57namespace internal {
58using Opcode = uint32_t;
59
60// Actual value of root register is offset from the root array's start
61// to take advantage of negative displacement values.
62constexpr int kRootRegisterBias = 256;
63
64#define RVV_LMUL(V) \
65 V(m1) \
66 V(m2) \
67 V(m4) \
68 V(m8) \
69 V(RESERVERD) \
70 V(mf8) \
71 V(mf4) \
72 V(mf2)
73
74enum Vlmul {
75#define DEFINE_FLAG(name) name,
77#undef DEFINE_FLAG
79};
80
81#define RVV_SEW(V) \
82 V(E8) \
83 V(E16) \
84 V(E32) \
85 V(E64)
86
87#define DEFINE_FLAG(name) name,
88enum VSew {
90#undef DEFINE_FLAG
92};
93
94// RISC-V can perform PC-relative jumps within a 32-bit range using the
95// following two instructions:
96// auipc t6, imm20 ; t0 = PC + imm20 * 2^12
97// jalr ra, t6, imm12; ra = PC + 4, PC = t0 + imm12,
98// Both imm20 and imm12 are treated as two's-complement signed values, usually
99// calculated as:
100// imm20 = (offset + 0x800) >> 12
101// imm12 = offset & 0xfff
102// offset is the signed offset from the auipc instruction. Adding 0x800 handles
103// the offset, but if the offset is >= 2^31 - 2^11, it will overflow. Therefore,
104// the true 32-bit range is:
105// [-2^31 - 2^11, 2^31 - 2^11)
106constexpr size_t kMaxPCRelativeCodeRangeInMB = 2047;
107
108// -----------------------------------------------------------------------------
109// Registers and FPURegisters.
110
111// Number of general purpose registers.
112const int kNumRegisters = 32;
113const int kInvalidRegister = -1;
114
115// Number of registers with pc.
116const int kNumSimuRegisters = 33;
117
118// In the simulator, the PC register is simulated as the 34th register.
119const int kPCRegister = 34;
120
121// Number coprocessor registers.
122const int kNumFPURegisters = 32;
123const int kInvalidFPURegister = -1;
124
125// Number vectotr registers
126const int kNumVRegisters = 32;
127const int kInvalidVRegister = -1;
128// 'pref' instruction hints
129const int32_t kPrefHintLoad = 0;
130const int32_t kPrefHintStore = 1;
131const int32_t kPrefHintLoadStreamed = 4;
132const int32_t kPrefHintStoreStreamed = 5;
133const int32_t kPrefHintLoadRetained = 6;
134const int32_t kPrefHintStoreRetained = 7;
135const int32_t kPrefHintWritebackInvalidate = 25;
136const int32_t kPrefHintPrepareForStore = 30;
137
138// Helper functions for converting between register numbers and names.
139class Registers {
140 public:
141 // Return the name of the register.
142 static const char* Name(int reg);
143
144 // Lookup the register number for the name provided.
145 static int Number(const char* name);
146
148 int reg;
149 const char* name;
150 };
151
152 private:
153 static const char* names_[kNumSimuRegisters];
154 static const RegisterAlias aliases_[];
155};
156
157// Helper functions for converting between register numbers and names.
159 public:
160 // Return the name of the register.
161 static const char* Name(int reg);
162
163 // Lookup the register number for the name provided.
164 static int Number(const char* name);
165
167 int creg;
168 const char* name;
169 };
170
171 private:
172 static const char* names_[kNumFPURegisters];
173 static const RegisterAlias aliases_[];
174};
175
177 public:
178 // Return the name of the register.
179 static const char* Name(int reg);
180
181 // Lookup the register number for the name provided.
182 static int Number(const char* name);
183
185 int creg;
186 const char* name;
187 };
188
189 private:
190 static const char* names_[kNumVRegisters];
191 static const RegisterAlias aliases_[];
192};
193
194// -----------------------------------------------------------------------------
195// Instructions encoding constants.
196
197// On RISCV all instructions are 32 bits, except for RVC.
198using Instr = int32_t;
199using ShortInstr = int16_t;
200
201// Special Software Interrupt codes when used in the presence of the RISC-V
202// simulator.
204 // Transition to C code.
205 call_rt_redirected = 0xfffff
206};
207
208// On RISC-V Simulator breakpoints can have different codes:
209// - Breaks between 0 and kMaxWatchpointCode are treated as simple watchpoints,
210// the simulator will run through them and print the registers.
211// - Breaks between kMaxWatchpointCode and kMaxStopCode are treated as stop()
212// instructions (see Assembler::stop()).
213// - Breaks larger than kMaxStopCode are simple breaks, dropping you into the
214// debugger.
215const uint32_t kMaxTracepointCode = 63;
216const uint32_t kMaxWatchpointCode = 31;
217// Indicate that the stack is being switched, so the simulator must update its
218// stack limit. The new stack limit is passed in t6.
219const uint32_t kExceptionIsSwitchStackLimit = 128;
220const uint32_t kMaxStopCode = 127;
221static_assert(kMaxWatchpointCode < kMaxStopCode);
222static_assert(kMaxTracepointCode < kMaxStopCode);
223
224// Debug parameters.
225//
226// For example:
227//
228// __ Debug(TRACE_ENABLE | LOG_TRACE);
229// starts tracing: set v8_flags.trace-sim is true.
230// __ Debug(TRACE_ENABLE | LOG_REGS);
231// PrintAllregs.
232// __ Debug(TRACE_DISABLE | LOG_TRACE);
233// stops tracing: set v8_flags.trace-sim is false.
234const unsigned kDebuggerTracingDirectivesMask = 0b111 << 3;
235enum DebugParameters : uint32_t {
236 NO_PARAM = 1 << 5,
237 BREAK = 1 << 0,
238 LOG_TRACE = 1 << 1,
239 LOG_REGS = 1 << 2,
241 // Trace control.
242 TRACE_ENABLE = 1 << 3 | NO_PARAM,
243 TRACE_DISABLE = 1 << 4 | NO_PARAM,
244};
245
246// ----- Fields offset and length.
247// RISCV constants
248const int kBaseOpcodeShift = 0;
249const int kBaseOpcodeBits = 7;
250const int kFunct6Shift = 26;
251const int kFunct6Bits = 6;
252const int kFunct7Shift = 25;
253const int kFunct7Bits = 7;
254const int kFunct5Shift = 27;
255const int kFunct5Bits = 5;
256const int kFunct3Shift = 12;
257const int kFunct3Bits = 3;
258const int kFunct2Shift = 25;
259const int kFunct2Bits = 2;
260const int kRs1Shift = 15;
261const int kRs1Bits = 5;
262const int kVs1Shift = 15;
263const int kVs1Bits = 5;
264const int kVs2Shift = 20;
265const int kVs2Bits = 5;
266const int kVdShift = 7;
267const int kVdBits = 5;
268const int kRs2Shift = 20;
269const int kRs2Bits = 5;
270const int kRs3Shift = 27;
271const int kRs3Bits = 5;
272const int kRdShift = 7;
273const int kRdBits = 5;
274const int kRlShift = 25;
275const int kAqShift = 26;
276const int kImm12Shift = 20;
277const int kImm12Bits = 12;
278const int kImm11Shift = 2;
279const int kImm11Bits = 11;
280const int kShamtShift = 20;
281const int kShamtBits = 5;
282const uint32_t kShamtMask = (((1 << kShamtBits) - 1) << kShamtShift);
283const int kShamtWShift = 20;
284// FIXME: remove this once we have a proper way to handle the wide shift amount
285const int kShamtWBits = 6;
286const int kArithShiftShift = 30;
287const int kImm20Shift = 12;
288const int kImm20Bits = 20;
289const int kCsrShift = 20;
290const int kCsrBits = 12;
291const int kMemOrderBits = 4;
292const int kPredOrderShift = 24;
293const int kSuccOrderShift = 20;
294
295// for C extension
296const int kRvcFunct4Shift = 12;
297const int kRvcFunct4Bits = 4;
298const int kRvcFunct3Shift = 13;
299const int kRvcFunct3Bits = 3;
300const int kRvcRs1Shift = 7;
301const int kRvcRs1Bits = 5;
302const int kRvcRs2Shift = 2;
303const int kRvcRs2Bits = 5;
304const int kRvcRdShift = 7;
305const int kRvcRdBits = 5;
306const int kRvcRs1sShift = 7;
307const int kRvcRs1sBits = 3;
308const int kRvcRs2sShift = 2;
309const int kRvcRs2sBits = 3;
310const int kRvcFunct2Shift = 5;
311const int kRvcFunct2BShift = 10;
312const int kRvcFunct2Bits = 2;
313const int kRvcFunct6Shift = 10;
314const int kRvcFunct6Bits = 6;
315
316const uint32_t kRvcOpcodeMask =
317 0b11 | (((1 << kRvcFunct3Bits) - 1) << kRvcFunct3Shift);
318const uint32_t kRvcFunct3Mask =
319 (((1 << kRvcFunct3Bits) - 1) << kRvcFunct3Shift);
320const uint32_t kRvcFunct4Mask =
321 (((1 << kRvcFunct4Bits) - 1) << kRvcFunct4Shift);
322const uint32_t kRvcFunct6Mask =
323 (((1 << kRvcFunct6Bits) - 1) << kRvcFunct6Shift);
324const uint32_t kRvcFunct2Mask =
325 (((1 << kRvcFunct2Bits) - 1) << kRvcFunct2Shift);
326const uint32_t kRvcFunct2BMask =
327 (((1 << kRvcFunct2Bits) - 1) << kRvcFunct2BShift);
331const uint32_t kRvcBImm8Mask = (((1 << 5) - 1) << 2) | (((1 << 3) - 1) << 10);
332
333// for RVV extension
334constexpr int kRvvELEN = 64;
335#ifdef RVV_VLEN
336constexpr int kRvvVLEN = RVV_VLEN;
337// TODO(riscv): support rvv 256/512/1024
338static_assert(
339 kRvvVLEN == 128,
340 "RVV extension only supports 128bit wide VLEN at current RISC-V backend.");
341#else
342constexpr int kRvvVLEN = 128;
343#endif
344constexpr int kRvvSLEN = kRvvVLEN;
345
346const int kRvvFunct6Shift = 26;
347const int kRvvFunct6Bits = 6;
348const uint32_t kRvvFunct6Mask =
349 (((1 << kRvvFunct6Bits) - 1) << kRvvFunct6Shift);
350
351const int kRvvVmBits = 1;
352const int kRvvVmShift = 25;
353const uint32_t kRvvVmMask = (((1 << kRvvVmBits) - 1) << kRvvVmShift);
354
355const int kRvvVs2Bits = 5;
356const int kRvvVs2Shift = 20;
357const uint32_t kRvvVs2Mask = (((1 << kRvvVs2Bits) - 1) << kRvvVs2Shift);
358
359const int kRvvVs1Bits = 5;
360const int kRvvVs1Shift = 15;
361const uint32_t kRvvVs1Mask = (((1 << kRvvVs1Bits) - 1) << kRvvVs1Shift);
362
365const uint32_t kRvvRs1Mask = (((1 << kRvvRs1Bits) - 1) << kRvvRs1Shift);
366
367const int kRvvRs2Bits = 5;
368const int kRvvRs2Shift = 20;
369const uint32_t kRvvRs2Mask = (((1 << kRvvRs2Bits) - 1) << kRvvRs2Shift);
370
373const uint32_t kRvvImm5Mask = (((1 << kRvvImm5Bits) - 1) << kRvvImm5Shift);
374
375const int kRvvVdBits = 5;
376const int kRvvVdShift = 7;
377const uint32_t kRvvVdMask = (((1 << kRvvVdBits) - 1) << kRvvVdShift);
378
381const uint32_t kRvvRdMask = (((1 << kRvvRdBits) - 1) << kRvvRdShift);
382
383const int kRvvZimmBits = 11;
384const int kRvvZimmShift = 20;
385const uint32_t kRvvZimmMask = (((1 << kRvvZimmBits) - 1) << kRvvZimmShift);
386
389const uint32_t kRvvUimmMask = (((1 << kRvvUimmBits) - 1) << kRvvUimmShift);
390
391const int kRvvWidthBits = 3;
392const int kRvvWidthShift = 12;
393const uint32_t kRvvWidthMask = (((1 << kRvvWidthBits) - 1) << kRvvWidthShift);
394
395const int kRvvMopBits = 2;
396const int kRvvMopShift = 26;
397const uint32_t kRvvMopMask = (((1 << kRvvMopBits) - 1) << kRvvMopShift);
398
399const int kRvvMewBits = 1;
400const int kRvvMewShift = 28;
401const uint32_t kRvvMewMask = (((1 << kRvvMewBits) - 1) << kRvvMewShift);
402
403const int kRvvNfBits = 3;
404const int kRvvNfShift = 29;
405const uint32_t kRvvNfMask = (((1 << kRvvNfBits) - 1) << kRvvNfShift);
406
407// RISCV Instruction bit masks
408const uint32_t kBaseOpcodeMask = ((1 << kBaseOpcodeBits) - 1)
410const uint32_t kFunct3Mask = ((1 << kFunct3Bits) - 1) << kFunct3Shift;
411const uint32_t kFunct5Mask = ((1 << kFunct5Bits) - 1) << kFunct5Shift;
412const uint32_t kFunct6Mask = ((1 << kFunct6Bits) - 1) << kFunct6Shift;
413const uint32_t kFunct7Mask = ((1 << kFunct7Bits) - 1) << kFunct7Shift;
414const uint32_t kFunct2Mask = 0b11 << kFunct7Shift;
425const uint32_t kRs1FieldMask = ((1 << kRs1Bits) - 1) << kRs1Shift;
426const uint32_t kRs2FieldMask = ((1 << kRs2Bits) - 1) << kRs2Shift;
427const uint32_t kRs3FieldMask = ((1 << kRs3Bits) - 1) << kRs3Shift;
428const uint32_t kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift;
430const uint32_t kImm20Mask = ((1 << kImm20Bits) - 1) << kImm20Shift;
431const uint32_t kImm12Mask = ((1 << kImm12Bits) - 1) << kImm12Shift;
432const uint32_t kImm11Mask = ((1 << kImm11Bits) - 1) << kImm11Shift;
433const uint32_t kImm31_12Mask = ((1 << 20) - 1) << 12;
434const uint32_t kImm19_0Mask = ((1 << 20) - 1);
435
436const int kNopByte = 0x00000013;
437// Original MIPS constants
438const int kImm16Shift = 0;
439const int kImm16Bits = 16;
440const uint32_t kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift;
441
442// ----- Emulated conditions.
443// On RISC-V we use this enum to abstract from conditional branch instructions.
444// The 'U' prefix is used to specify unsigned comparisons.
445// Opposite conditions must be paired as odd/even numbers
446// because 'NegateCondition' function flips LSB to negate condition.
447enum Condition : int { // Any value < 0 is considered no_condition.
448 overflow = 0,
449 no_overflow = 1,
450 Uless = 2,
451 Ugreater_equal = 3,
452 Uless_equal = 4,
453 Ugreater = 5,
454 equal = 6,
455 not_equal = 7, // Unordered or Not Equal.
456 less = 8,
457 greater_equal = 9,
458 less_equal = 10,
459 greater = 11,
460 cc_always = 12,
461
462 // Aliases.
463 eq = equal,
464 ne = not_equal,
466 lt = less,
467 gt = greater,
468 le = less_equal,
469 al = cc_always,
470 ult = Uless,
473 ugt = Ugreater,
474
475 // Unified cross-platform condition names/aliases.
476 kEqual = equal,
478 kLessThan = less,
488 kZero = equal,
490};
491
492// Returns the equivalent of !cc.
494 DCHECK(cc != cc_always);
495 return static_cast<Condition>(cc ^ 1);
496}
497
499 DCHECK(cc != cc_always);
500 switch (cc) {
501 case ult:
502 return ge;
503 case ugt:
504 return le;
505 case uge:
506 return lt;
507 case ule:
508 return gt;
509 case lt:
510 return uge;
511 case gt:
512 return ule;
513 case ge:
514 return ult;
515 case le:
516 return ugt;
517 case eq:
518 return ne;
519 case ne:
520 return eq;
521 default:
522 return cc;
523 }
524}
525
526// ----- Coprocessor conditions.
528 kNoFPUCondition = -1,
529 EQ = 0x02, // Ordered and Equal
530 NE = 0x03, // Unordered or Not Equal
531 LT = 0x04, // Ordered and Less Than
532 GE = 0x05, // Ordered and Greater Than or Equal
533 LE = 0x06, // Ordered and Less Than or Equal
534 GT = 0x07, // Ordered and Greater Than
535};
536
541
542enum class MaxMinKind : int { kMin = 0, kMax = 1 };
543
544// ----------------------------------------------------------------------------
545// RISCV flags
546
548 csr_fflags = 0x001, // Floating-Point Accrued Exceptions (RW)
549 csr_frm = 0x002, // Floating-Point Dynamic Rounding Mode (RW)
550 csr_fcsr = 0x003, // Floating-Point Control and Status Register (RW)
551 csr_cycle = 0xc00, // Cycle counter for RDCYCLE instruction (RO)
552 csr_time = 0xc01, // Timer for RDTIME instruction (RO)
553 csr_instret = 0xc02, // Insns-retired counter for RDINSTRET instruction (RO)
554 csr_cycleh = 0xc80, // Upper 32 bits of cycle, RV32I only (RO)
555 csr_timeh = 0xc81, // Upper 32 bits of time, RV32I only (RO)
556 csr_instreth = 0xc82 // Upper 32 bits of instret, RV32I only (RO)
558
560 kInvalidOperation = 0b10000, // NV: Invalid
561 kDivideByZero = 0b1000, // DZ: Divide by Zero
562 kFPUOverflow = 0b100, // OF: Overflow
563 kUnderflow = 0b10, // UF: Underflow
564 kInexact = 0b1 // NX: Inexact
566
568 RNE = 0b000, // Round to Nearest, ties to Even
569 RTZ = 0b001, // Round towards Zero
570 RDN = 0b010, // Round Down (towards -infinity)
571 RUP = 0b011, // Round Up (towards +infinity)
572 RMM = 0b100, // Round to Nearest, tiest to Max Magnitude
573 DYN = 0b111 // In instruction's rm field, selects dynamic rounding mode;
574 // In Rounding Mode register, Invalid
576
578 PSI = 0b1000, // PI or SI
579 PSO = 0b0100, // PO or SO
580 PSR = 0b0010, // PR or SR
581 PSW = 0b0001, // PW or SW
582 PSIORW = PSI | PSO | PSR | PSW
584
585const int kFloat32ExponentBias = 127;
586const int kFloat32MantissaBits = 23;
588const int kFloat64ExponentBias = 1023;
589const int kFloat64MantissaBits = 52;
590const int kFloat64ExponentBits = 11;
591
604
606 ta = 0x1, // Tail agnostic
607 tu = 0x0, // Tail undisturbed
608};
609
611 ma = 0x1, // Mask agnostic
612 mu = 0x0, // Mask undisturbed
613};
615 Mask = 0x0, // use the mask
616 NoMask = 0x1,
617};
618
619// -----------------------------------------------------------------------------
620// Hints.
621
622// Branch hints are not used on RISC-V. They are defined so that they can
623// appear in shared function signatures, but will be ignored in RISC-V
624// implementations.
625enum Hint { no_hint = 0 };
626
627inline Hint NegateHint(Hint hint) { return no_hint; }
628
629enum BaseOpcode : uint32_t {
630 LOAD = 0b0000011, // I form: LB LH LW LBU LHU
631 LOAD_FP = 0b0000111, // I form: FLW FLD FLQ
632 MISC_MEM = 0b0001111, // I special form: FENCE FENCE.I
633 OP_IMM = 0b0010011, // I form: ADDI SLTI SLTIU XORI ORI ANDI SLLI SRLI SRAI
634 // Note: SLLI/SRLI/SRAI I form first, then func3 001/101 => R type
635 AUIPC = 0b0010111, // U form: AUIPC
636 OP_IMM_32 = 0b0011011, // I form: ADDIW SLLIW SRLIW SRAIW
637 // Note: SRLIW SRAIW I form first, then func3 101 special shift encoding
638 STORE = 0b0100011, // S form: SB SH SW SD
639 STORE_FP = 0b0100111, // S form: FSW FSD FSQ
640 AMO = 0b0101111, // R form: All A instructions
641 OP = 0b0110011, // R: ADD SUB SLL SLT SLTU XOR SRL SRA OR AND and 32M set
642 LUI = 0b0110111, // U form: LUI
643 OP_32 = 0b0111011, // R: ADDW SUBW SLLW SRLW SRAW MULW DIVW DIVUW REMW REMUW
644 MADD = 0b1000011, // R4 type: FMADD.S FMADD.D FMADD.Q
645 MSUB = 0b1000111, // R4 type: FMSUB.S FMSUB.D FMSUB.Q
646 NMSUB = 0b1001011, // R4 type: FNMSUB.S FNMSUB.D FNMSUB.Q
647 NMADD = 0b1001111, // R4 type: FNMADD.S FNMADD.D FNMADD.Q
648 OP_FP = 0b1010011, // R type: Q ext
649 BRANCH = 0b1100011, // B form: BEQ BNE, BLT, BGE, BLTU BGEU
650 JALR = 0b1100111, // I form: JALR
651 JAL = 0b1101111, // J form: JAL
652 SYSTEM = 0b1110011, // I form: ECALL EBREAK Zicsr ext
653 OP_V = 0b1010111, // V form: RVV
654
655 // C extension
656 C0 = 0b00,
657 C1 = 0b01,
658 C2 = 0b10,
659 FUNCT2_0 = 0b00,
660 FUNCT2_1 = 0b01,
661 FUNCT2_2 = 0b10,
662 FUNCT2_3 = 0b11,
663};
664
665// -----------------------------------------------------------------------------
666// Specific instructions, constants, and masks.
667// These constants are declared in assembler-riscv64.cc, as they use named
668// registers and other constants.
669
670// An Illegal instruction
671const Instr kIllegalInstr = 0; // All other bits are 0s (i.e., ecall)
672// An ECALL instruction, used for redirected real time call
673const Instr rtCallRedirInstr = SYSTEM; // All other bits are 0s (i.e., ecall)
674// An EBreak instruction, used for debugging and semi-hosting
675const Instr kBreakInstr = SYSTEM | 1 << kImm12Shift; // ebreak
676
677constexpr uint8_t kInstrSize = 4;
678constexpr uint8_t kShortInstrSize = 2;
679constexpr uint8_t kInstrSizeLog2 = 2;
680
682 public:
683 enum {
684 // On RISC-V, PC cannot actually be directly accessed. We behave as if PC
685 // was always the value of the current instruction being executed.
686 kPCReadOffset = 0
687 };
688
689 // Instruction type.
723
724 inline bool IsIllegalInstruction() const {
725 uint16_t FirstHalfWord = *reinterpret_cast<const uint16_t*>(this);
726 return FirstHalfWord == 0;
727 }
728
729 bool IsShortInstruction() const;
730
731 inline uint8_t InstructionSize() const {
732 return (v8_flags.riscv_c_extension && this->IsShortInstruction())
734 : kInstrSize;
735 }
736
737 // Get the raw instruction bits.
738 inline Instr InstructionBits() const {
739 if (v8_flags.riscv_c_extension && this->IsShortInstruction()) {
740 return 0x0000FFFF & (*reinterpret_cast<const ShortInstr*>(this));
741 }
742 return *reinterpret_cast<const Instr*>(this);
743 }
744
745 // Set the raw instruction bits to value.
746 inline void SetInstructionBits(Instr value) {
747 *reinterpret_cast<Instr*>(this) = value;
748 }
749
750 // Read one particular bit out of the instruction bits.
751 inline int Bit(int nr) const { return (InstructionBits() >> nr) & 1; }
752
753 // Read a bit field out of the instruction bits.
754 inline int Bits(int hi, int lo) const {
755 return (InstructionBits() >> lo) & ((2U << (hi - lo)) - 1);
756 }
757
758 // Accessors for the different named fields used in the RISC-V encoding.
760 return static_cast<BaseOpcode>(
762 }
763
764 // Return the fields at their original place in the instruction encoding.
766 return static_cast<BaseOpcode>(InstructionBits() & kBaseOpcodeMask);
767 }
768
769 // Safe to call within R-type instructions
770 inline int Funct7FieldRaw() const { return InstructionBits() & kFunct7Mask; }
771
772 // Safe to call within R-type instructions
773 inline int Funct6FieldRaw() const { return InstructionBits() & kFunct6Mask; }
774
775 // Safe to call within R-, I-, S-, or B-type instructions
776 inline int Funct3FieldRaw() const { return InstructionBits() & kFunct3Mask; }
777
778 // Safe to call within R-, I-, S-, or B-type instructions
779 inline int Rs1FieldRawNoAssert() const {
781 }
782
783 // Safe to call within R-, S-, or B-type instructions
784 inline int Rs2FieldRawNoAssert() const {
786 }
787
788 // Safe to call within R4-type instructions
789 inline int Rs3FieldRawNoAssert() const {
791 }
792
793 inline int32_t ITypeBits() const { return InstructionBits() & kITypeMask; }
794
795 inline int32_t InstructionOpcodeType() const {
796 if (IsShortInstruction()) {
798 } else {
800 }
801 }
802
803 // Get the encoding type of the instruction.
805
806 protected:
808};
809
810template <class T>
811class InstructionGetters : public T {
812 public:
813 uint32_t OperandFunct3() const {
814 return this->InstructionBits() & (kBaseOpcodeMask | kFunct3Mask);
815 }
816 bool IsLoad();
817 bool IsStore();
818 inline int BaseOpcode() const {
819 return this->InstructionBits() & kBaseOpcodeMask;
820 }
821
822 inline int RvcOpcode() const {
823 DCHECK(this->IsShortInstruction());
824 return this->InstructionBits() & kRvcOpcodeMask;
825 }
826
827 inline int Rs1Value() const {
828 DCHECK(this->InstructionType() == InstructionBase::kRType ||
829 this->InstructionType() == InstructionBase::kR4Type ||
830 this->InstructionType() == InstructionBase::kIType ||
831 this->InstructionType() == InstructionBase::kSType ||
832 this->InstructionType() == InstructionBase::kBType ||
833 this->InstructionType() == InstructionBase::kIType ||
834 this->InstructionType() == InstructionBase::kVType);
835 return this->Bits(kRs1Shift + kRs1Bits - 1, kRs1Shift);
836 }
837
838 inline int Rs2Value() const {
839 DCHECK(this->InstructionType() == InstructionBase::kRType ||
840 this->InstructionType() == InstructionBase::kR4Type ||
841 this->InstructionType() == InstructionBase::kSType ||
842 this->InstructionType() == InstructionBase::kBType ||
843 this->InstructionType() == InstructionBase::kIType ||
844 this->InstructionType() == InstructionBase::kVType);
845 return this->Bits(kRs2Shift + kRs2Bits - 1, kRs2Shift);
846 }
847
848 inline int Rs3Value() const {
849 DCHECK(this->InstructionType() == InstructionBase::kR4Type);
850 return this->Bits(kRs3Shift + kRs3Bits - 1, kRs3Shift);
851 }
852
853 inline int Vs1Value() const {
854 DCHECK(this->InstructionType() == InstructionBase::kVType ||
855 this->InstructionType() == InstructionBase::kIType ||
856 this->InstructionType() == InstructionBase::kSType);
857 return this->Bits(kVs1Shift + kVs1Bits - 1, kVs1Shift);
858 }
859
860 inline int Vs2Value() const {
861 DCHECK(this->InstructionType() == InstructionBase::kVType ||
862 this->InstructionType() == InstructionBase::kIType ||
863 this->InstructionType() == InstructionBase::kSType);
864 return this->Bits(kVs2Shift + kVs2Bits - 1, kVs2Shift);
865 }
866
867 inline int VdValue() const {
868 DCHECK(this->InstructionType() == InstructionBase::kVType ||
869 this->InstructionType() == InstructionBase::kIType ||
870 this->InstructionType() == InstructionBase::kSType);
871 return this->Bits(kVdShift + kVdBits - 1, kVdShift);
872 }
873
874 inline int RdValue() const {
875 DCHECK(this->InstructionType() == InstructionBase::kRType ||
876 this->InstructionType() == InstructionBase::kR4Type ||
877 this->InstructionType() == InstructionBase::kIType ||
878 this->InstructionType() == InstructionBase::kSType ||
879 this->InstructionType() == InstructionBase::kUType ||
880 this->InstructionType() == InstructionBase::kJType ||
881 this->InstructionType() == InstructionBase::kVType);
882 return this->Bits(kRdShift + kRdBits - 1, kRdShift);
883 }
884
885 inline int RvcRs1Value() const { return this->RvcRdValue(); }
886
887 int RvcRdValue() const;
888
889 int RvcRs2Value() const;
890
891 int RvcRs1sValue() const;
892
893 int RvcRs2sValue() const;
894
895 int Funct7Value() const;
896
897 inline int Funct3Value() const {
898 DCHECK(this->InstructionType() == InstructionBase::kRType ||
899 this->InstructionType() == InstructionBase::kIType ||
900 this->InstructionType() == InstructionBase::kSType ||
901 this->InstructionType() == InstructionBase::kBType);
902 return this->Bits(kFunct3Shift + kFunct3Bits - 1, kFunct3Shift);
903 }
904
905 inline int Funct5Value() const {
906 DCHECK(this->InstructionType() == InstructionBase::kRType &&
907 this->BaseOpcode() == OP_FP);
908 return this->Bits(kFunct5Shift + kFunct5Bits - 1, kFunct5Shift);
909 }
910
911 int RvcFunct6Value() const;
912
913 int RvcFunct4Value() const;
914
915 int RvcFunct3Value() const;
916
917 int RvcFunct2Value() const;
918
919 int RvcFunct2BValue() const;
920
921 inline int CsrValue() const {
922 DCHECK(this->InstructionType() == InstructionBase::kIType &&
923 this->BaseOpcode() == SYSTEM);
924 return (this->Bits(kCsrShift + kCsrBits - 1, kCsrShift));
925 }
926
927 inline int RoundMode() const {
928 DCHECK((this->InstructionType() == InstructionBase::kRType ||
929 this->InstructionType() == InstructionBase::kR4Type) &&
930 this->BaseOpcode() == OP_FP);
931 return this->Bits(kFunct3Shift + kFunct3Bits - 1, kFunct3Shift);
932 }
933
934 inline int MemoryOrder(bool is_pred) const {
935 DCHECK((this->InstructionType() == InstructionBase::kIType &&
936 this->BaseOpcode() == MISC_MEM));
937 if (is_pred) {
938 return this->Bits(kPredOrderShift + kMemOrderBits - 1, kPredOrderShift);
939 } else {
940 return this->Bits(kSuccOrderShift + kMemOrderBits - 1, kSuccOrderShift);
941 }
942 }
943
944 inline int Imm12Value() const {
945 DCHECK(this->InstructionType() == InstructionBase::kIType);
946 int Value = this->Bits(kImm12Shift + kImm12Bits - 1, kImm12Shift);
947 return Value << 20 >> 20;
948 }
949
950 inline int32_t Imm12SExtValue() const {
951 int32_t Value = this->Imm12Value() << 20 >> 20;
952 return Value;
953 }
954
955 inline int BranchOffset() const {
956 DCHECK(this->InstructionType() == InstructionBase::kBType);
957 // | imm[12|10:5] | rs2 | rs1 | funct3 | imm[4:1|11] | opcode |
958 // 31 25 11 7
959 uint32_t Bits = this->InstructionBits();
960 int16_t imm13 = ((Bits & 0xf00) >> 7) | ((Bits & 0x7e000000) >> 20) |
961 ((Bits & 0x80) << 4) | ((Bits & 0x80000000) >> 19);
962 return imm13 << 19 >> 19;
963 }
964
965 inline int StoreOffset() const {
966 DCHECK(this->InstructionType() == InstructionBase::kSType);
967 // | imm[11:5] | rs2 | rs1 | funct3 | imm[4:0] | opcode |
968 // 31 25 11 7
969 uint32_t Bits = this->InstructionBits();
970 int16_t imm12 = ((Bits & 0xf80) >> 7) | ((Bits & 0xfe000000) >> 20);
971 return imm12 << 20 >> 20;
972 }
973
974 inline int Imm20UValue() const {
975 DCHECK(this->InstructionType() == InstructionBase::kUType);
976 // | imm[31:12] | rd | opcode |
977 // 31 12
978 int32_t Bits = this->InstructionBits();
979 return Bits >> 12;
980 }
981
982 inline int Imm20JValue() const {
983 DCHECK(this->InstructionType() == InstructionBase::kJType);
984 // | imm[20|10:1|11|19:12] | rd | opcode |
985 // 31 12
986 uint32_t Bits = this->InstructionBits();
987 int32_t imm20 = ((Bits & 0x7fe00000) >> 20) | ((Bits & 0x100000) >> 9) |
988 (Bits & 0xff000) | ((Bits & 0x80000000) >> 11);
989 return imm20 << 11 >> 11;
990 }
991
992 inline bool IsArithShift() const {
993 // Valid only for right shift operations
994 DCHECK((this->BaseOpcode() == OP || this->BaseOpcode() == OP_32 ||
995 this->BaseOpcode() == OP_IMM || this->BaseOpcode() == OP_IMM_32) &&
996 this->Funct3Value() == 0b101);
997 return this->InstructionBits() & 0x40000000;
998 }
999
1000 inline int Shamt() const {
1001 // Valid only for shift instructions (SLLI, SRLI, SRAI)
1002 DCHECK(((this->InstructionBits() & kBaseOpcodeMask) == OP_IMM ||
1003 (this->InstructionBits() & kBaseOpcodeMask) == OP_IMM_32) &&
1004 (this->Funct3Value() == 0b001 || this->Funct3Value() == 0b101));
1005 // | 0A0000 | shamt | rs1 | funct3 | rd | opcode |
1006 // 31 25 20
1007 return this->Bits(kImm12Shift + 5, kImm12Shift);
1008 }
1009
1010 inline int Shamt32() const {
1011 // Valid only for shift instructions (SLLIW, SRLIW, SRAIW)
1012#ifdef V8_TARGET_ARCH_RISCV32
1013 DCHECK(((this->InstructionBits() & kBaseOpcodeMask) == OP_IMM_32 ||
1014 (this->InstructionBits() & kBaseOpcodeMask) == OP_IMM) &&
1015 (this->Funct3Value() == 0b001 || this->Funct3Value() == 0b101));
1016#else
1017 DCHECK((this->InstructionBits() & kBaseOpcodeMask) == OP_IMM_32 &&
1018 (this->Funct3Value() == 0b001 || this->Funct3Value() == 0b101));
1019#endif
1020 // | 0A00000 | shamt | rs1 | funct3 | rd | opcode |
1021 // 31 24 20
1022 return this->Bits(kImm12Shift + 4, kImm12Shift);
1023 }
1024
1025 inline int RvcImm6Value() const {
1026 DCHECK(this->IsShortInstruction());
1027 // | funct3 | imm[5] | rs1/rd | imm[4:0] | opcode |
1028 // 15 12 6 2
1029 uint32_t Bits = this->InstructionBits();
1030 int32_t imm6 = ((Bits & 0x1000) >> 7) | ((Bits & 0x7c) >> 2);
1031 return imm6 << 26 >> 26;
1032 }
1033
1034 inline int RvcImm6Addi16spValue() const {
1035 DCHECK(this->IsShortInstruction());
1036 // | funct3 | nzimm[9] | 2 | nzimm[4|6|8:7|5] | opcode |
1037 // 15 12 6 2
1038 uint32_t Bits = this->InstructionBits();
1039 int32_t imm10 = ((Bits & 0x1000) >> 3) | ((Bits & 0x40) >> 2) |
1040 ((Bits & 0x20) << 1) | ((Bits & 0x18) << 4) |
1041 ((Bits & 0x4) << 3);
1042 DCHECK_NE(imm10, 0);
1043 return imm10 << 22 >> 22;
1044 }
1045
1046 inline int RvcImm8Addi4spnValue() const {
1047 DCHECK(this->IsShortInstruction());
1048 // | funct3 | nzimm[11] | rd' | opcode |
1049 // 15 13 5 2
1050 uint32_t Bits = this->InstructionBits();
1051 int32_t uimm10 = ((Bits & 0x20) >> 2) | ((Bits & 0x40) >> 4) |
1052 ((Bits & 0x780) >> 1) | ((Bits & 0x1800) >> 7);
1053 DCHECK_NE(uimm10, 0);
1054 return uimm10;
1055 }
1056
1057 inline int RvcShamt6() const {
1058 DCHECK(this->IsShortInstruction());
1059 // | funct3 | nzuimm[5] | rs1/rd | nzuimm[4:0] | opcode |
1060 // 15 12 6 2
1061 int32_t imm6 = this->RvcImm6Value();
1062 return imm6 & 0x3f;
1063 }
1064
1065 inline int RvcImm6LwspValue() const {
1066 DCHECK(this->IsShortInstruction());
1067 // | funct3 | uimm[5] | rs1 | uimm[4:2|7:6] | opcode |
1068 // 15 12 6 2
1069 uint32_t Bits = this->InstructionBits();
1070 int32_t imm8 =
1071 ((Bits & 0x1000) >> 7) | ((Bits & 0x70) >> 2) | ((Bits & 0xc) << 4);
1072 return imm8;
1073 }
1074
1075 inline int RvcImm6LdspValue() const {
1076 DCHECK(this->IsShortInstruction());
1077 // | funct3 | uimm[5] | rs1 | uimm[4:3|8:6] | opcode |
1078 // 15 12 6 2
1079 uint32_t Bits = this->InstructionBits();
1080 int32_t imm9 =
1081 ((Bits & 0x1000) >> 7) | ((Bits & 0x60) >> 2) | ((Bits & 0x1c) << 4);
1082 return imm9;
1083 }
1084
1085 inline int RvcImm6SwspValue() const {
1086 DCHECK(this->IsShortInstruction());
1087 // | funct3 | uimm[5:2|7:6] | rs2 | opcode |
1088 // 15 12 7
1089 uint32_t Bits = this->InstructionBits();
1090 int32_t imm8 = ((Bits & 0x1e00) >> 7) | ((Bits & 0x180) >> 1);
1091 return imm8;
1092 }
1093
1094 inline int RvcImm6SdspValue() const {
1095 DCHECK(this->IsShortInstruction());
1096 // | funct3 | uimm[5:3|8:6] | rs2 | opcode |
1097 // 15 12 7
1098 uint32_t Bits = this->InstructionBits();
1099 int32_t imm9 = ((Bits & 0x1c00) >> 7) | ((Bits & 0x380) >> 1);
1100 return imm9;
1101 }
1102
1103 inline int RvcImm5WValue() const {
1104 DCHECK(this->IsShortInstruction());
1105 // | funct3 | imm[5:3] | rs1 | imm[2|6] | rd | opcode |
1106 // 15 12 10 6 4 2
1107 uint32_t Bits = this->InstructionBits();
1108 int32_t imm7 =
1109 ((Bits & 0x1c00) >> 7) | ((Bits & 0x40) >> 4) | ((Bits & 0x20) << 1);
1110 return imm7;
1111 }
1112
1113 inline int RvcImm5DValue() const {
1114 DCHECK(this->IsShortInstruction());
1115 // | funct3 | imm[5:3] | rs1 | imm[7:6] | rd | opcode |
1116 // 15 12 10 6 4 2
1117 uint32_t Bits = this->InstructionBits();
1118 int32_t imm8 = ((Bits & 0x1c00) >> 7) | ((Bits & 0x60) << 1);
1119 return imm8;
1120 }
1121
1122 inline int RvcImm11CJValue() const {
1123 DCHECK(this->IsShortInstruction());
1124 // | funct3 | [11|4|9:8|10|6|7|3:1|5] | opcode |
1125 // 15 12 2
1126 uint32_t Bits = this->InstructionBits();
1127 int32_t imm12 = ((Bits & 0x4) << 3) | ((Bits & 0x38) >> 2) |
1128 ((Bits & 0x40) << 1) | ((Bits & 0x80) >> 1) |
1129 ((Bits & 0x100) << 2) | ((Bits & 0x600) >> 1) |
1130 ((Bits & 0x800) >> 7) | ((Bits & 0x1000) >> 1);
1131 return imm12 << 20 >> 20;
1132 }
1133
1134 inline int RvcImm8BValue() const {
1135 DCHECK(this->IsShortInstruction());
1136 // | funct3 | imm[8|4:3] | rs1` | imm[7:6|2:1|5] | opcode |
1137 // 15 12 10 7 2
1138 uint32_t Bits = this->InstructionBits();
1139 int32_t imm9 = ((Bits & 0x4) << 3) | ((Bits & 0x18) >> 2) |
1140 ((Bits & 0x60) << 1) | ((Bits & 0xc00) >> 7) |
1141 ((Bits & 0x1000) >> 4);
1142 return imm9 << 23 >> 23;
1143 }
1144
1145 inline int vl_vs_width() {
1146 int width = 0;
1147 if ((this->InstructionBits() & kBaseOpcodeMask) != LOAD_FP &&
1148 (this->InstructionBits() & kBaseOpcodeMask) != STORE_FP)
1149 return -1;
1150 switch (this->InstructionBits() & (kRvvWidthMask | kRvvMewMask)) {
1151 case 0x0:
1152 width = 8;
1153 break;
1154 case 0x00005000:
1155 width = 16;
1156 break;
1157 case 0x00006000:
1158 width = 32;
1159 break;
1160 case 0x00007000:
1161 width = 64;
1162 break;
1163 case 0x10000000:
1164 width = 128;
1165 break;
1166 case 0x10005000:
1167 width = 256;
1168 break;
1169 case 0x10006000:
1170 width = 512;
1171 break;
1172 case 0x10007000:
1173 width = 1024;
1174 break;
1175 default:
1176 width = -1;
1177 break;
1178 }
1179 return width;
1180 }
1181
1182 uint32_t Rvvzimm() const;
1183
1184 uint32_t Rvvuimm() const;
1185
1186 inline uint32_t RvvVsew() const {
1187 uint32_t zimm = this->Rvvzimm();
1188 uint32_t vsew = (zimm >> 3) & 0x7;
1189 return vsew;
1190 }
1191
1192 inline uint32_t RvvVlmul() const {
1193 uint32_t zimm = this->Rvvzimm();
1194 uint32_t vlmul = zimm & 0x7;
1195 return vlmul;
1196 }
1197
1198 inline uint8_t RvvVM() const {
1199 DCHECK(this->InstructionType() == InstructionBase::kVType ||
1200 this->InstructionType() == InstructionBase::kIType ||
1201 this->InstructionType() == InstructionBase::kSType);
1202 return this->Bits(kRvvVmShift + kRvvVmBits - 1, kRvvVmShift);
1203 }
1204
1205 inline const char* RvvSEW() const {
1206 uint32_t vsew = this->RvvVsew();
1207 switch (vsew) {
1208#define CAST_VSEW(name) \
1209 case name: \
1210 return #name;
1212 default:
1213 return "unknown";
1214#undef CAST_VSEW
1215 }
1216 }
1217
1218 inline const char* RvvLMUL() const {
1219 uint32_t vlmul = this->RvvVlmul();
1220 switch (vlmul) {
1221#define CAST_VLMUL(name) \
1222 case name: \
1223 return #name;
1225 default:
1226 return "unknown";
1227#undef CAST_VLMUL
1228 }
1229 }
1230
1231#define sext(x, len) (((int32_t)(x) << (32 - len)) >> (32 - len))
1232#define zext(x, len) (((uint32_t)(x) << (32 - len)) >> (32 - len))
1233
1234 inline int32_t RvvSimm5() const {
1235 DCHECK(this->InstructionType() == InstructionBase::kVType);
1236 return sext(this->Bits(kRvvImm5Shift + kRvvImm5Bits - 1, kRvvImm5Shift),
1237 kRvvImm5Bits);
1238 }
1239
1240 inline uint32_t RvvUimm5() const {
1241 DCHECK(this->InstructionType() == InstructionBase::kVType);
1242 uint32_t imm = this->Bits(kRvvImm5Shift + kRvvImm5Bits - 1, kRvvImm5Shift);
1243 return zext(imm, kRvvImm5Bits);
1244 }
1245#undef sext
1246#undef zext
1247 inline bool AqValue() const { return this->Bits(kAqShift, kAqShift); }
1248
1249 inline bool RlValue() const { return this->Bits(kRlShift, kRlShift); }
1250
1251 // Say if the instruction is a break or a trap.
1252 bool IsTrap() const;
1253
1254 bool IsAUIPC() const {
1255 return (this->InstructionBits() & kBaseOpcodeMask) == AUIPC;
1256 }
1257};
1258
1259class Instruction : public InstructionGetters<InstructionBase> {
1260 public:
1261 // Instructions are read of out a code stream. The only way to get a
1262 // reference to an instruction is to convert a pointer. There is no way
1263 // to allocate or create instances of class Instruction.
1264 // Use the At(pc) function to create references to Instruction.
1265 static Instruction* At(uint8_t* pc) {
1266 return reinterpret_cast<Instruction*>(pc);
1267 }
1268
1269 private:
1270 // We need to prevent the creation of instances of class Instruction.
1272};
1273
1274// -----------------------------------------------------------------------------
1275// RISC-V assembly various constants.
1276
1277// C/C++ argument slots size.
1278const int kCArgSlotCount = 0;
1279
1280// TODO(plind): below should be based on kSystemPointerSize
1281// TODO(plind): find all usages and remove the needless instructions for n64.
1282const int kCArgsSlotsSize = kCArgSlotCount * kInstrSize * 2;
1283
1284const int kInvalidStackOffset = -1;
1285const int kBranchReturnOffset = 2 * kInstrSize;
1286
1287static const int kNegOffset = 0x00008000;
1288
1289// -----------------------------------------------------------------------------
1290// Instructions.
1291
1292template <class P>
1293bool InstructionGetters<P>::IsTrap() const {
1294 return (this->InstructionBits() == kBreakInstr);
1295}
1296
1297} // namespace internal
1298} // namespace v8
1299
1300#endif // V8_CODEGEN_RISCV_BASE_CONSTANTS_RISCV_H_
#define RVV_SEW(V)
#define RVV_LMUL(V)
#define zext(x, len)
#define CAST_VLMUL(name)
#define sext(x, len)
#define DEFINE_FLAG(name)
#define CAST_VSEW(name)
static const char * Name(int reg)
static int Number(const char *name)
static const RegisterAlias aliases_[]
static const char * names_[kNumFPURegisters]
int Bits(int hi, int lo) const
static Instruction * At(uint8_t *pc)
DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction)
static const char * Name(int reg)
static int Number(const char *name)
static const RegisterAlias aliases_[]
static const char * names_[kNumRegisters]
static const char * Name(int reg)
static const char * names_[kNumVRegisters]
static const RegisterAlias aliases_[]
Endianness
LiftoffRegister reg
const uint32_t kCSTypeMask
const uint32_t kBImm12Mask
Hint NegateHint(Hint ignored)
const uint32_t kRvvMewMask
const uint32_t kRvcFunct2BMask
const uint32_t kRATypeMask
const int32_t kPrefHintLoadStreamed
const int kImm12Shift
const uint32_t kRvvNfMask
const uint32_t kITypeMask
constexpr int kPCRegister
const uint32_t kRvcFunct4Mask
const unsigned kDebuggerTracingDirectivesMask
const uint32_t kRs3FieldMask
const uint32_t kExceptionIsSwitchStackLimit
@ kDontCheckForInexactConversion
const int32_t kPrefHintStore
const uint32_t kFunct3Mask
const int32_t kPrefHintStoreRetained
const uint32_t kSTypeMask
const int kFloat64MantissaBits
const Instr rtCallRedirInstr
const int32_t kPrefHintLoad
constexpr uint32_t kMaxStopCode
const uint32_t kMaxWatchpointCode
const int32_t kPrefHintLoadRetained
constexpr DataProcessing3SourceOp MSUB
const int kInvalidStackOffset
const uint32_t kRvvMopMask
static const int kNegOffset
const int kFloat64ExponentBias
const uint32_t kRFPTypeMask
const uint32_t kMaxTracepointCode
const int kFloat32ExponentBias
const uint32_t kRvcBImm8Mask
const int32_t kPrefHintWritebackInvalidate
const uint32_t kFunct7Mask
const uint32_t kCRTypeMask
const int kNumFPURegisters
constexpr int kImm16Mask
const uint32_t kBTypeMask
const int kInvalidFPURegister
Union< Smi, HeapNumber > Number
Definition globals.h:1181
const uint32_t kRvcFunct6Mask
constexpr int kRvvSLEN
const uint32_t kImm11Mask
constexpr uint8_t kInstrSizeLog2
const uint32_t kRvvZimmMask
const int kNumSimuRegisters
const uint32_t kShamtMask
constexpr Opcode JAL
const int kInvalidRegister
const int kInvalidVRegister
const uint32_t kR4TypeMask
const uint32_t kRvvVs1Mask
const uint32_t kRvvWidthMask
const uint32_t kRvcFunct2Mask
constexpr Opcode LUI
Condition NegateCondition(Condition cond)
const uint32_t kUTypeMask
const uint32_t kRvcFunct3Mask
const uint32_t kFunct6Mask
constexpr size_t kMaxPCRelativeCodeRangeInMB
constexpr uint8_t kShortInstrSize
const int32_t kPrefHintPrepareForStore
const uint32_t kRvcOpcodeMask
const int kCArgsSlotsSize
const uint32_t kImm19_0Mask
const int kFloat32ExponentBits
const uint32_t kRvvVmMask
const uint32_t kRvvFunct6Mask
V8_EXPORT_PRIVATE FlagValues v8_flags
const uint32_t kRvvImm5Mask
const uint32_t kRTypeMask
const uint32_t kRvvRs1Mask
const uint32_t kRs1FieldMask
const uint32_t kRs2FieldMask
const int kFloat32MantissaBits
const int kBranchReturnOffset
const uint32_t kRvvRs2Mask
const uint32_t kImm31_12Mask
const uint32_t kRvvVs2Mask
const Instr kBreakInstr
const uint32_t kFunct2Mask
constexpr uint8_t kInstrSize
const uint32_t kFunct5Mask
const int kFloat64ExponentBits
const int kImm16Shift
constexpr DataProcessing3SourceOp MADD
const uint32_t kCATypeMask
constexpr int kRootRegisterBias
const uint32_t kRvvUimmMask
const int kRdFieldMask
const uint32_t kJTypeMask
Condition NegateFpuCondition(Condition cc)
constexpr int kRvvVLEN
const uint32_t kBaseOpcodeMask
const uint32_t kRvvVdMask
constexpr int kRvvELEN
const uint32_t kRvvRdMask
const uint32_t kImm20Mask
const Instr kIllegalInstr
const uint32_t kVTypeMask
constexpr int kNumRegisters
const int32_t kPrefHintStoreStreamed
const int kCArgSlotCount
#define DCHECK_NE(v1, v2)
Definition logging.h:486
#define DCHECK(condition)
Definition logging.h:482