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.

Does IQ math shortcut for arguments of 1?

Hi folks,

Wondering if C28x IQmath lib div and mpy type functions take shortcuts for values of one (and zero in the case of mpy I guess), or if I should check for and shortcut on one myself?

x = _IQ24div(y, z); 
// vs
if (z == _IQ24(1))
    x = y;
else
    x = _IQ24div(y, z);

// Or

x = _IQrsmpy(y, z);
// vs
if(y == 0 || z == 0)
    x = 0;
else if(y == _IQ(1))
    x = z;
else if(z == _IQ(1))
    x = y;
else
    x = _IQrsmpy(y, z);