This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
_rotl in the complier guide specifies that the function "rotates src2 to the left by the amount in src1". But this implementation in host intrinsics port uses src2(b) to determine src1 rotation. It should be otherwise. "b" should be rotated. "a" specifies rotation amount.
Compiler guide:
unsigned _rotl (unsigned src1, unsigned src2); ROTL Rotates src2 to the left by the amount in src1
Host Intrinsics port:
uint32 _rotl(uint32 a, uint32 b)
{
uint16 shift;
uint32 y;
/* take 5 LSBs */
shift = b & 0x1F;
y = (a << shift) | (a >> (32-shift));
return(y);
} /* end of _rotl() function */
RV
That is an error in the Compiler User's Guide. It should say: Rotates src1 to the left by the amount in src2 . I filed SDSCM00040738 in the SDOWP system to get this changed.
Thanks and regards,
-George