NMSIS-Core
Version 1.2.0
NMSIS-Core support for Nuclei processor-based devices
|
SIMD 8-bit Addition & Subtraction Instructions. More...
Functions | |
__STATIC_FORCEINLINE unsigned long | __RV_ADD8 (unsigned long a, unsigned long b) |
ADD8 (SIMD 8-bit Addition) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_KADD8 (unsigned long a, unsigned long b) |
KADD8 (SIMD 8-bit Signed Saturating Addition) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_KSUB8 (unsigned long a, unsigned long b) |
KSUB8 (SIMD 8-bit Signed Saturating Subtraction) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_RADD8 (unsigned long a, unsigned long b) |
RADD8 (SIMD 8-bit Signed Halving Addition) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_RSUB8 (unsigned long a, unsigned long b) |
RSUB8 (SIMD 8-bit Signed Halving Subtraction) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SUB8 (unsigned long a, unsigned long b) |
SUB8 (SIMD 8-bit Subtraction) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_UKADD8 (unsigned long a, unsigned long b) |
UKADD8 (SIMD 8-bit Unsigned Saturating Addition) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_UKSUB8 (unsigned long a, unsigned long b) |
UKSUB8 (SIMD 8-bit Unsigned Saturating Subtraction) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_URADD8 (unsigned long a, unsigned long b) |
URADD8 (SIMD 8-bit Unsigned Halving Addition) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_URSUB8 (unsigned long a, unsigned long b) |
URSUB8 (SIMD 8-bit Unsigned Halving Subtraction) More... | |
SIMD 8-bit Addition & Subtraction Instructions.
Based on the types of the four 8-bit arithmetic operations, the SIMD 8-bit add/subtract instructions can be classified into 2 main categories: Addition (four 8-bit addition), and Subtraction (four 8-bit subtraction). Based on the way of how an overflow condition is handled for singed or unsigned operation, the SIMD 8-bit add/subtract instructions can be classified into 5 groups: Wrap-around (dropping overflow), Signed Halving (keeping overflow by dropping 1 LSB bit), Unsigned Halving, Signed Saturation (clipping overflow), and Unsigned Saturation. Together, there are 10 SIMD 8-bit add/subtract instructions.
__STATIC_FORCEINLINE unsigned long __RV_ADD8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
ADD8 (SIMD 8-bit Addition)
Type: SIMD
Syntax:
Purpose:
Do 8-bit integer element additions simultaneously.
Description:
This instruction adds the 8-bit integer elements in Rs1 with the 8-bit integer elements in Rs2, and then writes the 8-bit element results to Rd.
Note:
This instruction can be used for either signed or unsigned addition.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 449 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_KADD8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
KADD8 (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 type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 1553 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_KSUB8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
KSUB8 (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 <= 27 -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 type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 5382 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_RADD8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
RADD8 (SIMD 8-bit Signed Halving Addition)
Type: SIMD
Syntax:
Purpose:
Do 8-bit signed integer element additions simultaneously. The element results are halved to avoid overflow or saturation.
Description:
This instruction adds the 8-bit signed integer elements in Rs1 with the 8-bit signed integer elements in Rs2. The results are first arithmetically right-shifted by 1 bit and then written to Rd.
Examples:
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 6303 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_RSUB8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
RSUB8 (SIMD 8-bit Signed Halving Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 8-bit signed integer element subtractions simultaneously. The results are halved to avoid overflow or saturation.
Description:
This instruction subtracts the 8-bit signed integer elements in Rs2 from the 8-bit signed integer elements in Rs1. The results are first arithmetically right-shifted by 1 bit and then written to Rd.
Examples:
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 6719 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SUB8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
SUB8 (SIMD 8-bit Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 8-bit integer element subtractions simultaneously.
Description:
This instruction subtracts the 8-bit integer elements in Rs2 from the 8-bit integer elements in Rs1, and then writes the result to Rd.
Note:
This instruction can be used for either signed or unsigned subtraction.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 10668 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_UKADD8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
UKADD8 (SIMD 8-bit Unsigned Saturating Addition)
Type: SIMD
Syntax:
Purpose:
Do 8-bit unsigned integer element saturating additions simultaneously.
Description:
This instruction adds the 8-bit unsigned integer elements in Rs1 with the 8-bit unsigned integer elements in Rs2. If any of the results are beyond the 8-bit unsigned number range (0 <= RES <= 28-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 type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 11417 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_UKSUB8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
UKSUB8 (SIMD 8-bit Unsigned Saturating Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 8-bit unsigned integer elements saturating subtractions simultaneously.
Description:
This instruction subtracts the 8-bit unsigned integer elements in Rs2 from the 8-bit unsigned integer elements in Rs1. If any of the results are beyond the 8-bit unsigned number range (0 <= RES <= 28-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 type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 12005 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_URADD8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
URADD8 (SIMD 8-bit Unsigned Halving Addition)
Type: SIMD
Syntax:
Purpose:
Do 8-bit unsigned integer element additions simultaneously. The results are halved to avoid overflow or saturation.
Description:
This instruction adds the 8-bit unsigned integer elements in Rs1 with the 8-bit unsigned integer elements in Rs2. The results are first logically right-shifted by 1 bit and then written to Rd.
Examples:
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 12894 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_URSUB8 | ( | unsigned long | a, |
unsigned long | b | ||
) |
URSUB8 (SIMD 8-bit Unsigned Halving Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 8-bit unsigned integer element subtractions simultaneously. The results are halved to avoid overflow or saturation.
Description:
This instruction subtracts the 8-bit unsigned integer elements in Rs2 from the 8-bit unsigned integer elements in Rs1. The results are first logically right-shifted by 1 bit and then written to Rd.
Examples:
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 13284 of file core_feature_dsp.h.
References __ASM.