v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
constant-riscv-d.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_D_H_
6#define V8_CODEGEN_RISCV_CONSTANT_RISCV_D_H_
7
9namespace v8 {
10namespace internal {
11
12// RV32D Standard Extension
13constexpr Opcode RO_FLD = LOAD_FP | (0b011 << kFunct3Shift);
14constexpr Opcode RO_FSD = STORE_FP | (0b011 << kFunct3Shift);
15constexpr Opcode RO_FMADD_D = MADD | (0b01 << kFunct2Shift);
16constexpr Opcode RO_FMSUB_D = MSUB | (0b01 << kFunct2Shift);
17constexpr Opcode RO_FNMSUB_D = NMSUB | (0b01 << kFunct2Shift);
18constexpr Opcode RO_FNMADD_D = NMADD | (0b01 << kFunct2Shift);
19constexpr Opcode RO_FADD_D = OP_FP | (0b0000001 << kFunct7Shift);
20constexpr Opcode RO_FSUB_D = OP_FP | (0b0000101 << kFunct7Shift);
21constexpr Opcode RO_FMUL_D = OP_FP | (0b0001001 << kFunct7Shift);
22constexpr Opcode RO_FDIV_D = OP_FP | (0b0001101 << kFunct7Shift);
23constexpr Opcode RO_FSQRT_D =
24 OP_FP | (0b0101101 << kFunct7Shift) | (0b00000 << kRs2Shift);
25constexpr Opcode RO_FSGNJ_D =
26 OP_FP | (0b000 << kFunct3Shift) | (0b0010001 << kFunct7Shift);
28 OP_FP | (0b001 << kFunct3Shift) | (0b0010001 << kFunct7Shift);
30 OP_FP | (0b010 << kFunct3Shift) | (0b0010001 << kFunct7Shift);
31constexpr Opcode RO_FMIN_D =
32 OP_FP | (0b000 << kFunct3Shift) | (0b0010101 << kFunct7Shift);
33constexpr Opcode RO_FMAX_D =
34 OP_FP | (0b001 << kFunct3Shift) | (0b0010101 << kFunct7Shift);
36 OP_FP | (0b0100000 << kFunct7Shift) | (0b00001 << kRs2Shift);
38 OP_FP | (0b0100001 << kFunct7Shift) | (0b00000 << kRs2Shift);
39constexpr Opcode RO_FEQ_D =
40 OP_FP | (0b010 << kFunct3Shift) | (0b1010001 << kFunct7Shift);
41constexpr Opcode RO_FLT_D =
42 OP_FP | (0b001 << kFunct3Shift) | (0b1010001 << kFunct7Shift);
43constexpr Opcode RO_FLE_D =
44 OP_FP | (0b000 << kFunct3Shift) | (0b1010001 << kFunct7Shift);
45constexpr Opcode RO_FCLASS_D = OP_FP | (0b001 << kFunct3Shift) |
46 (0b1110001 << kFunct7Shift) |
47 (0b00000 << kRs2Shift);
49 OP_FP | (0b1100001 << kFunct7Shift) | (0b00000 << kRs2Shift);
51 OP_FP | (0b1100001 << kFunct7Shift) | (0b00001 << kRs2Shift);
53 OP_FP | (0b1101001 << kFunct7Shift) | (0b00000 << kRs2Shift);
55 OP_FP | (0b1101001 << kFunct7Shift) | (0b00001 << kRs2Shift);
56
57#ifdef V8_TARGET_ARCH_RISCV64
58 // RV64D Standard Extension (in addition to RV32D)
59constexpr Opcode RO_FCVT_L_D =
60 OP_FP | (0b1100001 << kFunct7Shift) | (0b00010 << kRs2Shift);
61constexpr Opcode RO_FCVT_LU_D =
62 OP_FP | (0b1100001 << kFunct7Shift) | (0b00011 << kRs2Shift);
63constexpr Opcode RO_FMV_X_D = OP_FP | (0b000 << kFunct3Shift) |
64 (0b1110001 << kFunct7Shift) |
65 (0b00000 << kRs2Shift);
66constexpr Opcode RO_FCVT_D_L =
67 OP_FP | (0b1101001 << kFunct7Shift) | (0b00010 << kRs2Shift);
68constexpr Opcode RO_FCVT_D_LU =
69 OP_FP | (0b1101001 << kFunct7Shift) | (0b00011 << kRs2Shift);
70constexpr Opcode RO_FMV_D_X = OP_FP | (0b000 << kFunct3Shift) |
71 (0b1111001 << kFunct7Shift) |
72 (0b00000 << kRs2Shift);
73#endif
74// clang-format on
75} // namespace internal
76} // namespace v8
77
78#endif // V8_CODEGEN_RISCV_CONSTANT_RISCV_D_H_
constexpr Opcode RO_FMAX_D
constexpr Opcode RO_FSGNJ_D
constexpr Opcode RO_FCVT_D_W
constexpr Opcode RO_FCVT_WU_D
constexpr Opcode RO_FSGNJN_D
constexpr Opcode RO_FSQNJX_D
constexpr DataProcessing3SourceOp MSUB
constexpr Opcode RO_FCVT_W_D
constexpr Opcode RO_FLD
constexpr Opcode RO_FCVT_D_WU
constexpr Opcode RO_FEQ_D
constexpr Opcode RO_FLT_D
constexpr Opcode RO_FCLASS_D
constexpr Opcode RO_FCVT_D_S
constexpr Opcode RO_FSQRT_D
constexpr Opcode RO_FNMADD_D
constexpr Opcode RO_FADD_D
constexpr Opcode RO_FMADD_D
constexpr Opcode RO_FCVT_S_D
constexpr Opcode RO_FMSUB_D
constexpr Opcode RO_FSUB_D
constexpr Opcode RO_FMUL_D
constexpr Opcode RO_FNMSUB_D
constexpr DataProcessing3SourceOp MADD
constexpr Opcode RO_FDIV_D
constexpr Opcode RO_FLE_D
constexpr Opcode RO_FMIN_D
constexpr Opcode RO_FSD