16#ifndef NEORV32_INTRINSICS_H
17#define NEORV32_INTRINSICS_H
26#define RISCV_OPCODE_CUSTOM0 0b0001011
27#define RISCV_OPCODE_CUSTOM1 0b0101011
28#define RISCV_OPCODE_OP32 0b0111011
29#define RISCV_OPCODE_OPIMM32 0b0011011
42inline uint32_t __attribute__ ((always_inline))
RISCV_INSTR_R_TYPE(
const int opcode,
const int funct3,
const int funct7, uint32_t rs1, uint32_t rs2) {
44 register uint32_t __rd;
45 register uint32_t __rs1 = rs1;
46 register uint32_t __rs2 = rs2;
48 asm volatile (
".insn r %3, %4, %5, %0, %1, %2" :
"=r"(__rd) :
"r"(__rs1),
"r"(__rs2),
"i"(opcode),
"i"(funct3),
"i"(funct7));
62inline uint32_t __attribute__ ((always_inline))
RISCV_INSTR_I_TYPE(
const int opcode,
const int funct3, uint32_t rs1,
const int imm12) {
64 register uint32_t __rd;
65 register uint32_t __rs1 = rs1;
67 asm volatile (
".insn i %2, %3, %0, %1, %4" :
"=r"(__rd) :
"r"(__rs1),
"i"(opcode),
"i"(funct3),
"i"(imm12));
Main NEORV32 core library / driver / HAL include file.
uint32_t RISCV_INSTR_I_TYPE(const int opcode, const int funct3, uint32_t rs1, const int imm12)
Definition neorv32_intrinsics.h:62
uint32_t RISCV_INSTR_R_TYPE(const int opcode, const int funct3, const int funct7, uint32_t rs1, uint32_t rs2)
Definition neorv32_intrinsics.h:42