v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
constant-riscv-m.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_CONSTANT_RISCV_M_H_
6#define V8_CODEGEN_RISCV_CONSTANT_RISCV_M_H_
7
9namespace v8 {
10namespace internal {
11
12// RV32M Standard Extension
13constexpr Opcode RO_MUL =
14 OP | (0b000 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
15constexpr Opcode RO_MULH =
16 OP | (0b001 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
17constexpr Opcode RO_MULHSU =
18 OP | (0b010 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
19constexpr Opcode RO_MULHU =
20 OP | (0b011 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
21constexpr Opcode RO_DIV =
22 OP | (0b100 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
23constexpr Opcode RO_DIVU =
24 OP | (0b101 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
25constexpr Opcode RO_REM =
26 OP | (0b110 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
27constexpr Opcode RO_REMU =
28 OP | (0b111 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
29
30#ifdef V8_TARGET_ARCH_RISCV64
31// RV64M Standard Extension (in addition to RV32M)
32constexpr Opcode RO_MULW =
33 OP_32 | (0b000 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
34constexpr Opcode RO_DIVW =
35 OP_32 | (0b100 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
36constexpr Opcode RO_DIVUW =
37 OP_32 | (0b101 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
38constexpr Opcode RO_REMW =
39 OP_32 | (0b110 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
40constexpr Opcode RO_REMUW =
41 OP_32 | (0b111 << kFunct3Shift) | (0b0000001 << kFunct7Shift);
42#endif
43// clang-format on
44} // namespace internal
45} // namespace v8
46
47#endif // V8_CODEGEN_RISCV_CONSTANT_RISCV_M_H_
constexpr Opcode RO_MULH
constexpr Opcode RO_MULHU
constexpr Opcode RO_REM
constexpr Opcode RO_REMU
constexpr Opcode RO_DIVU
constexpr Opcode RO_DIV
constexpr Opcode RO_MUL
constexpr Opcode RO_MULHSU