This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Add more combine patterns to h8300 port.
- To: Kazu Hirata <kazu at hxi dot com>
- Subject: Re: [patch] Add more combine patterns to h8300 port.
- From: law at redhat dot com
- Date: Wed, 31 Oct 2001 09:05:51 -0700
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at redhat dot com
In message <200110302102.NAA12895@cygnus.com>you write:
> Hi,
>
> Attached is a patch to add more combine patterns to h8300 port.
>
> The patch saves several instructions in the following code. This kind
> of code is not uncommon.
>
> unsigned short
> hi (unsigned char m, unsigned char n)
> {
> return m | ((unsigned short) n << 8);
> }
>
> unsigned long
> si (unsigned short m, unsigned short n)
> {
> return m | ((unsigned long) n << 16);
> }
>
> .align 1
> .global _hi
> _hi:
> - mov.b r1l,r1h <- original (four insns)
> - sub.b r1l,r1l
> - or r0l,r1l
> - mov.w r1,r0
> + mov.b r1l,r0h <- patched (just ons insn)
> rts
> .align 1
> .global _si
> _si:
> - mov.w r1,e1 <- original (four insns)
> - sub.w r1,r1
> - or.w r0,r1
> - mov.l er1,er0
> + mov.w r1,e0 <- patched (just one insn)
> rts
>
> Tested on h8300 port. OK to apply?
>
> Kazu Hirata
>
> 2001-10-30 Kazu Hirata <kazu@hxi.com>
>
> * config/h8300/h8300.md (two anonymous patterns): New.
Approved. Please install.
jeff