This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/63321] [SH] Unused T bit result of shll / shlr insns
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Dec 2014 09:43:33 +0000
- Subject: [Bug target/63321] [SH] Unused T bit result of shll / shlr insns
- Auto-submitted: auto-generated
- References: <bug-63321-4 at http dot gcc dot gnu dot org/bugzilla/>
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)