This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/63321] [SH] Unused T bit result of shll / shlr insns


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63321

--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> ---
A more advanced example:

void test4 (unsigned int x, unsigned int* y)
{
  y[0] = (x >> 0) & 1;
  y[1] = (x >> 1) & 1;
  y[2] = x >> 2;
}

currently compiles to:
        mov     r4,r0
        and     #1,r0
        mov.l   r0,@r5
        mov     r4,r0
        shlr    r0
        and     #1,r0
        shlr2   r4
        mov.l   r0,@(4,r5)
        rts
        mov.l   r4,@(8,r5)

better:
        shlr     r4
        movt     r0
        shlr     r4
        mov.l    r0,@r5
        movt     r1
        mov.l    r4,@(8,r5)
        rts
        mov.l    r1,@(4,r5)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]