35 template <
typename dataType>
41 uint32_t blockSize = pKerPrivArgs->
blockSize;
47 dataType *pInLocal = (dataType *) pIn;
48 int32_t *pOutLocal = (int32_t *) pOut;
54 using udataType = std::make_unsigned_t<dataType>;
56 int num_bits =
sizeof(dataType) * 8;
60 if (std::numeric_limits<dataType>::is_signed) {
61 for (int32_t counter = 0; counter < (int32_t) blockSize; counter++) {
66 if (x == (dataType) (1u << (uint32_t)(num_bits - 1))) {
70 x_abs = (udataType) (-(
long long) x);
79 for (shift = num_bits - 1; shift >= 0; shift--) {
80 if (((udataType) 1 << (udataType)shift) & mask){
86 *pOutLocal = (int32_t) (num_bits - 1 - shift - 1);
89 for (int32_t counter = 0; counter < (int32_t) blockSize; counter++) {
93 for (shift = num_bits - 1; shift >= 0; shift--) {
94 if (((udataType) 1 << (udataType)shift) & mask){
99 *pOutLocal = (int32_t) (num_bits - 1 - shift);
template DSPLIB_STATUS DSPLIB_bexp_exec_cn< int16_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_bexp_exec_cn< uint8_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_bexp_exec_cn< int32_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_bexp_exec_cn< uint32_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_bexp_exec_cn< int8_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
DSPLIB_STATUS DSPLIB_bexp_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
This function is the main execution function for the natural C implementation of the kernel....
template DSPLIB_STATUS DSPLIB_bexp_exec_cn< uint64_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_bexp_exec_cn< uint16_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_bexp_exec_cn< int64_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_bexp.
#define DSPLIB_DEBUGPRINTFN(N, fmt,...)
DSPLIB_STATUS_NAME
The enumeration of all status codes.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
Structure that is reserved for internal use by the kernel.
uint32_t blockSize
Size of input buffer for different batches DSPLIB_bexp_init that will be retrieved and used by DSPLIB...