![]() |
NMSIS-Core
Version 1.5.0
NMSIS-Core support for Nuclei processor-based devices
|
SIMD 16-bit Add/Subtract Instructions. More...
Functions | |
| __STATIC_FORCEINLINE unsigned long | __RV_ADD16 (unsigned long a, unsigned long b) |
| ADD16 (SIMD 16-bit Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_CRAS16 (unsigned long a, unsigned long b) |
| CRAS16 (SIMD 16-bit Cross Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_CRSA16 (unsigned long a, unsigned long b) |
| CRSA16 (SIMD 16-bit Cross Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_KADD16 (unsigned long a, unsigned long b) |
| KADD16 (SIMD 16-bit Signed Saturating Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_KCRAS16 (unsigned long a, unsigned long b) |
| KCRAS16 (SIMD 16-bit Signed Saturating Cross Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_KCRSA16 (unsigned long a, unsigned long b) |
| KCRSA16 (SIMD 16-bit Signed Saturating Cross Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_KSTAS16 (unsigned long a, unsigned long b) |
| KSTAS16 (SIMD 16-bit Signed Saturating Straight Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_KSTSA16 (unsigned long a, unsigned long b) |
| KSTSA16 (SIMD 16-bit Signed Saturating Straight Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_KSUB16 (unsigned long a, unsigned long b) |
| KSUB16 (SIMD 16-bit Signed Saturating Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_RADD16 (unsigned long a, unsigned long b) |
| RADD16 (SIMD 16-bit Signed Halving Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_RCRAS16 (unsigned long a, unsigned long b) |
| RCRAS16 (SIMD 16-bit Signed Halving Cross Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_RCRSA16 (unsigned long a, unsigned long b) |
| RCRSA16 (SIMD 16-bit Signed Halving Cross Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_RSTAS16 (unsigned long a, unsigned long b) |
| RSTAS16 (SIMD 16-bit Signed Halving Straight Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_RSTSA16 (unsigned long a, unsigned long b) |
| RSTSA16 (SIMD 16-bit Signed Halving Straight Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_RSUB16 (unsigned long a, unsigned long b) |
| RSUB16 (SIMD 16-bit Signed Halving Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_STAS16 (unsigned long a, unsigned long b) |
| STAS16 (SIMD 16-bit Straight Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_STSA16 (unsigned long a, unsigned long b) |
| STSA16 (SIMD 16-bit Straight Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_SUB16 (unsigned long a, unsigned long b) |
| SUB16 (SIMD 16-bit Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_UKADD16 (unsigned long a, unsigned long b) |
| UKADD16 (SIMD 16-bit Unsigned Saturating Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_UKCRAS16 (unsigned long a, unsigned long b) |
| UKCRAS16 (SIMD 16-bit Unsigned Saturating Cross Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_UKCRSA16 (unsigned long a, unsigned long b) |
| UKCRSA16 (SIMD 16-bit Unsigned Saturating Cross Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_UKSTAS16 (unsigned long a, unsigned long b) |
| UKSTAS16 (SIMD 16-bit Unsigned Saturating Straight Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_UKSTSA16 (unsigned long a, unsigned long b) |
| UKSTSA16 (SIMD 16-bit Unsigned Saturating Straight Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_UKSUB16 (unsigned long a, unsigned long b) |
| UKSUB16 (SIMD 16-bit Unsigned Saturating Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_URADD16 (unsigned long a, unsigned long b) |
| URADD16 (SIMD 16-bit Unsigned Halving Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_URCRAS16 (unsigned long a, unsigned long b) |
| URCRAS16 (SIMD 16-bit Unsigned Halving Cross Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_URCRSA16 (unsigned long a, unsigned long b) |
| URCRSA16 (SIMD 16-bit Unsigned Halving Cross Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_URSTAS16 (unsigned long a, unsigned long b) |
| URSTAS16 (SIMD 16-bit Unsigned Halving Straight Addition & Subtraction) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_URSTSA16 (unsigned long a, unsigned long b) |
| URSTSA16 (SIMD 16-bit Unsigned Halving Straight Subtraction & Addition) More... | |
| __STATIC_FORCEINLINE unsigned long | __RV_URSUB16 (unsigned long a, unsigned long b) |
| URSUB16 (SIMD 16-bit Unsigned Halving Subtraction) More... | |
SIMD 16-bit Add/Subtract Instructions.
Based on the combination of the types of the two 16-bit arithmetic operations, the SIMD 16-bit add/subtract instructions can be classified into 6 main categories: Addition (two 16-bit addition), Subtraction (two 16-bit subtraction), Crossed Add & Sub (one addition and one subtraction), and Crossed Sub & Add (one subtraction and one addition), Straight Add & Sub (one addition and one subtraction), and Straight Sub & Add (one subtraction and one addition). Based on the way of how an overflow condition is handled, the SIMD 16-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 30 SIMD 16-bit add/subtract instructions.
| __STATIC_FORCEINLINE unsigned long __RV_ADD16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
ADD16 (SIMD 16-bit Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit integer element additions simultaneously.
Description:
This instruction adds the 16-bit integer elements in Rs1 with the 16-bit integer elements in Rs2, and then writes the 16-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 494 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_CRAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
CRAS16 (SIMD 16-bit Cross Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit integer element addition and 16-bit integer element subtraction in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks.
Description:
This instruction adds the 16-bit integer element in [31:16] of 32-bit chunks in Rs1 with the 16-bit integer element in [15:0] of 32-bit chunks in Rs2, and writes the result to [31:16] of 32-bit chunks in Rd; at the same time, it subtracts the 16-bit integer element in [31:16] of 32-bit chunks in Rs2 from the 16-bit integer element in [15:0] of 32-bit chunks, and writes the result to [15:0] of 32- bit chunks in Rd.
Note:
This instruction can be used for either signed or unsigned operations.
Operations:
| [in] | a | unsigned long type of value stored in a |
| [in] | b | unsigned long type of value stored in b |
Definition at line 1286 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_CRSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
CRSA16 (SIMD 16-bit Cross Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit integer element subtraction and 16-bit integer element addition in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks.
Description:
This instruction subtracts the 16-bit integer element in [15:0] of 32-bit chunks in Rs2 from the 16-bit integer element in [31:16] of 32-bit chunks in Rs1, and writes the result to [31:16] of 32-bit chunks in Rd; at the same time, it adds the 16-bit integer element in [31:16] of 32-bit chunks in Rs2 with the 16-bit integer element in [15:0] of 32-bit chunks in Rs1, and writes the result to [15:0] of 32-bit chunks in Rd.
Note:
This instruction can be used for either signed or unsigned operations.
Operations:
| [in] | a | unsigned long type of value stored in a |
| [in] | b | unsigned long type of value stored in b |
Definition at line 1332 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_KADD16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
KADD16 (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 type of value stored in a |
| [in] | b | unsigned long type of value stored in b |
Definition at line 1604 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_KCRAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
KCRAS16 (SIMD 16-bit Signed Saturating Cross Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element saturating addition and 16-bit signed integer element saturating subtraction in a 32-bit chunk simultaneously. Operands are from crossed positions in 32- bit chunks.
Description:
This instruction adds the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs1 with the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs2; at the same time, it subtracts the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs2 from the 16-bit signed integer element in [15:0] of 32-bit chunks 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 [31:16] of 32-bit chunks in Rd for addition and [15:0] of 32-bit chunks in Rd for 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 1822 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_KCRSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
KCRSA16 (SIMD 16-bit Signed Saturating Cross Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element saturating subtraction and 16-bit signed integer element saturating addition in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks.
Description:
This instruction subtracts the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs2 from the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs1; at the same time, it adds the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs2 with the 16-bit signed integer element in [15:0] of 32-bit chunks 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 [31:16] of 32-bit chunks in Rd for subtraction and [15:0] of 32-bit chunks in Rd for 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 1879 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_KSTAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
KSTAS16 (SIMD 16-bit Signed Saturating Straight Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element saturating addition and 16-bit signed integer element saturating subtraction in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks.
Description:
This instruction adds the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs1 with the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs2; at the same time, it subtracts the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs2 from the 16-bit signed integer element in [15:0] of 32-bit chunks 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 [31:16] of 32-bit chunks in Rd for addition and [15:0] of 32-bit chunks in Rd for 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 5282 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_KSTSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
KSTSA16 (SIMD 16-bit Signed Saturating Straight Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element saturating subtraction and 16-bit signed integer element saturating addition in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks.
Description:
This instruction subtracts the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs2 from the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs1; at the same time, it adds the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs2 with the 16-bit signed integer element in [15:0] of 32-bit chunks 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 [31:16] of 32-bit chunks in Rd for subtraction and [15:0] of 32-bit chunks in Rd for 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 5339 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_KSUB16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
KSUB16 (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 type of value stored in a |
| [in] | b | unsigned long type of value stored in b |
Definition at line 5434 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_RADD16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
RADD16 (SIMD 16-bit Signed Halving Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element additions simultaneously. The results are halved to avoid overflow or saturation.
Description:
This instruction adds the 16-bit signed integer elements in Rs1 with the 16-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 6352 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_RCRAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
RCRAS16 (SIMD 16-bit Signed Halving Cross Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element addition and 16-bit signed integer element subtraction in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks. The results are halved to avoid overflow or saturation.
Description:
This instruction adds the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs1 with the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs2, and subtracts the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs2 from the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs1. The element results are first arithmetically right-shifted by 1 bit and then written to [31:16] of 32-bit chunks in Rd and [15:0] of 32-bit chunks in 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 6502 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_RCRSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
RCRSA16 (SIMD 16-bit Signed Halving Cross Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element subtraction and 16-bit signed integer element addition in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks. The results are halved to avoid overflow or saturation.
Description:
This instruction subtracts the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs2 from the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs1, and adds the 16-bit signed element integer in [15:0] of 32-bit chunks in Rs1 with the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs2. The two results are first arithmetically right-shifted by 1 bit and then written to [31:16] of 32-bit chunks in Rd and [15:0] of 32-bit chunks in 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 6551 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_RSTAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
RSTAS16 (SIMD 16-bit Signed Halving Straight Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element addition and 16-bit signed integer element subtraction in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks. The results are halved to avoid overflow or saturation.
Description:
This instruction adds the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs1 with the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs2, and subtracts the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs2 from the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs1. The element results are first arithmetically right-shifted by 1 bit and then written to [31:16] of 32-bit chunks in Rd and [15:0] of 32-bit chunks in 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 6627 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_RSTSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
RSTSA16 (SIMD 16-bit Signed Halving Straight Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element subtraction and 16-bit signed integer element addition in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks. The results are halved to avoid overflow or saturation.
Description:
This instruction subtracts the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs2 from the 16-bit signed integer element in [31:16] of 32-bit chunks in Rs1, and adds the 16-bit signed element integer in [15:0] of 32-bit chunks in Rs1 with the 16-bit signed integer element in [15:0] of 32-bit chunks in Rs2. The two results are first arithmetically right-shifted by 1 bit and then written to [31:16] of 32-bit chunks in Rd and [15:0] of 32-bit chunks in 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 6676 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_RSUB16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
RSUB16 (SIMD 16-bit Signed Halving Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit signed integer element subtractions simultaneously. The results are halved to avoid overflow or saturation.
Description:
This instruction subtracts the 16-bit signed integer elements in Rs2 from the 16-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 6770 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_STAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
STAS16 (SIMD 16-bit Straight Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit integer element addition and 16-bit integer element subtraction in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks.
Description:
This instruction adds the 16-bit integer element in [31:16] of 32-bit chunks in Rs1 with the 16-bit integer element in [31:16] of 32-bit chunks in Rs2, and writes the result to [31:16] of 32-bit chunks in Rd; at the same time, it subtracts the 16-bit integer element in [15:0] of 32-bit chunks in Rs2 from the 16-bit integer element in [15:0] of 32-bit chunks, and writes the result to [15:0] of 32- bit chunks in Rd.
Note:
This instruction can be used for either signed or unsigned operations.
Operations:
| [in] | a | unsigned long type of value stored in a |
| [in] | b | unsigned long type of value stored in b |
Definition at line 10585 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_STSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
STSA16 (SIMD 16-bit Straight Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit integer element subtraction and 16-bit integer element addition in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks.
Description:
This instruction subtracts the 16-bit integer element in [31:16] of 32-bit chunks in Rs2 from the 16-bit integer element in [31:16] of 32-bit chunks in Rs1, and writes the result to [31:16] of 32-bit chunks in Rd; at the same time, it adds the 16-bit integer element in [15:0] of 32-bit chunks in Rs2 with the 16-bit integer element in [15:0] of 32-bit chunks in Rs1, and writes the result to [15:0] of 32-bit chunks in Rd.
Note:
This instruction can be used for either signed or unsigned operations.
Operations:
| [in] | a | unsigned long type of value stored in a |
| [in] | b | unsigned long type of value stored in b |
Definition at line 10631 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_SUB16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
SUB16 (SIMD 16-bit Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit integer element subtractions simultaneously.
Description:
This instruction subtracts the 16-bit integer elements in Rs2 from the 16-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 10713 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_UKADD16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
UKADD16 (SIMD 16-bit Unsigned Saturating Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit unsigned integer element saturating additions simultaneously.
Description:
This instruction adds the 16-bit unsigned integer elements in Rs1 with the 16-bit unsigned integer elements in Rs2. If any of the results are beyond the 16-bit unsigned number range (0 <= RES <= 2^16-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 11466 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_UKCRAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
UKCRAS16 (SIMD 16-bit Unsigned Saturating Cross Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do one 16-bit unsigned integer element saturating addition and one 16-bit unsigned integer element saturating subtraction in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks.
Description:
This instruction adds the 16-bit unsigned integer element in [31:16] of 32-bit chunks in Rs1 with the 16-bit unsigned integer element in [15:0] of 32-bit chunks in Rs2; at the same time, it subtracts the 16-bit unsigned integer element in [31:16] of 32-bit chunks in Rs2 from the 16-bit unsigned integer element in [15:0] of 32-bit chunks in Rs1. If any of the results are beyond the 16-bit unsigned number range (0 <= RES <= 2^16-1), they are saturated to the range and the OV bit is set to 1. The saturated results are written to [31:16] of 32-bit chunks in Rd for addition and [15:0] of 32-bit chunks in Rd for 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 11669 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_UKCRSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
UKCRSA16 (SIMD 16-bit Unsigned Saturating Cross Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do one 16-bit unsigned integer element saturating subtraction and one 16-bit unsigned integer element saturating addition in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks.
Description:
This instruction subtracts the 16-bit unsigned integer element in [15:0] of 32-bit chunks in Rs2 from the 16-bit unsigned integer element in [31:16] of 32-bit chunks in Rs1; at the same time, it adds the 16-bit unsigned integer element in [31:16] of 32-bit chunks in Rs2 with the 16- bit unsigned integer element in [15:0] of 32-bit chunks in Rs1. If any of the results are beyond the 16-bit unsigned number range (0 <= RES <= 2^16-1), they are saturated to the range and the OV bit is set to 1. The saturated results are written to [31:16] of 32-bit chunks in Rd for subtraction and [15:0] of 32-bit chunks in Rd for 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 11724 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_UKSTAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
UKSTAS16 (SIMD 16-bit Unsigned Saturating Straight Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do one 16-bit unsigned integer element saturating addition and one 16-bit unsigned integer element saturating subtraction in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks.
Description:
This instruction adds the 16-bit unsigned integer element in [31:16] of 32-bit chunks in Rs1 with the 16-bit unsigned integer element in [31:16] of 32-bit chunks in Rs2; at the same time, it subtracts the 16-bit unsigned integer element in [15:0] of 32-bit chunks in Rs2 from the 16-bit unsigned integer element in [15:0] of 32-bit chunks in Rs1. If any of the results are beyond the 16-bit unsigned number range (0 <= RES <= 2^16-1), they are saturated to the range and the OV bit is set to 1. The saturated results are written to [31:16] of 32-bit chunks in Rd for addition and [15:0] of 32-bit chunks in Rd for 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 11909 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_UKSTSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
UKSTSA16 (SIMD 16-bit Unsigned Saturating Straight Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do one 16-bit unsigned integer element saturating subtraction and one 16-bit unsigned integer element saturating addition in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks.
Description:
This instruction subtracts the 16-bit unsigned integer element in [31:16] of 32-bit chunks in Rs2 from the 16-bit unsigned integer element in [31:16] of 32-bit chunks in Rs1; at the same time, it adds the 16-bit unsigned integer element in [15:0] of 32-bit chunks in Rs2 with the 16- bit unsigned integer element in [15:0] of 32-bit chunks in Rs1. If any of the results are beyond the 16-bit unsigned number range (0 <= RES <= 2^16-1), they are saturated to the range and the OV bit is set to 1. The saturated results are written to [31:16] of 32-bit chunks in Rd for subtraction and [15:0] of 32-bit chunks in Rd for 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 11964 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_UKSUB16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
UKSUB16 (SIMD 16-bit Unsigned Saturating Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit unsigned integer elements saturating subtractions simultaneously.
Description:
This instruction subtracts the 16-bit unsigned integer elements in Rs2 from the 16-bit unsigned integer elements in Rs1. If any of the results are beyond the 16-bit unsigned number range (0 <= RES <= 2^16-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 12054 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_URADD16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
URADD16 (SIMD 16-bit Unsigned Halving Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit unsigned integer element additions simultaneously. The results are halved to avoid overflow or saturation.
Description:
This instruction adds the 16-bit unsigned integer elements in Rs1 with the 16-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 12945 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_URCRAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
URCRAS16 (SIMD 16-bit Unsigned Halving Cross Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit unsigned integer element addition and 16-bit unsigned integer element subtraction in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks. The results are halved to avoid overflow or saturation.
Description:
This instruction adds the 16-bit unsigned integer in [31:16] of 32-bit chunks in Rs1 with the 16-bit unsigned integer in [15:0] of 32-bit chunks in Rs2, and subtracts the 16-bit unsigned integer in [31:16] of 32-bit chunks in Rs2 from the 16-bit unsigned integer in [15:0] of 32-bit chunks in Rs1. The element results are first logically right-shifted by 1 bit and then written to [31:16] of 32- bit chunks in Rd and [15:0] of 32-bit chunks in 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 13094 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_URCRSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
URCRSA16 (SIMD 16-bit Unsigned Halving Cross Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit unsigned integer element subtraction and 16-bit unsigned integer element addition in a 32-bit chunk simultaneously. Operands are from crossed positions in 32-bit chunks. The results are halved to avoid overflow or saturation.
Description:
This instruction subtracts the 16-bit unsigned integer in [15:0] of 32-bit chunks in Rs2 from the 16-bit unsigned integer in [31:16] of 32-bit chunks in Rs1, and adds the 16-bit unsigned integer in [15:0] of 32-bit chunks in Rs1 with the 16-bit unsigned integer in [31:16] of 32-bit chunks in Rs2. The two results are first logically right-shifted by 1 bit and then written to [31:16] of 32-bit chunks in Rd and [15:0] of 32-bit chunks in 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 13143 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_URSTAS16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
URSTAS16 (SIMD 16-bit Unsigned Halving Straight Addition & Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit unsigned integer element addition and 16-bit unsigned integer element subtraction in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks. The results are halved to avoid overflow or saturation.
Description:
This instruction adds the 16-bit unsigned integer in [31:16] of 32-bit chunks in Rs1 with the 16-bit unsigned integer in [31:16] of 32-bit chunks in Rs2, and subtracts the 16-bit unsigned integer in [15:0] of 32-bit chunks in Rs2 from the 16-bit unsigned integer in [15:0] of 32-bit chunks in Rs1. The element results are first logically right-shifted by 1 bit and then written to [31:16] of 32- bit chunks in Rd and [15:0] of 32-bit chunks in 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 13192 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_URSTSA16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
URSTSA16 (SIMD 16-bit Unsigned Halving Straight Subtraction & Addition)
Type: SIMD
Syntax:
Purpose:
Do 16-bit unsigned integer element subtraction and 16-bit unsigned integer element addition in a 32-bit chunk simultaneously. Operands are from corresponding positions in 32-bit chunks. The results are halved to avoid overflow or saturation.
Description:
This instruction subtracts the 16-bit unsigned integer in [31:16] of 32-bit chunks in Rs2 from the 16-bit unsigned integer in [31:16] of 32-bit chunks in Rs1, and adds the 16-bit unsigned integer in [15:0] of 32-bit chunks in Rs1 with the 16-bit unsigned integer in [15:0] of 32-bit chunks in Rs2. The two results are first logically right-shifted by 1 bit and then written to [31:16] of 32-bit chunks in Rd and [15:0] of 32-bit chunks in 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 13241 of file core_feature_dsp.h.
References __ASM.
| __STATIC_FORCEINLINE unsigned long __RV_URSUB16 | ( | unsigned long | a, |
| unsigned long | b | ||
| ) |
URSUB16 (SIMD 16-bit Unsigned Halving Subtraction)
Type: SIMD
Syntax:
Purpose:
Do 16-bit unsigned integer element subtractions simultaneously. The results are halved to avoid overflow or saturation.
Description:
This instruction subtracts the 16-bit unsigned integer elements in Rs2 from the 16-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 13335 of file core_feature_dsp.h.
References __ASM.