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

SIMD 16-bit Compare Instructions. More...

Functions

__STATIC_FORCEINLINE unsigned long __RV_CMPEQ16 (unsigned long a, unsigned long b)
 CMPEQ16 (SIMD 16-bit Integer Compare Equal) More...
 
__STATIC_FORCEINLINE unsigned long __RV_SCMPLE16 (unsigned long a, unsigned long b)
 SCMPLE16 (SIMD 16-bit Signed Compare Less Than & Equal) More...
 
__STATIC_FORCEINLINE unsigned long __RV_SCMPLT16 (unsigned long a, unsigned long b)
 SCMPLT16 (SIMD 16-bit Signed Compare Less Than) More...
 
__STATIC_FORCEINLINE unsigned long __RV_UCMPLE16 (unsigned long a, unsigned long b)
 UCMPLE16 (SIMD 16-bit Unsigned Compare Less Than & Equal) More...
 
__STATIC_FORCEINLINE unsigned long __RV_UCMPLT16 (unsigned long a, unsigned long b)
 UCMPLT16 (SIMD 16-bit Unsigned Compare Less Than) More...
 

Detailed Description

SIMD 16-bit Compare Instructions.

there are 5 SIMD 16-bit Compare instructions.

Function Documentation

◆ __RV_CMPEQ16()

__STATIC_FORCEINLINE unsigned long __RV_CMPEQ16 ( unsigned long  a,
unsigned long  b 
)

CMPEQ16 (SIMD 16-bit Integer Compare Equal)

Type: SIMD

Syntax:

CMPEQ16 Rd, Rs1, Rs2

Purpose:
Do 16-bit integer elements equal comparisons simultaneously.

Description:
This instruction compares the 16-bit integer elements in Rs1 with the 16-bit integer elements in Rs2 to see if they are equal. If they are equal, the result is 0xFFFF; otherwise, the result is 0x0. The 16-bit element comparison results are written to Rt.

Note:
This instruction can be used for either signed or unsigned numbers.

Operations:

Rd.H[x] = (Rs1.H[x] == Rs2.H[x])? 0xffff : 0x0;
for RV32: x=1...0,
for RV64: x=3...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 1236 of file core_feature_dsp.h.

1237 {
1238  unsigned long result;
1239  __ASM volatile("cmpeq16 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
1240  return result;
1241 }

References __ASM.

◆ __RV_SCMPLE16()

__STATIC_FORCEINLINE unsigned long __RV_SCMPLE16 ( unsigned long  a,
unsigned long  b 
)

SCMPLE16 (SIMD 16-bit Signed Compare Less Than & Equal)

Type: SIMD

Syntax:

SCMPLE16 Rd, Rs1, Rs2

Purpose:
Do 16-bit signed integer elements less than & equal comparisons simultaneously.

Description:
This instruction compares the 16-bit signed integer elements in Rs1 with the 16-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 0xFFFF; otherwise, the result is 0x0. The element comparison results are written to Rd.

Operations:

Rd.H[x] = (Rs1.H[x] {le} Rs2.H[x])? 0xffff : 0x0;
for RV32: x=1...0,
for RV64: x=3...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 7095 of file core_feature_dsp.h.

7096 {
7097  unsigned long result;
7098  __ASM volatile("scmple16 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
7099  return result;
7100 }

References __ASM.

◆ __RV_SCMPLT16()

__STATIC_FORCEINLINE unsigned long __RV_SCMPLT16 ( unsigned long  a,
unsigned long  b 
)

SCMPLT16 (SIMD 16-bit Signed Compare Less Than)

Type: SIMD

Syntax:

SCMPLT16 Rd, Rs1, Rs2

Purpose:
Do 16-bit signed integer elements less than comparisons simultaneously.

Description:
This instruction compares the 16-bit signed integer elements in Rs1 with the two 16- 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 0xFFFF; otherwise, the result is 0x0. The element comparison results are written to Rd.

Operations:

Rd.H[x] = (Rs1.H[x] < Rs2.H[x])? 0xffff : 0x0;
for RV32: x=1...0,
for RV64: x=3...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 7173 of file core_feature_dsp.h.

7174 {
7175  unsigned long result;
7176  __ASM volatile("scmplt16 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
7177  return result;
7178 }

References __ASM.

◆ __RV_UCMPLE16()

__STATIC_FORCEINLINE unsigned long __RV_UCMPLE16 ( unsigned long  a,
unsigned long  b 
)

UCMPLE16 (SIMD 16-bit Unsigned Compare Less Than & Equal)

Type: SIMD

Syntax:

UCMPLE16 Rd, Rs1, Rs2

Purpose:
Do 16-bit unsigned integer elements less than & equal comparisons simultaneously.

Description:
This instruction compares the 16-bit unsigned integer elements in Rs1 with the 16-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 0xFFFF; otherwise, the result is 0x0. The element comparison results are written to Rd.

Operations:

Rd.H[x] = (Rs1.H[x] <=u Rs2.H[x])? 0xffff : 0x0;
for RV32: x=1...0,
for RV64: x=3...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 11294 of file core_feature_dsp.h.

11295 {
11296  unsigned long result;
11297  __ASM volatile("ucmple16 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
11298  return result;
11299 }

References __ASM.

◆ __RV_UCMPLT16()

__STATIC_FORCEINLINE unsigned long __RV_UCMPLT16 ( unsigned long  a,
unsigned long  b 
)

UCMPLT16 (SIMD 16-bit Unsigned Compare Less Than)

Type: SIMD

Syntax:

UCMPLT16 Rd, Rs1, Rs2

Purpose:
Do 16-bit unsigned integer elements less than comparisons simultaneously.

Description:
This instruction compares the 16-bit unsigned integer elements in Rs1 with the 16-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 0xFFFF; otherwise, the result is 0x0. The element comparison results are written to Rd.

Operations:

Rd.H[x] = (Rs1.H[x] <u Rs2.H[x])? 0xffff : 0x0;
for RV32: x=1...0,
for RV64: x=3...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 11372 of file core_feature_dsp.h.

11373 {
11374  unsigned long result;
11375  __ASM volatile("ucmplt16 %0, %1, %2" : "=r"(result) : "r"(a), "r"(b));
11376  return result;
11377 }

References __ASM.

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