NMSIS-Core
Version 1.2.0
NMSIS-Core support for Nuclei processor-based devices
|
(RV32 only)Nuclei Customized N1 DSP Instructions More...
Functions | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKHM8 (unsigned long long a, unsigned long long b) |
DKHM8 (64-bit SIMD Signed Saturating Q7 Multiply) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKHM16 (unsigned long long a, unsigned long long b) |
DKHM16 (64-bit SIMD Signed Saturating Q15 Multiply) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKABS8 (unsigned long long a) |
DKABS8 (64-bit SIMD 8-bit Saturating Absolute) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKABS16 (unsigned long long a) |
DKABS16 (64-bit SIMD 16-bit Saturating Absolute) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKSLRA8 (unsigned long long a, int b) |
DKSLRA8 (64-bit SIMD 8-bit Shift Left Logical with Saturation or Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKSLRA16 (unsigned long long a, int b) |
DKSLRA16 (64-bit SIMD 16-bit Shift Left Logical with Saturation or Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKADD8 (unsigned long long a, unsigned long long b) |
DKADD8 (64-bit SIMD 8-bit Signed Saturating Addition) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKADD16 (unsigned long long a, unsigned long long b) |
DKADD16 (64-bit SIMD 16-bit Signed Saturating Addition) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKSUB8 (unsigned long long a, unsigned long long b) |
DKSUB8 (64-bit SIMD 8-bit Signed Saturating Subtraction) More... | |
__STATIC_FORCEINLINE unsigned long long | __RV_DKSUB16 (unsigned long long a, unsigned long long b) |
DKSUB16 (64-bit SIMD 16-bit Signed Saturating Subtraction) More... | |
(RV32 only)Nuclei Customized N1 DSP Instructions
This is Nuclei customized DSP N1 instructions only for RV32
__STATIC_FORCEINLINE unsigned long long __RV_DKABS16 | ( | unsigned long long | a | ) |
DKABS16 (64-bit SIMD 16-bit Saturating Absolute)
Type: SIMD
Syntax:
Purpose:
Get the absolute value of 16-bit signed integer elements simultaneously.
Description:
This instruction calculates the absolute value of 16-bit signed integer elements stored in Rs1 and writes the element results to Rd. If the input number is 0x8000, this instruction generates 0x7fff as the output and sets the OV bit to 1.
Operations:
[in] | a | unsigned long long type of value stored in a |
Definition at line 18396 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKABS8 | ( | unsigned long long | a | ) |
DKABS8 (64-bit SIMD 8-bit Saturating Absolute)
Type: SIMD
Syntax:
Purpose:
Get the absolute value of 8-bit signed integer elements simultaneously.
Description:
This instruction calculates the absolute value of 8-bit signed integer elements stored in Rs1 and writes the element results to Rd. If the input number is 0x80, this instruction generates 0x7f as the output and sets the OV bit to 1.
Operations:
[in] | a | unsigned long long type of value stored in a |
Definition at line 18351 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKADD16 | ( | unsigned long long | a, |
unsigned long long | b | ||
) |
DKADD16 (64-bit SIMD 16-bit Signed Saturating Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element saturating additions simultaneously.
Description:
This instruction adds the 16-bit signed integer elements in Rs1 with the 16-bit signed integer elements in Rs2. If any of the results are beyond the Q15 number range (-2^15 <= Q15 <= 2^15-1), they are saturated to the range and the OV bit is set to 1. The saturated results are written to Rd.
Operations:
[in] | a | unsigned long long type of value stored in a |
[in] | b | unsigned long long type of value stored in b |
Definition at line 18607 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKADD8 | ( | unsigned long long | a, |
unsigned long long | b | ||
) |
DKADD8 (64-bit SIMD 8-bit Signed Saturating Addition)
Type: SIMD
Syntax:
Purpose:
Do 8-bit signed integer element saturating additions simultaneously.
Description:
This instruction adds the 8-bit signed integer elements in Rs1 with the 8-bit signed integer elements in Rs2. If any of the results are beyond the Q7 number range (-2^7 <= Q7 <= 2^7-1), they are saturated to the range and the OV bit is set to 1. The saturated results are written to Rd.
Operations:
[in] | a | unsigned long long type of value stored in a |
[in] | b | unsigned long long type of value stored in b |
Definition at line 18560 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKHM16 | ( | unsigned long long | a, |
unsigned long long | b | ||
) |
DKHM16 (64-bit SIMD Signed Saturating Q15 Multiply)
Type: SIMD
Syntax:
Purpose:
Do Q15xQ15 element multiplications simultaneously. The Q30 results are then reduced to Q15 numbers again.
Description:
For the DKHM16
instruction, multiply the top 16-bit Q15 content of 32-bit chunks in Rs1 with the top 16-bit Q15 content of 32-bit chunks in Rs2. At the same time, multiply the bottom 16-bit Q15 content of 32-bit chunks in Rs1 with the bottom 16-bit Q15 content of 32-bit chunks in Rs2.
The Q30 results are then right-shifted 15-bits and saturated into Q15 values. The Q15 results are then written into Rd. When both the two Q15 inputs of a multiplication are 0x8000, saturation will happen. The result will be saturated to 0x7FFF and the overflow flag OV will be set.
Operations:
[in] | a | unsigned long long type of value stored in a |
[in] | b | unsigned long long type of value stored in b |
Definition at line 18306 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKHM8 | ( | unsigned long long | a, |
unsigned long long | b | ||
) |
DKHM8 (64-bit SIMD Signed Saturating Q7 Multiply)
Type: SIMD
Syntax:
Purpose:
Do Q7xQ7 element multiplications simultaneously. The Q14 results are then reduced to Q7 numbers again.
Description:
For the DKHM8
instruction, multiply the top 8-bit Q7 content of 16-bit chunks in Rs1 with the top 8-bit Q7 content of 16-bit chunks in Rs2. At the same time, multiply the bottom 8-bit Q7 content of 16-bit chunks in Rs1 with the bottom 8-bit Q7 content of 16-bit chunks in Rs2.
The Q14 results are then right-shifted 7-bits and saturated into Q7 values. The Q7 results are then written into Rd. When both the two Q7 inputs of a multiplication are 0x80, saturation will happen. The result will be saturated to 0x7F and the overflow flag OV will be set.
Operations:
[in] | a | unsigned long long type of value stored in a |
[in] | b | unsigned long long type of value stored in b |
Definition at line 18251 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKSLRA16 | ( | unsigned long long | a, |
int | b | ||
) |
DKSLRA16 (64-bit SIMD 16-bit Shift Left Logical with Saturation or Shift Right Arithmetic)
Type: SIMD
Syntax:
Purpose:
Do 16-bit elements logical left (positive) or arithmetic right (negative) shift operation with Q15 saturation for the left shift.
Description:
The 16-bit data elements of Rs1 are left-shifted logically or right-shifted arithmetically based on the value of Rs2[4:0]. Rs2[4:0] is in the signed range of [-2^4, 2^4-1]. A positive Rs2[4:0] means logical left shift and a negative Rs2[4:0] means arithmetic right shift. The shift amount is the absolute value of Rs2[4:0]. However, the behavior of Rs2[4:0]==-2^4 (0x10)
is defined to be equivalent to the behavior of Rs2[4:0]==-(2^4-1) (0x11)
. The left-shifted results are saturated to the 16-bit signed integer range of [-2^15, 2^15-1]. After the shift, saturation, or rounding, the final results are written to Rd. If any saturation happens, this instruction sets the OV flag. The value of Rs2[31:5] will not affect this instruction.
Operations:
[in] | a | unsigned long long type of value stored in a |
[in] | b | int type of value stored in b |
Definition at line 18513 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKSLRA8 | ( | unsigned long long | a, |
int | b | ||
) |
DKSLRA8 (64-bit SIMD 8-bit Shift Left Logical with Saturation or Shift Right Arithmetic)
Type: SIMD
Syntax:
Purpose:
Do 8-bit elements logical left (positive) or arithmetic right (negative) shift operation with Q7 saturation for the left shift.
Description:
The 8-bit data elements of Rs1 are left-shifted logically or right-shifted arithmetically based on the value of Rs2[3:0]. Rs2[3:0] is in the signed range of [-2^3, 2^3-1]. A positive Rs2[3:0] means logical left shift and a negative Rs2[3:0] means arithmetic right shift. The shift amount is the absolute value of Rs2[3:0]. However, the behavior of Rs2[3:0]==-2^3 (0x8)
is defined to be equivalent to the behavior of Rs2[3:0]==-(2^3-1) (0x9)
. The left-shifted results are saturated to the 8-bit signed integer range of [-2^7, 2^7-1]. If any saturation happens, this instruction sets the OV flag. The value of Rs2[31:4] will not affect this instruction.
Operations:
[in] | a | unsigned long long type of value stored in a |
[in] | b | int type of value stored in b |
Definition at line 18454 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKSUB16 | ( | unsigned long long | a, |
unsigned long long | b | ||
) |
DKSUB16 (64-bit SIMD 16-bit Signed Saturating Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer elements saturating subtractions simultaneously.
Description:
This instruction subtracts the 16-bit signed integer elements in Rs2 from the 16-bit signed integer elements in Rs1. If any of the results are beyond the Q15 number range (-2^15 <= Q15 <= 2^15-1), they are saturated to the range and the OV bit is set to 1. The saturated results are written to Rd.
Operations:
[in] | a | unsigned long long type of value stored in a |
[in] | b | unsigned long long type of value stored in b |
Definition at line 18702 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long long __RV_DKSUB8 | ( | unsigned long long | a, |
unsigned long long | b | ||
) |
DKSUB8 (64-bit SIMD 8-bit Signed Saturating Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 8-bit signed elements saturating subtractions simultaneously.
Description:
This instruction subtracts the 8-bit signed integer elements in Rs2 from the 8-bit signed integer elements in Rs1. If any of the results are beyond the Q7 number range (-2^7 <= Q7 <= 2^7-1), they are saturated to the range and the OV bit is set to 1. The saturated results are written to Rd.
Operations:
[in] | a | unsigned long long type of value stored in a |
[in] | b | unsigned long long type of value stored in b |
Definition at line 18654 of file core_feature_dsp.h.
References __ASM.