v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
constant-riscv-f.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_F_H_
6#define V8_CODEGEN_RISCV_CONSTANT_RISCV_F_H_
7
9namespace v8 {
10namespace internal {
11
12// RV32F Standard Extension
13constexpr Opcode RO_FLW = LOAD_FP | (0b010 << kFunct3Shift);
14constexpr Opcode RO_FSW = STORE_FP | (0b010 << kFunct3Shift);
15constexpr Opcode RO_FMADD_S = MADD | (0b00 << kFunct2Shift);
16constexpr Opcode RO_FMSUB_S = MSUB | (0b00 << kFunct2Shift);
17constexpr Opcode RO_FNMSUB_S = NMSUB | (0b00 << kFunct2Shift);
18constexpr Opcode RO_FNMADD_S = NMADD | (0b00 << kFunct2Shift);
19constexpr Opcode RO_FADD_S = OP_FP | (0b0000000 << kFunct7Shift);
20constexpr Opcode RO_FSUB_S = OP_FP | (0b0000100 << kFunct7Shift);
21constexpr Opcode RO_FMUL_S = OP_FP | (0b0001000 << kFunct7Shift);
22constexpr Opcode RO_FDIV_S = OP_FP | (0b0001100 << kFunct7Shift);
23constexpr Opcode RO_FSQRT_S =
24 OP_FP | (0b0101100 << kFunct7Shift) | (0b00000 << kRs2Shift);
25constexpr Opcode RO_FSGNJ_S =
26 OP_FP | (0b000 << kFunct3Shift) | (0b0010000 << kFunct7Shift);
28 OP_FP | (0b001 << kFunct3Shift) | (0b0010000 << kFunct7Shift);
30 OP_FP | (0b010 << kFunct3Shift) | (0b0010000 << kFunct7Shift);
31constexpr Opcode RO_FMIN_S =
32 OP_FP | (0b000 << kFunct3Shift) | (0b0010100 << kFunct7Shift);
33constexpr Opcode RO_FMAX_S =
34 OP_FP | (0b001 << kFunct3Shift) | (0b0010100 << kFunct7Shift);
36 OP_FP | (0b1100000 << kFunct7Shift) | (0b00000 << kRs2Shift);
38 OP_FP | (0b1100000 << kFunct7Shift) | (0b00001 << kRs2Shift);
39constexpr Opcode RO_FMV = OP_FP | (0b1110000 << kFunct7Shift) |
40 (0b000 << kFunct3Shift) | (0b00000 << kRs2Shift);
41constexpr Opcode RO_FEQ_S =
42 OP_FP | (0b010 << kFunct3Shift) | (0b1010000 << kFunct7Shift);
43constexpr Opcode RO_FLT_S =
44 OP_FP | (0b001 << kFunct3Shift) | (0b1010000 << kFunct7Shift);
45constexpr Opcode RO_FLE_S =
46 OP_FP | (0b000 << kFunct3Shift) | (0b1010000 << kFunct7Shift);
48 OP_FP | (0b001 << kFunct3Shift) | (0b1110000 << kFunct7Shift);
50 OP_FP | (0b1101000 << kFunct7Shift) | (0b00000 << kRs2Shift);
52 OP_FP | (0b1101000 << kFunct7Shift) | (0b00001 << kRs2Shift);
53constexpr Opcode RO_FMV_W_X =
54 OP_FP | (0b000 << kFunct3Shift) | (0b1111000 << kFunct7Shift);
55
56#ifdef V8_TARGET_ARCH_RISCV64
57 // RV64F Standard Extension (in addition to RV32F)
58constexpr Opcode RO_FCVT_L_S =
59 OP_FP | (0b1100000 << kFunct7Shift) | (0b00010 << kRs2Shift);
60constexpr Opcode RO_FCVT_LU_S =
61 OP_FP | (0b1100000 << kFunct7Shift) | (0b00011 << kRs2Shift);
62constexpr Opcode RO_FCVT_S_L =
63 OP_FP | (0b1101000 << kFunct7Shift) | (0b00010 << kRs2Shift);
64constexpr Opcode RO_FCVT_S_LU =
65 OP_FP | (0b1101000 << kFunct7Shift) | (0b00011 << kRs2Shift);
66#endif // V8_TARGET_ARCH_RISCV64
67// clang-format on
68} // namespace internal
69} // namespace v8
70
71#endif // V8_CODEGEN_RISCV_CONSTANT_RISCV_F_H_
constexpr Opcode RO_FLE_S
constexpr Opcode RO_FMADD_S
constexpr Opcode RO_FCVT_S_W
constexpr Opcode RO_FLW
constexpr DataProcessing3SourceOp MSUB
constexpr Opcode RO_FEQ_S
constexpr Opcode RO_FCVT_WU_S
constexpr Opcode RO_FCVT_W_S
constexpr Opcode RO_FMIN_S
constexpr Opcode RO_FSGNJN_S
constexpr Opcode RO_FSUB_S
constexpr Opcode RO_FSGNJ_S
constexpr Opcode RO_FSQNJX_S
constexpr Opcode RO_FLT_S
constexpr Opcode RO_FADD_S
constexpr Opcode RO_FCLASS_S
constexpr Opcode RO_FSW
constexpr Opcode RO_FMV
constexpr Opcode RO_FMV_W_X
constexpr Opcode RO_FMUL_S
constexpr DataProcessing3SourceOp MADD
constexpr Opcode RO_FCVT_S_WU
constexpr Opcode RO_FMAX_S
constexpr Opcode RO_FNMSUB_S
constexpr Opcode RO_FSQRT_S
constexpr Opcode RO_FNMADD_S
constexpr Opcode RO_FDIV_S
constexpr Opcode RO_FMSUB_S