AnsweredAssumed Answered

Splitting 32bit to 4x8bits

Question asked by bombardiero on Dec 30, 2011
Latest reply on Jan 1, 2012 by bookevg

Hi, I want to split  32bit integer to 4 bytes . I use Visual dsp5 and EZ-KIT ADSP21161N

 

 

int byte = 0xDDAABBCC;
        int a1;
        int a2;
        int a3;
        int a4;
    a1 = (byte>>24)&0xFF;
    a2 = (byte>>16)&0xFF;
    a3 = (byte>>8)&0xFF;
    a4 = (byte>>0)&0xFF;

 

 

Visual is generating shifting

http://img830.imageshack.us/img830/9784/aaacxo.png

not using faster FEXT instrcution.

 

Why it is not generating something like this      

        "R2 = FEXT (byte32)  BY 0:8;"    
        "R3 = FEXT (byte32)  BY 8:8;"    
        "R4 = FEXT (byte32)  BY 16:8;"    
        "R5 = FEXT (byte32)  BY 24:8;"

and how to force optimizer to use FEXT?

Outcomes