Prototypes for custom RISC-V instructions ("intrinsics"). Based on the ".insn" pseudo directive: https://sourceware.org/binutils/docs/as/RISC_002dV_002dFormats.html.
More...
#include <neorv32.h>
#include <stdint.h>
Go to the source code of this file.
|
|
|
#define | RISCV_OPCODE_CUSTOM0 0b0001011 |
| |
|
#define | RISCV_OPCODE_CUSTOM1 0b0101011 |
| |
|
| uint32_t | RISCV_INSTR_R_TYPE (const int opcode, const int funct3, const int funct7, uint32_t rs1, uint32_t rs2) |
| |
| uint32_t | RISCV_INSTR_I_TYPE (const int opcode, const int funct3, uint32_t rs1, const int imm12) |
| |
Prototypes for custom RISC-V instructions ("intrinsics"). Based on the ".insn" pseudo directive: https://sourceware.org/binutils/docs/as/RISC_002dV_002dFormats.html.
◆ RISCV_INSTR_I_TYPE()
| uint32_t RISCV_INSTR_I_TYPE |
( |
const int | opcode, |
|
|
const int | funct3, |
|
|
uint32_t | rs1, |
|
|
const int | imm12 ) |
|
inline |
Emit a RISC-V I-type instruction.
- Parameters
-
| [in] | opcode | Opcode (7-bit). |
| [in] | funct3 | Function select (3-bit). |
| [in] | rs1 | Register source operand 1 (32-bit). |
| [in] | imm12 | Immediate source operand (12-bit). |
- Returns
- Instruction result (destination register rd, 32-bit).
◆ RISCV_INSTR_R_TYPE()
| uint32_t RISCV_INSTR_R_TYPE |
( |
const int | opcode, |
|
|
const int | funct3, |
|
|
const int | funct7, |
|
|
uint32_t | rs1, |
|
|
uint32_t | rs2 ) |
|
inline |
Emit a RISC-V R-type instruction.
- Parameters
-
| [in] | opcode | Opcode (7-bit). |
| [in] | funct3 | Function select (3-bit). |
| [in] | funct7 | Function select (7-bit). |
| [in] | rs1 | Register source operand 1 (32-bit). |
| [in] | rs2 | Register source operand 2 (32-bit). |
- Returns
- Instruction result (destination register rd, 32-bit).