Visible to Intel only — GUID: fmc1675823085414
Ixiasoft
Visible to Intel only — GUID: fmc1675823085414
Ixiasoft
4.2.2. Software C-Macro Table
Unlike the Hardware Interfaces Table, the Software C-Macro Table configures the custom instruction software C Macro for software development. Note that, any assignment made need to correlates to the earlier assignments in Hardware Interfaces Table.
Select the symbol + to add new assignment, and - to delete it. Each assignment results in a single Nios® V processor custom instruction Software C Macro in the system.h file.
Parameter | Description |
---|---|
Opcode |
|
funct7[6:4] |
|
funct7[3:0] |
|
funct3[2:0] |
|
mnemonic |
|
C Macros in system.h
#define CUSTOM_0_000(VAL_1, VAL_2) ({ \ int output; \ asm volatile (".insn r 0x0B, 0x0, 0x0, %[out], %[input1], %[input2]" \ : [out] "=r" (output) \ : [input1] "r" (VAL_1), [input2] "r" (VAL_2)); \ output; \ }) #define CUSTOM_0_111(VAL_1, VAL_2) ({ \ int output; \ asm volatile (".insn r 0x0B, 0x0, 0x70, %[out], %[input1], %[input2]" \ : [out] "=r" (output) \ : [input1] "r" (VAL_1), [input2] "r" (VAL_2)); \ output; \ }) #define CUSTOM_1_XXX(VAL_1, VAL_2, F3, F7) ({ \ int output; \ asm volatile (".insn r 0x2B, %[FUNCT3], (0x0 | (%[FUNCT7]<<0)), %[out], %[input1], %[input2]" \ : [out] "=r" (output) \ : [input1] "r" (VAL_1), [input2] "r" (VAL_2), [FUNCT3] "i" (F3), [FUNCT7] "i" (F7)); \ output; \ }) #define CUSTOM_2_0XX(VAL_1, VAL_2, F3, F7) ({ \ int output; \ asm volatile (".insn r 0x5B, %[FUNCT3], (0x10 | (%[FUNCT7]<<0)), %[out], %[input1], %[input2]" \ : [out] "=r" (output) \ : [input1] "r" (VAL_1), [input2] "r" (VAL_2), [FUNCT3] "i" (F3), [FUNCT7] "i" (F7)); \ output; \ }) #define CUSTOM_3_10X(VAL_1, VAL_2) ({ \ int output; \ asm volatile (".insn r 0x7B, 0x0, 0x50, %[out], %[input1], %[input2]" \ : [out] "=r" (output) \ : [input1] "r" (VAL_1), [input2] "r" (VAL_2)); \ output; \ })