This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Missed optimization in m68k
- From: Alan Lehotsky <apl at alum dot mit dot edu>
- To: law at redhat dot com
- Cc: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 14 Jun 2002 17:02:35 -0400
- Subject: Re: Missed optimization in m68k
- References: <20222.1024084138@porcupine.cygnus.com>
At 1:48 PM -0600 6/14/02, law@redhat.com wrote:
In message <200206141923.g5EJNeK22444@hyper.wm.sps.mot.com>, Peter
Barada write
s:
>
> I'm compiling the small snippet:
.....
> The problem is that the tst.b is not necessary since the move.b
> updated the condition codes as part of the move. How can I best
> convince gcc that it should generate the follwing instead:
>
> copy:
> move.l 4(%sp),%a1
> move.l 8(%sp),%a0
> move.l %a0,%d0
> .L2:
> move.b (%a1)+,(%a0)+
> jbne .L2
> rts
>
> Thanx...
I believe you'll be hacking in NOTICE_UPDATE_CC.
jeff
In this case, I suspect that a DEFINE_PEEPHOLE is probably better!
Since I'm guessing that the RTL for the generated code has the
POST_INC on the source side
of the (SET (CC) ...) the 'move.b' instruction is already output
into the ".s" file, so you can't
get the CC_UPDATE logic to generate a
move.b (%a1)+,(%a0)+
but if you recognized the sequence of instructions and emitted the
optimal loop....
--
Quality Software Management
http://home.earthlink.net/~qsmgmt
apl@alum.mit.edu
(978)287-0435 Voice
(978)808-6836 Cell
Software Process Improvement / Management Consulting
Language Design / Compiler Implementation