CSI-DSP  Version 1.0.0
CSI DSP Software Library
Functions

Functions

__ALWAYS_INLINE q31_t csky_shr_q31 (q31_t a, q31_t shift)
 right shift Q31 version More...
 
__ALWAYS_INLINE q31_t csky_pshr_q31 (q31_t a, q31_t shift)
 right shift Q31 version More...
 
__ALWAYS_INLINE q31_t csky_pshr_pos_q31 (q31_t a, q31_t shift)
 right shift Q31 version More...
 
__ALWAYS_INLINE q63_t csky_pshr_q63 (q63_t a, q31_t shift)
 right shift Q63 version More...
 

Description

Shift the input value to right with appointed bits, its basic format is:

    a = (a) >> (shift),   1 =< shift <= bitof(a) - 1.

The basic format is only designed for q31.

and the extended format should be rounding to +inf:

    a = (a + (1<<(shift - 1)) >> (shift),   1 =< shift <= bitof(a) - 1.

which are designed for q31, q31 positive and q63.

Function Documentation

__ALWAYS_INLINE q31_t csky_pshr_pos_q31 ( q31_t  a,
q31_t  shift 
)
Parameters
[in]ainput positive value to be shift.
[in]shiftinput positive value, the number of bits to be shift.
[out]resultthe shifted a.

Scaling and Overflow Behavior:

The function is only used for right shift. So, the value of shift is between[1,31]. And the output value is rounding to +inf.
__ALWAYS_INLINE q31_t csky_pshr_q31 ( q31_t  a,
q31_t  shift 
)
Parameters
[in]ainput value to be shift.
[in]shiftinput positive value, the number of bits to be shift.
[out]resultthe shifted a.

Scaling and Overflow Behavior:

The function is only used for right shift. So, the value of shift is between[1,31]. And the output value is rounding to +inf.
__ALWAYS_INLINE q63_t csky_pshr_q63 ( q63_t  a,
q31_t  shift 
)
Parameters
[in]ainput value to be shift.
[in]shiftinput positive value, the number of bits to be shift.
[out]resultthe shifted a.

Scaling and Overflow Behavior:

The function is only used for right shift. So, the value of shift is between[1,63]. And the output value is rounding to +inf.
__ALWAYS_INLINE q31_t csky_shr_q31 ( q31_t  a,
q31_t  shift 
)
Parameters
[in]ainput value to be shift.
[in]shiftinput positive value, the number of bits to be shift.
[out]resultthe shifted a.

Scaling and Overflow Behavior:

The function is only used for right shift. So, the value of shift is between[1,31].