NMSIS-Core
Version 1.2.0
NMSIS-Core support for Nuclei processor-based devices
|
(RV64 Only) SIMD 32-bit Shift Instructions More...
Macros | |
#define | __RV_KSLLI32(a, b) |
KSLLI32 (SIMD 32-bit Saturating Shift Left Logical Immediate) More... | |
#define | __RV_SLLI32(a, b) |
SLLI32 (SIMD 32-bit Shift Left Logical Immediate) More... | |
#define | __RV_SRAI32(a, b) |
SRAI32 (SIMD 32-bit Shift Right Arithmetic Immediate) More... | |
#define | __RV_SRAI32_U(a, b) |
SRAI32.u (SIMD 32-bit Rounding Shift Right Arithmetic Immediate) More... | |
#define | __RV_SRLI32(a, b) |
SRLI32 (SIMD 32-bit Shift Right Logical Immediate) More... | |
#define | __RV_SRLI32_U(a, b) |
SRLI32.u (SIMD 32-bit Rounding Shift Right Logical Immediate) More... | |
Functions | |
__STATIC_FORCEINLINE unsigned long | __RV_KSLL32 (unsigned long a, unsigned int b) |
KSLL32 (SIMD 32-bit Saturating Shift Left Logical) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_KSLRA32 (unsigned long a, int b) |
KSLRA32 (SIMD 32-bit Shift Left Logical with Saturation or Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_KSLRA32_U (unsigned long a, int b) |
KSLRA32.u (SIMD 32-bit Shift Left Logical with Saturation or Rounding Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SLL32 (unsigned long a, unsigned int b) |
SLL32 (SIMD 32-bit Shift Left Logical) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SRA32 (unsigned long a, unsigned int b) |
SRA32 (SIMD 32-bit Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SRA32_U (unsigned long a, unsigned int b) |
SRA32.u (SIMD 32-bit Rounding Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SRL32 (unsigned long a, unsigned int b) |
SRL32 (SIMD 32-bit Shift Right Logical) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SRL32_U (unsigned long a, unsigned int b) |
SRL32.u (SIMD 32-bit Rounding Shift Right Logical) More... | |
(RV64 Only) SIMD 32-bit Shift Instructions
there are 14 (RV64 Only) SIMD 32-bit Shift Instructions
#define __RV_KSLLI32 | ( | a, | |
b | |||
) |
KSLLI32 (SIMD 32-bit Saturating Shift Left Logical Immediate)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements logical left shift operations with saturation simultaneously. The shift amount is an immediate value.
Description:
The 32-bit data elements in Rs1 are left-shifted logically. The shifted out bits are filled with zero and the shift amount is specified by the imm5u constant. Any shifted value greater than 2^31-1 is saturated to 2^31-1. Any shifted value smaller than -2^31 is saturated to -2^31. And the saturated results are written to Rd. If any saturation is performed, set OV bit to 1.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 15418 of file core_feature_dsp.h.
#define __RV_SLLI32 | ( | a, | |
b | |||
) |
SLLI32 (SIMD 32-bit Shift Left Logical Immediate)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit element logical left shift operations simultaneously. The shift amount is an immediate value.
Description:
The 32-bit elements in Rs1 are left-shifted logically. The shifted out bits are filled with zero and the shift amount is specified by the imm5u[4:0] constant. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 16251 of file core_feature_dsp.h.
#define __RV_SRAI32 | ( | a, | |
b | |||
) |
SRAI32 (SIMD 32-bit Shift Right Arithmetic Immediate)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements arithmetic right shift operations simultaneously. The shift amount is an immediate value. The .u
form performs additional rounding up operations on the shifted results.
Description:
The 32-bit data elements in Rs1 are right-shifted arithmetically, that is, the shifted out bits are filled with the sign-bit of the 32-bit data elements. The shift amount is specified by the imm5u constant. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 32-bit data to calculate the final results. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 16793 of file core_feature_dsp.h.
#define __RV_SRAI32_U | ( | a, | |
b | |||
) |
SRAI32.u (SIMD 32-bit Rounding Shift Right Arithmetic Immediate)
Type: DSP (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements arithmetic right shift operations simultaneously. The shift amount is an immediate value. The .u
form performs additional rounding up operations on the shifted results.
Description:
The 32-bit data elements in Rs1 are right-shifted arithmetically, that is, the shifted out bits are filled with the sign-bit of the 32-bit data elements. The shift amount is specified by the imm5u constant. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 32-bit data to calculate the final results. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 16847 of file core_feature_dsp.h.
#define __RV_SRLI32 | ( | a, | |
b | |||
) |
SRLI32 (SIMD 32-bit Shift Right Logical Immediate)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements logical right shift operations simultaneously. The shift amount is an immediate value. The .u
form performs additional rounding up operations on the shifted results.
Description:
The 32-bit data elements in Rs1 are right-shifted logically, that is, the shifted out bits are filled with zero. The shift amount is specified by the imm5u constant. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 32-bit data to calculate the final results. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 17051 of file core_feature_dsp.h.
#define __RV_SRLI32_U | ( | a, | |
b | |||
) |
SRLI32.u (SIMD 32-bit Rounding Shift Right Logical Immediate)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements logical right shift operations simultaneously. The shift amount is an immediate value. The .u
form performs additional rounding up operations on the shifted results.
Description:
The 32-bit data elements in Rs1 are right-shifted logically, that is, the shifted out bits are filled with zero. The shift amount is specified by the imm5u constant. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 32-bit data to calculate the final results. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 17103 of file core_feature_dsp.h.
__STATIC_FORCEINLINE unsigned long __RV_KSLL32 | ( | unsigned long | a, |
unsigned int | b | ||
) |
KSLL32 (SIMD 32-bit Saturating Shift Left Logical)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements logical left shift operations with saturation simultaneously. The shift amount is a variable from a GPR.
Description:
The 32-bit data elements in Rs1 are left-shifted logically. The shifted out bits are filled with zero and the shift amount is specified by the low-order 5-bits of the value in the Rs2 register. Any shifted value greater than 2^31-1 is saturated to 2^31-1. Any shifted value smaller than -2^31 is saturated to -2^31. And the saturated results are written to Rd. If any saturation is performed, set OV bit to 1.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 15367 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_KSLRA32 | ( | unsigned long | a, |
int | b | ||
) |
KSLRA32 (SIMD 32-bit Shift Left Logical with Saturation or Shift Right Arithmetic)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements logical left (positive) or arithmetic right (negative) shift operation with Q31 saturation for the left shift. The .u
form performs additional rounding up operations for the right shift.
Description:
The 32-bit data elements of Rs1 are left-shifted logically or right-shifted arithmetically based on the value of Rs2[5:0]. Rs2[5:0] is in the signed range of [-25, 25-1]. A positive Rs2[5:0] means logical left shift and a negative Rs2[5:0] means arithmetic right shift. The shift amount is the absolute value of Rs2[5:0]. However, the behavior of Rs2[5:0]==-25 (0x20)
is defined to be equivalent to the behavior of Rs2[5:0]==-(25-1) (0x21)
. The left-shifted results are saturated to the 32-bit signed integer range of [-2^31, 2^31-1]. For the .u
form of the instruction, the right-shifted results are added a 1 to the most significant discarded bit position for rounding effect. After the shift, saturation, or rounding, the final results are written to Rd. If any saturation happens, this instruction sets the OV flag. The value of Rs2[31:6] will not affect this instruction.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | int type of value stored in b |
Definition at line 15485 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_KSLRA32_U | ( | unsigned long | a, |
int | b | ||
) |
KSLRA32.u (SIMD 32-bit Shift Left Logical with Saturation or Rounding Shift Right Arithmetic)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements logical left (positive) or arithmetic right (negative) shift operation with Q31 saturation for the left shift. The .u
form performs additional rounding up operations for the right shift.
Description:
The 32-bit data elements of Rs1 are left-shifted logically or right-shifted arithmetically based on the value of Rs2[5:0]. Rs2[5:0] is in the signed range of [-25, 25-1]. A positive Rs2[5:0] means logical left shift and a negative Rs2[5:0] means arithmetic right shift. The shift amount is the absolute value of Rs2[5:0]. However, the behavior of Rs2[5:0]==-25 (0x20)
is defined to be equivalent to the behavior of Rs2[5:0]==-(25-1) (0x21)
. The left-shifted results are saturated to the 32-bit signed integer range of [-2^31, 2^31-1]. For the .u
form of the instruction, the right-shifted results are added a 1 to the most significant discarded bit position for rounding effect. After the shift, saturation, or rounding, the final results are written to Rd. If any saturation happens, this instruction sets the OV flag. The value of Rs2[31:6] will not affect this instruction.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | int type of value stored in b |
Definition at line 15551 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SLL32 | ( | unsigned long | a, |
unsigned int | b | ||
) |
SLL32 (SIMD 32-bit Shift Left Logical)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit elements logical left shift operations simultaneously. The shift amount is a variable from a GPR.
Description:
The 32-bit elements in Rs1 are left-shifted logically. And the results are written to Rd. The shifted out bits are filled with zero and the shift amount is specified by the low-order 5-bits of the value in the Rs2 register.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 16212 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SRA32 | ( | unsigned long | a, |
unsigned int | b | ||
) |
SRA32 (SIMD 32-bit Shift Right Arithmetic)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit element arithmetic right shift operations simultaneously. The shift amount is a variable from a GPR. The .u
form performs additional rounding up operations on the shifted results.
Description:
The 32-bit data elements in Rs1 are right-shifted arithmetically, that is, the shifted out bits are filled with the sign-bit of the data elements. The shift amount is specified by the low-order 5-bits of the value in the Rs2 register. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 32-bit data element to calculate the final results. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 16687 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SRA32_U | ( | unsigned long | a, |
unsigned int | b | ||
) |
SRA32.u (SIMD 32-bit Rounding Shift Right Arithmetic)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit element arithmetic right shift operations simultaneously. The shift amount is a variable from a GPR. The .u
form performs additional rounding up operations on the shifted results.
Description:
The 32-bit data elements in Rs1 are right-shifted arithmetically, that is, the shifted out bits are filled with the sign-bit of the data elements. The shift amount is specified by the low-order 5-bits of the value in the Rs2 register. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 32-bit data element to calculate the final results. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 16740 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SRL32 | ( | unsigned long | a, |
unsigned int | b | ||
) |
SRL32 (SIMD 32-bit Shift Right Logical)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit element logical right shift operations simultaneously. The shift amount is a variable from a GPR. The .u
form performs additional rounding up operations on the shifted results.
Description:
The 32-bit data elements in Rs1 are right-shifted logically, that is, the shifted out bits are filled with zero. The shift amount is specified by the low-order 5-bits of the value in the Rs2 register. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 32-bit data element to calculate the final results. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 16947 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SRL32_U | ( | unsigned long | a, |
unsigned int | b | ||
) |
SRL32.u (SIMD 32-bit Rounding Shift Right Logical)
Type: SIMD (RV64 Only)
Syntax:
Purpose:
Do 32-bit element logical right shift operations simultaneously. The shift amount is a variable from a GPR. The .u
form performs additional rounding up operations on the shifted results.
Description:
The 32-bit data elements in Rs1 are right-shifted logically, that is, the shifted out bits are filled with zero. The shift amount is specified by the low-order 5-bits of the value in the Rs2 register. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 32-bit data element to calculate the final results. And the results are written to Rd.
Operations:
[in] | a | unsigned long type of value stored in a |
[in] | b | unsigned int type of value stored in b |
Definition at line 17000 of file core_feature_dsp.h.
References __ASM.