🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #227

generation of decrement and branch instruction for m68k(1.37 and 2.2.2)

#227
From: Nobuyuki Hikichi
Date: Tue, 11 Aug 1992 20:08
54 lines
2894 bytes
I want gcc to generate `dbra'(decrement and branch) instruction for m68k.
I cannot do in gcc-2.1 but I can do in gcc-1.37.1 as following;
Does anyone have a idea to generate dbra in gcc version 2?

			Name: Nobuyuki Hikichi <hikichi@sra.co.jp>
			Office: Software Research Associates, Inc. Japan.


hikichi@sran230 $ gcc68k -v -O -S y.c -v  -finline-functions -fstrength-reduce -da -fno-peephole -dr -dj -ds -dL -df -dc -dl -dg -dd -dJ
gcc version 1.37.1
 /usr/local/gcc68k/lib/gcc-cpp -v -undef -D__GNUC__ -Dunix -Dbsd43 -Dsony -Dsony_news -Dmc68000 -Dmc68020 -Dnews800 -D__unix__ -D__bsd43__ -D__sony__ -D__sony_news__ -D__mc68000__ -D__mc68020__ -D__news800__ -D__OPTIMIZE__ -D__HAVE_68881__ y.c /usr/tmp/cc004472.cpp
GNU CPP version 1.37.1
 /usr/local/gcc68k/lib/gcc-cc1 /usr/tmp/cc004472.cpp -quiet -dumpbase y.c -da -dr -dj -ds -dL -df -dc -dl -dg -dd -dJ -finline-functions -fstrength-reduce -fno-peephole -O -version -o y.s
GNU C version 1.37.1 (68k, MIT syntax) compiled by CC.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
hikichi@sran230 $ grep dbra *.s
y.s:	dbra d0,L28
hikichi@sran230 $ cat y.c
:
:
int
func (a, size)
     int a[];
     int size;
{
  short i;
  int t;
  
  if (size > MAX_SHORT)
    abort ();

  if (size < 1)
    return 0;

  i = size - 1;
  t = 0;
  do
    {
      t += a[i];
    }
  while (i--);

  return t;
}
hikichi@sran230 $ cc-m68k-sony-bsd -O2 -S y.c -v  -finline-functions  -DUSE_DBRA -fstrength-reduce -da -fno-peephole -dr -dj -ds -dL -df -dc -dl -dg -dd -dJ
Reading specs from /usr/local/gnu/lib/gcc-lib/m68k-sony-bsd/2.1/specs
gcc version 2.1
 /usr/local/gnu/lib/gcc-lib/m68k-sony-bsd/2.1/cpp -lang-c -v -DUSE_DBRA -undef -D__GNUC__=2 -Dunix -Dbsd43 -Dsony -Dsony_news -Dmc68000 -Dmc68020 -Dnews800 -D__unix__ -D__bsd43__ -D__sony__ -D__sony_news__ -D__mc68000__ -D__mc68020__ -D__news800__ -D__unix -D__bsd43 -D__sony -D__sony_news -D__mc68000 -D__mc68020 -D__news800 -D__OPTIMIZE__ -da -dr -dj -ds -dL -df -dc -dl -dg -dd -dJ -D__HAVE_68881__ y.c /var/tmp/cc004654.i
GNU CPP version 2.1 (68k, MIT syntax)
 /usr/local/gnu/lib/gcc-lib/m68k-sony-bsd/2.1/cc1 /var/tmp/cc004654.i -quiet -dumpbase y.c -da -dr -dj -ds -dL -df -dc -dl -dg -dd -dJ -O2 -version -finline-functions -fstrength-reduce -fno-peephole -o y.s
GNU C version 2.1 (68k, MIT syntax) compiled by CC.
hikichi@sran230 $ grep dbra y.s
hikichi@sran230 $ 
Technical Details
Message-ID: <9208110208.AA24402@srarc2.sra.co.jp>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!srarc2.sra.co.JP!hikichi

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!srarc2.sra.co.JP!hikichi
From: hikichi@srarc2.sra.co.JP (Nobuyuki Hikichi)
Subject: generation of decrement and branch instruction for m68k(1.37 and 2.2.2)
Message-ID: <9208110208.AA24402@srarc2.sra.co.jp>
Sender: daemon@cis.ohio-state.edu
Reply-To: hikichi@sra.co.jp
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 11 Aug 1992 20:08:47 GMT
Lines: 54