NMSIS-Core
Version 1.2.0
NMSIS-Core support for Nuclei processor-based devices
|
(RV64 Only) 32-bit Parallel Multiply & Add Instructions More...
Functions | |
__STATIC_FORCEINLINE long | __RV_KMADA32 (long t, unsigned long a, unsigned long b) |
KMADA32 (Saturating Signed Multiply Two Words and Two Adds) More... | |
__STATIC_FORCEINLINE long | __RV_KMAXDA32 (long t, unsigned long a, unsigned long b) |
KMAXDA32 (Saturating Signed Crossed Multiply Two Words and Two Adds) More... | |
__STATIC_FORCEINLINE long | __RV_KMDA32 (unsigned long a, unsigned long b) |
KMDA32 (Signed Multiply Two Words and Add) More... | |
__STATIC_FORCEINLINE long | __RV_KMXDA32 (unsigned long a, unsigned long b) |
KMXDA32 (Signed Crossed Multiply Two Words and Add) More... | |
__STATIC_FORCEINLINE long | __RV_KMADS32 (long t, unsigned long a, unsigned long b) |
KMADS32 (Saturating Signed Multiply Two Words & Subtract & Add) More... | |
__STATIC_FORCEINLINE long | __RV_KMADRS32 (long t, unsigned long a, unsigned long b) |
KMADRS32 (Saturating Signed Multiply Two Words & Reverse Subtract & Add) More... | |
__STATIC_FORCEINLINE long | __RV_KMAXDS32 (long t, unsigned long a, unsigned long b) |
KMAXDS32 (Saturating Signed Crossed Multiply Two Words & Subtract & Add) More... | |
__STATIC_FORCEINLINE long | __RV_KMSDA32 (long t, unsigned long a, unsigned long b) |
KMSDA32 (Saturating Signed Multiply Two Words & Add & Subtract) More... | |
__STATIC_FORCEINLINE long | __RV_KMSXDA32 (long t, unsigned long a, unsigned long b) |
KMSXDA32 (Saturating Signed Crossed Multiply Two Words & Add & Subtract) More... | |
__STATIC_FORCEINLINE long | __RV_SMDS32 (unsigned long a, unsigned long b) |
SMDS32 (Signed Multiply Two Words and Subtract) More... | |
__STATIC_FORCEINLINE long | __RV_SMDRS32 (unsigned long a, unsigned long b) |
SMDRS32 (Signed Multiply Two Words and Reverse Subtract) More... | |
__STATIC_FORCEINLINE long | __RV_SMXDS32 (unsigned long a, unsigned long b) |
SMXDS32 (Signed Crossed Multiply Two Words and Subtract) More... | |
(RV64 Only) 32-bit Parallel Multiply & Add Instructions
there are 12 (RV64 Only) 32-bit Parallel Multiply & Add Instructions
__STATIC_FORCEINLINE long __RV_KMADA32 | ( | long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
KMADA32 (Saturating Signed Multiply Two Words and Two Adds)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from 32-bit data in two registers; and then adds the two 64-bit results and 64-bit data in a third register together. The addition result may be saturated.
Description:
For the KMADA32
instruction, it multiplies the bottom 32-bit element in Rs1 with the bottom 32- bit element in Rs2 and then adds the result to the result of multiplying the top 32-bit element in Rs1 with the top 32-bit element in Rs2. It is actually an alias of the KMAR64
instruction. For the KMAXDA32
instruction, it multiplies the top 32-bit element in Rs1 with the bottom 32-bit element in Rs2 and then adds the result to the result of multiplying the bottom 32-bit element in Rs1 with the top 32-bit element in Rs2. The result is added to the content of 64-bit data in Rd. If the addition result is beyond the Q63 number range (-2^63 <= Q63 <= 2^63-1), it is saturated to the range and the OV bit is set to 1. The 64-bit result is written to Rd. The 32-bit contents of Rs1 and Rs2 are treated as signed integers.
Operations:
[in] | t | 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 14854 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_KMADRS32 | ( | long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
KMADRS32 (Saturating Signed Multiply Two Words & Reverse Subtract & Add)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from 32-bit elements in two registers; and then perform a subtraction operation between the two 64-bit results. Then add the subtraction result to 64-bit data in a third register. The addition result may be saturated.
Description:
For the KMADS32
instruction, it multiplies the bottom 32-bit element in Rs1 with the bottom 32-bit element in Rs2 and then subtracts the result from the result of multiplying the top 32-bit element in Rs1 with the top 32-bit element in Rs2. For the KMADRS32
instruction, it multiplies the top 32-bit element in Rs1 with the top 32-bit element in Rs2 and then subtracts the result from the result of multiplying the bottom 32-bit element in Rs1 with the bottom 32-bit element in Rs2. For the KMAXDS32
instruction, it multiplies the bottom 32-bit element in Rs1 with the top 32-bit element in Rs2 and then subtracts the result from the result of multiplying the top 32-bit element in Rs1 with the bottom 32-bit element in Rs2. The subtraction result is then added to the content of 64-bit data in Rd. If the addition result is beyond the Q63 number range (-2^63 <= Q63 <= 2^63-1), it is saturated to the range and the OV bit is set to
Operations:
[in] | t | 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 15142 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_KMADS32 | ( | long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
KMADS32 (Saturating Signed Multiply Two Words & Subtract & Add)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from 32-bit elements in two registers; and then perform a subtraction operation between the two 64-bit results. Then add the subtraction result to 64-bit data in a third register. The addition result may be saturated.
Description:
For the KMADS32
instruction, it multiplies the bottom 32-bit element in Rs1 with the bottom 32-bit element in Rs2 and then subtracts the result from the result of multiplying the top 32-bit element in Rs1 with the top 32-bit element in Rs2. For the KMADRS32
instruction, it multiplies the top 32-bit element in Rs1 with the top 32-bit element in Rs2 and then subtracts the result from the result of multiplying the bottom 32-bit element in Rs1 with the bottom 32-bit element in Rs2. For the KMAXDS32
instruction, it multiplies the bottom 32-bit element in Rs1 with the top 32-bit element in Rs2 and then subtracts the result from the result of multiplying the top 32-bit element in Rs1 with the bottom 32-bit element in Rs2. The subtraction result is then added to the content of 64-bit data in Rd. If the addition result is beyond the Q63 number range (-2^63 <= Q63 <= 2^63-1), it is saturated to the range and the OV bit is set to
Operations:
[in] | t | 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 15078 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_KMAXDA32 | ( | long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
KMAXDA32 (Saturating Signed Crossed Multiply Two Words and Two Adds)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from 32-bit data in two registers; and then adds the two 64-bit results and 64-bit data in a third register together. The addition result may be saturated.
Description:
For the KMADA32
instruction, it multiplies the bottom 32-bit element in Rs1 with the bottom 32- bit element in Rs2 and then adds the result to the result of multiplying the top 32-bit element in Rs1 with the top 32-bit element in Rs2. It is actually an alias of the KMAR64
instruction. For the KMAXDA32
instruction, it multiplies the top 32-bit element in Rs1 with the bottom 32-bit element in Rs2 and then adds the result to the result of multiplying the bottom 32-bit element in Rs1 with the top 32-bit element in Rs2. The result is added to the content of 64-bit data in Rd. If the addition result is beyond the Q63 number range (-2^63 <= Q63 <= 2^63-1), it is saturated to the range and the OV bit is set to 1. The 64-bit result is written to Rd. The 32-bit contents of Rs1 and Rs2 are treated as signed integers.
Operations:
[in] | t | 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 14910 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_KMAXDS32 | ( | long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
KMAXDS32 (Saturating Signed Crossed Multiply Two Words & Subtract & Add)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from 32-bit elements in two registers; and then perform a subtraction operation between the two 64-bit results. Then add the subtraction result to 64-bit data in a third register. The addition result may be saturated.
Description:
For the KMADS32
instruction, it multiplies the bottom 32-bit element in Rs1 with the bottom 32-bit element in Rs2 and then subtracts the result from the result of multiplying the top 32-bit element in Rs1 with the top 32-bit element in Rs2. For the KMADRS32
instruction, it multiplies the top 32-bit element in Rs1 with the top 32-bit element in Rs2 and then subtracts the result from the result of multiplying the bottom 32-bit element in Rs1 with the bottom 32-bit element in Rs2. For the KMAXDS32
instruction, it multiplies the bottom 32-bit element in Rs1 with the top 32-bit element in Rs2 and then subtracts the result from the result of multiplying the top 32-bit element in Rs1 with the bottom 32-bit element in Rs2. The subtraction result is then added to the content of 64-bit data in Rd. If the addition result is beyond the Q63 number range (-2^63 <= Q63 <= 2^63-1), it is saturated to the range and the OV bit is set to
Operations:
[in] | t | 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 15206 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_KMDA32 | ( | unsigned long | a, |
unsigned long | b | ||
) |
KMDA32 (Signed Multiply Two Words and Add)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from the 32-bit element of two registers; and then adds the two 64-bit results together. The addition result may be saturated.
Description:
For the KMDA32
instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2 and then adds the result to the result of multiplying the top 32-bit element of Rs1 with the top 32-bit element of Rs2. For the KMXDA32
instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2 and then adds the result to the result of multiplying the top 32-bit element of Rs1 with the bottom 32-bit element of Rs2. The addition result is checked for saturation. If saturation happens, the result is saturated to 2^63-1. The final result is written to Rd. The 32-bit contents are treated as signed integers.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 14961 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_KMSDA32 | ( | long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
KMSDA32 (Saturating Signed Multiply Two Words & Add & Subtract)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from the 32-bit element of two registers; and then subtracts the two 64-bit results from a third register. The subtraction result may be saturated.
Description:
For the KMSDA32
instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2 and multiplies the top 32-bit element of Rs1 with the top 32-bit element of Rs2. For the KMSXDA32
instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2 and multiplies the top 32-bit element of Rs1 with the bottom 32-bit element of Rs2. The two 64-bit multiplication results are then subtracted from the content of Rd. If the subtraction result is beyond the Q63 number range (-2^63 <= Q63 <= 2^63-1), it is saturated to the range and the OV bit is set to 1. The result after saturation is written to Rd. The 32-bit contents are treated as signed integers.
Operations:
[in] | t | 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 15261 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_KMSXDA32 | ( | long | t, |
unsigned long | a, | ||
unsigned long | b | ||
) |
KMSXDA32 (Saturating Signed Crossed Multiply Two Words & Add & Subtract)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from the 32-bit element of two registers; and then subtracts the two 64-bit results from a third register. The subtraction result may be saturated.
Description:
For the KMSDA32
instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2 and multiplies the top 32-bit element of Rs1 with the top 32-bit element of Rs2. For the KMSXDA32
instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2 and multiplies the top 32-bit element of Rs1 with the bottom 32-bit element of Rs2. The two 64-bit multiplication results are then subtracted from the content of Rd. If the subtraction result is beyond the Q63 number range (-2^63 <= Q63 <= 2^63-1), it is saturated to the range and the OV bit is set to 1. The result after saturation is written to Rd. The 32-bit contents are treated as signed integers.
Operations:
[in] | t | 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 15316 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_KMXDA32 | ( | unsigned long | a, |
unsigned long | b | ||
) |
KMXDA32 (Signed Crossed Multiply Two Words and Add)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from the 32-bit element of two registers; and then adds the two 64-bit results together. The addition result may be saturated.
Description:
For the KMDA32
instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2 and then adds the result to the result of multiplying the top 32-bit element of Rs1 with the top 32-bit element of Rs2. For the KMXDA32
instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2 and then adds the result to the result of multiplying the top 32-bit element of Rs1 with the bottom 32-bit element of Rs2. The addition result is checked for saturation. If saturation happens, the result is saturated to 2^63-1. The final result is written to Rd. The 32-bit contents are treated as signed integers.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 15013 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_SMDRS32 | ( | unsigned long | a, |
unsigned long | b | ||
) |
SMDRS32 (Signed Multiply Two Words and Reverse Subtract)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from the l 32-bit element of two registers; and then perform a subtraction operation between the two 64-bit results.
Description:
For the SMDS32
instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2 and then subtracts the result from the result of multiplying the top 32-bit element of Rs1 with the top 32-bit element of Rs2. For the SMDRS32
instruction, it multiplies the top 32-bit element of Rs1 with the top 32-bit element of Rs2 and then subtracts the result from the result of multiplying the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2. For the SMXDS32
instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2 and then subtracts the result from the result of multiplying the top 32-bit element of Rs1 with the bottom 32-bit element of Rs2. The subtraction result is written to Rd. The 32-bit contents of Rs1 and Rs2 are treated as signed integers.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 16543 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_SMDS32 | ( | unsigned long | a, |
unsigned long | b | ||
) |
SMDS32 (Signed Multiply Two Words and Subtract)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from the l 32-bit element of two registers; and then perform a subtraction operation between the two 64-bit results.
Description:
For the SMDS32
instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2 and then subtracts the result from the result of multiplying the top 32-bit element of Rs1 with the top 32-bit element of Rs2. For the SMDRS32
instruction, it multiplies the top 32-bit element of Rs1 with the top 32-bit element of Rs2 and then subtracts the result from the result of multiplying the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2. For the SMXDS32
instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2 and then subtracts the result from the result of multiplying the top 32-bit element of Rs1 with the bottom 32-bit element of Rs2. The subtraction result is written to Rd. The 32-bit contents of Rs1 and Rs2 are treated as signed integers.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 16490 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE long __RV_SMXDS32 | ( | unsigned long | a, |
unsigned long | b | ||
) |
SMXDS32 (Signed Crossed Multiply Two Words and Subtract)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do two signed 32-bit multiplications from the l 32-bit element of two registers; and then perform a subtraction operation between the two 64-bit results.
Description:
For the SMDS32
instruction, it multiplies the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2 and then subtracts the result from the result of multiplying the top 32-bit element of Rs1 with the top 32-bit element of Rs2. For the SMDRS32
instruction, it multiplies the top 32-bit element of Rs1 with the top 32-bit element of Rs2 and then subtracts the result from the result of multiplying the bottom 32-bit element of Rs1 with the bottom 32-bit element of Rs2. For the SMXDS32
instruction, it multiplies the bottom 32-bit element of Rs1 with the top 32-bit element of Rs2 and then subtracts the result from the result of multiplying the top 32-bit element of Rs1 with the bottom 32-bit element of Rs2. The subtraction result is written to Rd. The 32-bit contents of Rs1 and Rs2 are treated as signed integers.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned long type of value stored in b |
Definition at line 16596 of file core_feature_dsp.h.
References __ASM.