SIMD 8-bit Compare Instructions
- __STATIC_FORCEINLINE unsigned long __RV_CMPEQ8 (unsigned long a, unsigned long b)
- __STATIC_FORCEINLINE unsigned long __RV_SCMPLE8 (unsigned long a, unsigned long b)
- __STATIC_FORCEINLINE unsigned long __RV_SCMPLT8 (unsigned long a, unsigned long b)
- __STATIC_FORCEINLINE unsigned long __RV_UCMPLE8 (unsigned long a, unsigned long b)
- __STATIC_FORCEINLINE unsigned long __RV_UCMPLT8 (unsigned long a, unsigned long b)
- group NMSIS_Core_DSP_Intrinsic_SIMD_8B_CMP
SIMD 8-bit Compare Instructions.
there are 5 SIMD 8-bit Compare instructions.
Functions
- __STATIC_FORCEINLINE unsigned long __RV_CMPEQ8 (unsigned long a, unsigned long b)
CMPEQ8 (SIMD 8-bit Integer Compare Equal)
Type: SIMD
Syntax:
CMPEQ8 Rs, Rs1, Rs2
Purpose
:
Do 8-bit integer elements equal comparisons simultaneously.
Description
:
This instruction compares the 8-bit integer elements in Rs1 with the 8-bit integer elements in Rs2 to see if they are equal. If they are equal, the result is 0xFF; otherwise, the result is 0x0. The 8-bit element comparison results are written to Rd.
Note
:
This instruction can be used for either signed or unsigned numbers.
Operations:
Rd.B[x] = (Rs1.B[x] == Rs2.B[x])? 0xff : 0x0; for RV32: x=3...0, for RV64: x=7...0
- Parameters
a – [in] unsigned long type of value stored in a
b – [in] unsigned long type of value stored in b
- Returns
value stored in unsigned long type
- __STATIC_FORCEINLINE unsigned long __RV_SCMPLE8 (unsigned long a, unsigned long b)
SCMPLE8 (SIMD 8-bit Signed Compare Less Than & Equal)
Type: SIMD
Syntax:
SCMPLE8 Rd, Rs1, Rs2
Purpose
:
Do 8-bit signed integer elements less than & equal comparisons simultaneously.
Description
:
This instruction compares the 8-bit signed integer elements in Rs1 with the 8-bit signed integer elements in Rs2 to see if the one in Rs1 is less than or equal to the one in Rs2. If it is true, the result is 0xFF; otherwise, the result is 0x0. The element comparison results are written to Rd
Operations:
Rd.B[x] = (Rs1.B[x] {le} Rs2.B[x])? 0xff : 0x0; for RV32: x=3...0, for RV64: x=7...0
- Parameters
a – [in] unsigned long type of value stored in a
b – [in] unsigned long type of value stored in b
- Returns
value stored in unsigned long type
- __STATIC_FORCEINLINE unsigned long __RV_SCMPLT8 (unsigned long a, unsigned long b)
SCMPLT8 (SIMD 8-bit Signed Compare Less Than)
Type: SIMD
Syntax:
SCMPLT8 Rd, Rs1, Rs2
Purpose
:
Do 8-bit signed integer elements less than comparisons simultaneously.
Description
:
This instruction compares the 8-bit signed integer elements in Rs1 with the 8-bit signed integer elements in Rs2 to see if the one in Rs1 is less than the one in Rs2. If it is true, the result is 0xFF; otherwise, the result is 0x0. The element comparison results are written to Rd.
Operations:
Rd.B[x] = (Rs1.B[x] < Rs2.B[x])? 0xff : 0x0; for RV32: x=3...0, for RV64: x=7...0
- Parameters
a – [in] unsigned long type of value stored in a
b – [in] unsigned long type of value stored in b
- Returns
value stored in unsigned long type
- __STATIC_FORCEINLINE unsigned long __RV_UCMPLE8 (unsigned long a, unsigned long b)
UCMPLE8 (SIMD 8-bit Unsigned Compare Less Than & Equal)
Type: SIMD
Syntax:
UCMPLE8 Rd, Rs1, Rs2
Purpose
:
Do 8-bit unsigned integer elements less than & equal comparisons simultaneously.
Description
:
This instruction compares the 8-bit unsigned integer elements in Rs1 with the 8-bit unsigned integer elements in Rs2 to see if the one in Rs1 is less than or equal to the one in Rs2. If it is true, the result is 0xFF; otherwise, the result is 0x0. The four comparison results are written to Rd.
Operations:
Rd.B[x] = (Rs1.B[x] <=u Rs2.B[x])? 0xff : 0x0; for RV32: x=3...0, for RV64: x=7...0
- Parameters
a – [in] unsigned long type of value stored in a
b – [in] unsigned long type of value stored in b
- Returns
value stored in unsigned long type
- __STATIC_FORCEINLINE unsigned long __RV_UCMPLT8 (unsigned long a, unsigned long b)
UCMPLT8 (SIMD 8-bit Unsigned Compare Less Than)
Type: SIMD
Syntax:
UCMPLT8 Rd, Rs1, Rs2
Purpose
:
Do 8-bit unsigned integer elements less than comparisons simultaneously.
Description
:
This instruction compares the 8-bit unsigned integer elements in Rs1 with the 8-bit unsigned integer elements in Rs2 to see if the one in Rs1 is less than the one in Rs2. If it is true, the result is 0xFF; otherwise, the result is 0x0. The element comparison results are written to Rd.
Operations:
Rd.B[x] = (Rs1.B[x] <u Rs2.B[x])? 0xff : 0x0; for RV32: x=3...0, for RV64: x=7...0
- Parameters
a – [in] unsigned long type of value stored in a
b – [in] unsigned long type of value stored in b
- Returns
value stored in unsigned long type