On Dec 17, 2006, at 12:40 PM, Rask Ingemann Lambertsen wrote:

   Hi.

   I seem unable to get a QImode shift instruction from this code:

unsigned char x;

void qishifttest2 (unsigned int c)
{
        x <<= c;
}

should have been generated. Also, notice the redundant zero extension.
Why are we not generating a QImode shift instruction?

Consider when c = 16. With the (required) integer promotion, the result is defined (the result is zero). If converted to QImode, the shift would be undefined, because the (dynamic) shift amount would be larger than the data type.

-Chris

Reply via email to