![]() |
NMSIS-Core
Version 1.4.0
NMSIS-Core support for Nuclei processor-based devices
|
Non-SIMD Miscellaneous Instructions. More...
Macros | |
#define | __RV_BITREVI(a, b) |
BITREVI (Bit Reverse Immediate) More... | |
#define | __RV_INSB(t, a, b) |
INSB (Insert Byte) More... | |
#define | __RV_SRAI_U(a, b) |
SRAI.u (Rounding Shift Right Arithmetic Immediate) More... | |
#define | __RV_WEXTI(a, b) |
WEXTI (Extract Word from 64-bit Immediate) More... | |
Functions | |
__STATIC_FORCEINLINE long | __RV_AVE (long a, long b) |
AVE (Average with Rounding) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_BITREV (unsigned long a, unsigned long b) |
BITREV (Bit Reverse) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_BPICK (unsigned long a, unsigned long b, unsigned long c) |
BPICK (Bit-wise Pick) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_MADDR32 (unsigned long t, unsigned long a, unsigned long b) |
MADDR32 (Multiply and Add to 32-Bit Word) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_MSUBR32 (unsigned long t, unsigned long a, unsigned long b) |
MSUBR32 (Multiply and Subtract from 32-Bit Word) More... | |
__STATIC_FORCEINLINE long | __RV_SRA_U (long a, unsigned int b) |
SRA.u (Rounding Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SWAP8 (unsigned long a) |
SWAP8 (Swap Byte within Halfword) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SWAP16 (unsigned long a) |
SWAP16 (Swap Halfword within Word) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_WEXT (long long a, unsigned int b) |
WEXT (Extract Word from 64-bit) More... | |
Non-SIMD Miscellaneous Instructions.
There are 13 Miscellaneous Instructions here.
#define __RV_BITREVI | ( | a, | |
b | |||
) |
BITREVI (Bit Reverse Immediate)
Type: DSP
Syntax:
Purpose:
Reverse the bit positions of the source operand within a specified width starting from bit 0. The reversed width is an immediate value.
Description:
This instruction reverses the bit positions of the content of Rs1. The reversed bit width is calculated as imm[4:0]+1 (RV32) or imm[5:0]+1 (RV64). The upper bits beyond the reversed width are filled with zeros. After the bit reverse operation, the result is written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 665 of file core_feature_dsp.h.
#define __RV_INSB | ( | t, | |
a, | |||
b | |||
) |
INSB (Insert Byte)
Type: DSP
Syntax:
Purpose:
Insert byte 0 of a 32-bit or 64-bit register into one of the byte elements of another register.
Description:
This instruction inserts byte 0 of Rs1 into byte imm[1:0]
(RV32) or imm[2:0]
(RV64) of Rd.
Operations:
[in] | t | unsigned long type of value stored in t |
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 1368 of file core_feature_dsp.h.
#define __RV_SRAI_U | ( | a, | |
b | |||
) |
SRAI.u (Rounding Shift Right Arithmetic Immediate)
Type: DSP
Syntax:
Purpose:
Perform an arithmetic right shift operation with rounding. The shift amount is an immediate value.
Description:
This instruction right-shifts the content of Rs1 arithmetically. The shifted out bits are filled with the sign-bit and the shift amount is specified by the imm6u[4:0] (RV32) or imm6u[5:0] (RV64) constant . For the rounding operation, a value of 1 is added to the most significant discarded bit of the data to calculate the final result. And the result is written to Rd.
Operations:
[in] | a | long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 9678 of file core_feature_dsp.h.
#define __RV_WEXTI | ( | a, | |
b | |||
) |
WEXTI (Extract Word from 64-bit Immediate)
Type: DSP
Syntax:
Purpose:
Extract a 32-bit word from a 64-bit value stored in an even/odd pair of registers (RV32) or a register (RV64) starting from a specified immediate LSB bit position.
RV32 Description:
This instruction extracts a 32-bit word from a 64-bit value of an even/odd pair of registers specified by Rs1(4,1) starting from a specified immediate LSB bit position, #LSBloc. The extracted word is written to Rd. Rs1(4,1), i.e., d, determines the even/odd pair group of the two registers. Specifically, the register pair includes register 2d and 2d+1. The odd 2d+1
register of the pair contains the high 32-bit of the 64-bit value and the even 2d
register of the pair contains the low 32-bit of the 64-bit value.
RV64 Description:
This instruction extracts a 32-bit word from a 64-bit value in Rs1 starting from a specified immediate LSB bit position, #LSBloc. The extracted word is sign-extended and written to lower 32- bit of Rd.
Operations:
[in] | a | long long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 13486 of file core_feature_dsp.h.
__STATIC_FORCEINLINE long __RV_AVE | ( | long | a, |
long | b | ||
) |
AVE (Average with Rounding)
Type: DSP
Syntax:
Purpose:
Calculate the average of the contents of two general registers.
Description:
This instruction calculates the average value of two signed integers stored in Rs1 and Rs2, rounds up a half-integer result to the nearest integer, and writes the result to Rd.
Operations:
[in] | a | long type of value stored in a |
[in] | b | long type of value stored in b |
Definition at line 582 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_BITREV | ( | unsigned long | a, |
unsigned long | b | ||
) |
BITREV (Bit Reverse)
Type: DSP
Syntax:
Purpose:
Reverse the bit positions of the source operand within a specified width starting from bit 0. The reversed width is a variable from a GPR.
Description:
This instruction reverses the bit positions of the content of Rs1. The reversed bit width is calculated as Rs2[4:0]+1 (RV32) or Rs2[5:0]+1 (RV64). The upper bits beyond the reversed width are filled with zeros. After the bit reverse operation, the result is written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 623 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_BPICK | ( | unsigned long | a, |
unsigned long | b, | ||
unsigned long | c | ||
) |
BPICK (Bit-wise Pick)
Type: DSP
Syntax:
Purpose:
Select from two source operands based on a bit mask in the third operand.
Description:
This instruction selects individual bits from Rs1 or Rs2, based on the bit mask value in Rc. If a bit in Rc is 1, the corresponding bit is from Rs1; otherwise, the corresponding bit is from Rs2. The selection results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
[in] | c | unsigned long type of value stored in c |
Definition at line 706 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_MADDR32 | ( | unsigned long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
MADDR32 (Multiply and Add to 32-Bit Word)
Type: DSP
Syntax:
Purpose:
Multiply the 32-bit contents of two registers and add the lower 32-bit multiplication result to the 32-bit content of a destination register. Write the final result back to the destination register.
Description:
This instruction multiplies the lower 32-bit content of Rs1 with that of Rs2. It adds the lower 32-bit multiplication result to the lower 32-bit content of Rd and writes the final result (RV32) or sign-extended result (RV64) back to Rd. The contents of Rs1 and Rs2 can be either signed or unsigned integers.
Operations:
[in] | t | unsigned long type of value stored in t |
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 5749 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_MSUBR32 | ( | unsigned long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
MSUBR32 (Multiply and Subtract from 32-Bit Word)
Type: DSP
Syntax:
Purpose:
Multiply the 32-bit contents of two registers and subtract the lower 32-bit multiplication result from the 32-bit content of a destination register. Write the final result back to the destination register.
Description:
This instruction multiplies the lower 32-bit content of Rs1 with that of Rs2, subtracts the lower 32-bit multiplication result from the lower 32-bit content of Rd, then writes the final result (RV32) or sign-extended result (RV64) back to Rd. The contents of Rs1 and Rs2 can be either signed or unsigned integers.
Operations:
[in] | t | unsigned long type of value stored in t |
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 5871 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_SRA_U | ( | long | a, |
unsigned int | b | ||
) |
SRA.u (Rounding Shift Right Arithmetic)
Type: DSP
Syntax:
Purpose:
Perform an arithmetic right shift operation with rounding. The shift amount is a variable from a GPR.
Description:
This instruction right-shifts the content of Rs1 arithmetically. The shifted out bits are filled with the sign-bit and the shift amount is specified by the low-order 5-bits (RV32) or 6-bits (RV64) of the Rs2 register. For the rounding operation, a value of 1 is added to the most significant discarded bit of the data to calculate the final result. And the result is written to Rd.
Operations:
[in] | a | long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 9623 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SWAP16 | ( | unsigned long | a | ) |
SWAP16 (Swap Halfword within Word)
Type: DSP
Syntax:
Purpose:
Swap the 16-bit halfwords within each word of a register.
Description:
This instruction swaps the 16-bit halfwords within each word of Rs1 and writes the result to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
Definition at line 11067 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SWAP8 | ( | unsigned long | a | ) |
SWAP8 (Swap Byte within Halfword)
Type: DSP
Syntax:
Purpose:
Swap the bytes within each halfword of a register.
Description:
This instruction swaps the bytes within each halfword of Rs1 and writes the result to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
Definition at line 11030 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_WEXT | ( | long long | a, |
unsigned int | b | ||
) |
WEXT (Extract Word from 64-bit)
Type: DSP
Syntax:
Purpose:
Extract a 32-bit word from a 64-bit value stored in an even/odd pair of registers (RV32) or a register (RV64) starting from a specified LSB bit position in a register.
RV32 Description:
This instruction extracts a 32-bit word from a 64-bit value of an even/odd pair of registers specified by Rs1(4,1) starting from a specified LSB bit position, specified in Rs2[4:0]. The extracted word is written to Rd. Rs1(4,1), i.e., d, determines the even/odd pair group of the two registers. Specifically, the register pair includes register 2d and 2d+1. The odd 2d+1
register of the pair contains the high 32-bit of the 64-bit value and the even 2d
register of the pair contains the low 32-bit of the 64-bit value.
Operations:
[in] | a | long long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 13537 of file core_feature_dsp.h.
References __ASM.