NMSIS-Core  Version 1.2.0
NMSIS-Core support for Nuclei processor-based devices

SIMD 8-bit Compare Instructions. More...

Functions

__STATIC_FORCEINLINE unsigned long __RV_CMPEQ8 (unsigned long a, unsigned long b)
 CMPEQ8 (SIMD 8-bit Integer Compare Equal) More...
 
__STATIC_FORCEINLINE unsigned long __RV_SCMPLE8 (unsigned long a, unsigned long b)
 SCMPLE8 (SIMD 8-bit Signed Compare Less Than & Equal) More...
 
__STATIC_FORCEINLINE unsigned long __RV_SCMPLT8 (unsigned long a, unsigned long b)
 SCMPLT8 (SIMD 8-bit Signed Compare Less Than) More...
 
__STATIC_FORCEINLINE unsigned long __RV_UCMPLE8 (unsigned long a, unsigned long b)
 UCMPLE8 (SIMD 8-bit Unsigned Compare Less Than & Equal) More...
 
__STATIC_FORCEINLINE unsigned long __RV_UCMPLT8 (unsigned long a, unsigned long b)
 UCMPLT8 (SIMD 8-bit Unsigned Compare Less Than) More...
 

Detailed Description

SIMD 8-bit Compare Instructions.

there are 5 SIMD 8-bit Compare instructions.

Function Documentation

◆ __RV_CMPEQ8()

__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
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 1194 of file core_feature_dsp.h.

1195 {
1196  unsigned long result;
1197  __ASM volatile("cmpeq8 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
1198  return result;
1199 }

References __ASM.

◆ __RV_SCMPLE8()

__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
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 7055 of file core_feature_dsp.h.

7056 {
7057  unsigned long result;
7058  __ASM volatile("scmple8 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
7059  return result;
7060 }

References __ASM.

◆ __RV_SCMPLT8()

__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
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 7134 of file core_feature_dsp.h.

7135 {
7136  unsigned long result;
7137  __ASM volatile("scmplt8 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
7138  return result;
7139 }

References __ASM.

◆ __RV_UCMPLE8()

__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
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 11254 of file core_feature_dsp.h.

11255 {
11256  unsigned long result;
11257  __ASM volatile("ucmple8 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
11258  return result;
11259 }

References __ASM.

◆ __RV_UCMPLT8()

__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
[in]aunsigned long type of value stored in a
[in]bunsigned long type of value stored in b
Returns
value stored in unsigned long type

Definition at line 11333 of file core_feature_dsp.h.

11334 {
11335  unsigned long result;
11336  __ASM volatile("ucmplt8 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
11337  return result;
11338 }

References __ASM.

__ASM
#define __ASM
Pass information from the compiler to the assembler.
Definition: nmsis_gcc.h:55