NMSIS-Core
Version 1.2.0
NMSIS-Core support for Nuclei processor-based devices
|
SIMD 16-bit Shift Instructions. More...
Macros | |
#define | __RV_KSLLI16(a, b) |
KSLLI16 (SIMD 16-bit Saturating Shift Left Logical Immediate) More... | |
#define | __RV_SLLI16(a, b) |
SLLI16 (SIMD 16-bit Shift Left Logical Immediate) More... | |
#define | __RV_SRAI16(a, b) |
SRAI16 (SIMD 16-bit Shift Right Arithmetic Immediate) More... | |
#define | __RV_SRAI16_U(a, b) |
SRAI16.u (SIMD 16-bit Rounding Shift Right Arithmetic Immediate) More... | |
#define | __RV_SRLI16(a, b) |
SRLI16 (SIMD 16-bit Shift Right Logical Immediate) More... | |
#define | __RV_SRLI16_U(a, b) |
SRLI16.u (SIMD 16-bit Rounding Shift Right Logical Immediate) More... | |
Functions | |
__STATIC_FORCEINLINE unsigned long | __RV_KSLL16 (unsigned long a, unsigned int b) |
KSLL16 (SIMD 16-bit Saturating Shift Left Logical) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_KSLRA16 (unsigned long a, int b) |
KSLRA16 (SIMD 16-bit Shift Left Logical with Saturation or Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_KSLRA16_U (unsigned long a, int b) |
KSLRA16.u (SIMD 16-bit Shift Left Logical with Saturation or Rounding Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SLL16 (unsigned long a, unsigned int b) |
SLL16 (SIMD 16-bit Shift Left Logical) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SRA16 (unsigned long a, unsigned long b) |
SRA16 (SIMD 16-bit Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SRA16_U (unsigned long a, unsigned long b) |
SRA16.u (SIMD 16-bit Rounding Shift Right Arithmetic) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SRL16 (unsigned long a, unsigned int b) |
SRL16 (SIMD 16-bit Shift Right Logical) More... | |
__STATIC_FORCEINLINE unsigned long | __RV_SRL16_U (unsigned long a, unsigned int b) |
SRL16.u (SIMD 16-bit Rounding Shift Right Logical) More... | |
SIMD 16-bit Shift Instructions.
there are 14 SIMD 16-bit shift instructions.
#define __RV_KSLLI16 | ( | a, | |
b | |||
) |
KSLLI16 (SIMD 16-bit Saturating Shift Left Logical Immediate)
Type: SIMD
Syntax:
Purpose:
Do 16-bit elements logical left shift operations with saturation simultaneously. The shift amount is an immediate value.
Description:
The 16-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 imm4u constant. Any shifted value greater than 2^15-1 is saturated to 2^15-1. Any shifted value smaller than -2^15 is saturated to -2^15. 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 4829 of file core_feature_dsp.h.
#define __RV_SLLI16 | ( | a, | |
b | |||
) |
SLLI16 (SIMD 16-bit Shift Left Logical Immediate)
Type: SIMD
Syntax:
Purpose:
Do 16-bit element logical left shift operations simultaneously. The shift amount is an immediate value.
Description:
The 16-bit elements in Rs1 are left-shifted logically. The shifted out bits are filled with zero and the shift amount is specified by the imm4[3: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 7336 of file core_feature_dsp.h.
#define __RV_SRAI16 | ( | a, | |
b | |||
) |
SRAI16 (SIMD 16-bit Shift Right Arithmetic Immediate)
Type: SIMD
Syntax:
Purpose:
Do 16-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 16-bit data elements in Rs1 are right-shifted arithmetically, that is, the shifted out bits are filled with the sign-bit of the 16-bit data elements. The shift amount is specified by the imm4u constant. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 16-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 long type of value stored in b |
Definition at line 10057 of file core_feature_dsp.h.
#define __RV_SRAI16_U | ( | a, | |
b | |||
) |
SRAI16.u (SIMD 16-bit Rounding Shift Right Arithmetic Immediate)
Type: SIMD
Syntax:
Purpose:
Do 16-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 16-bit data elements in Rs1 are right-shifted arithmetically, that is, the shifted out bits are filled with the sign-bit of the 16-bit data elements. The shift amount is specified by the imm4u constant. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 16-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 long type of value stored in b |
Definition at line 10112 of file core_feature_dsp.h.
#define __RV_SRLI16 | ( | a, | |
b | |||
) |
SRLI16 (SIMD 16-bit Shift Right Logical Immediate)
Type: SIMD
Syntax:
Purpose:
Do 16-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 16-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 imm4u constant. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 16-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 10481 of file core_feature_dsp.h.
#define __RV_SRLI16_U | ( | a, | |
b | |||
) |
SRLI16.u (SIMD 16-bit Rounding Shift Right Logical Immediate)
Type: SIMD
Syntax:
Purpose:
Do 16-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 16-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 imm4u constant. For the rounding operation of the .u
form, a value of 1 is added to the most significant discarded bit of each 16-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 10534 of file core_feature_dsp.h.
__STATIC_FORCEINLINE unsigned long __RV_KSLL16 | ( | unsigned long | a, |
unsigned int | b | ||
) |
KSLL16 (SIMD 16-bit Saturating Shift Left Logical)
Type: SIMD
Syntax:
Purpose:
Do 16-bit elements logical left shift operations with saturation simultaneously. The shift amount is a variable from a GPR.
Description:
The 16-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 4-bits of the value in the Rs2 register. Any shifted value greater than 2^15-1 is saturated to 2^15-1. Any shifted value smaller than -2^15 is saturated to -2^15. 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 4777 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_KSLRA16 | ( | unsigned long | a, |
int | b | ||
) |
KSLRA16 (SIMD 16-bit Shift Left Logical with Saturation or Shift Right Arithmetic)
Type: SIMD
Syntax:
Purpose:
Do 16-bit elements logical left (positive) or arithmetic right (negative) shift operation with Q15 saturation for the left shift. The .u
form performs additional rounding up operations for the right shift.
Description:
The 16-bit data elements of Rs1 are left-shifted logically or right-shifted arithmetically based on the value of Rs2[4:0]. Rs2[4:0] is in the signed range of [-2^4, 2^4-1]. A positive Rs2[4:0] means logical left shift and a negative Rs2[4:0] means arithmetic right shift. The shift amount is the absolute value of Rs2[4:0]. However, the behavior of Rs2[4:0]==-2^4 (0x10)
is defined to be equivalent to the behavior of Rs2[4:0]==-(2^4-1) (0x11)
. The left-shifted results are saturated to the 16-bit signed integer range of [-2^15, 2^15-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:5] 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 5031 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_KSLRA16_U | ( | unsigned long | a, |
int | b | ||
) |
KSLRA16.u (SIMD 16-bit Shift Left Logical with Saturation or Rounding Shift Right Arithmetic)
Type: SIMD
Syntax:
Purpose:
Do 16-bit elements logical left (positive) or arithmetic right (negative) shift operation with Q15 saturation for the left shift. The .u
form performs additional rounding up operations for the right shift.
Description:
The 16-bit data elements of Rs1 are left-shifted logically or right-shifted arithmetically based on the value of Rs2[4:0]. Rs2[4:0] is in the signed range of [-2^4, 2^4-1]. A positive Rs2[4:0] means logical left shift and a negative Rs2[4:0] means arithmetic right shift. The shift amount is the absolute value of Rs2[4:0]. However, the behavior of Rs2[4:0]==-2^4 (0x10)
is defined to be equivalent to the behavior of Rs2[4:0]==-(2^4-1) (0x11)
. The left-shifted results are saturated to the 16-bit signed integer range of [-2^15, 2^15-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:5] 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 5098 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SLL16 | ( | unsigned long | a, |
unsigned int | b | ||
) |
SLL16 (SIMD 16-bit Shift Left Logical)
Type: SIMD
Syntax:
Purpose:
Do 16-bit elements logical left shift operations simultaneously. The shift amount is a variable from a GPR.
Description:
The 16-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 4-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 7296 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SRA16 | ( | unsigned long | a, |
unsigned long | b | ||
) |
SRA16 (SIMD 16-bit Shift Right Arithmetic)
Type: SIMD
Syntax:
Purpose:
Do 16-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 16-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 4-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 16-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 long type of value stored in b |
Definition at line 9949 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SRA16_U | ( | unsigned long | a, |
unsigned long | b | ||
) |
SRA16.u (SIMD 16-bit Rounding Shift Right Arithmetic)
Type: SIMD
Syntax:
Purpose:
Do 16-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 16-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 4-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 16-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 long type of value stored in b |
Definition at line 10003 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SRL16 | ( | unsigned long | a, |
unsigned int | b | ||
) |
SRL16 (SIMD 16-bit Shift Right Logical)
Type: SIMD
Syntax:
Purpose:
Do 16-bit elements logical right shift operations simultaneously. The shift amount is a variable from a GPR. The .u
form performs additional rounding upoperations on the shifted results.
Description:
The 16-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 4-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 16-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 10377 of file core_feature_dsp.h.
References __ASM.
__STATIC_FORCEINLINE unsigned long __RV_SRL16_U | ( | unsigned long | a, |
unsigned int | b | ||
) |
SRL16.u (SIMD 16-bit Rounding Shift Right Logical)
Type: SIMD
Syntax:
Purpose:
Do 16-bit elements logical right shift operations simultaneously. The shift amount is a variable from a GPR. The .u
form performs additional rounding upoperations on the shifted results.
Description:
The 16-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 4-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 16-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 10429 of file core_feature_dsp.h.
References __ASM.