This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: m68k machine description question
- To: paul dot andrews at smartmove dot co dot nz
- Subject: Re: m68k machine description question
- From: Andi Kleen <ak at muc dot de>
- Date: 17 Nov 1999 12:00:17 +0100
- cc: gcc at gcc dot gnu dot org
- References: <199911170233.PAA00924@smtp1.ihug.co.nz>
paul.andrews@smartmove.co.nz writes:
> I have recently (finally!) managed to get a m68k targeted gcc up and going with
> our hardware, but I have noticed something odd. The compiler seems to *always*
> generate calls to the libgcc helper functions for multiply, divide and modulo.
> I tried to have a look around the sources to see why this might be but I got a
> bit lost. From what I did manage to understand I suspect the m68k.md file may
> be the 'culprit'. All of the definitions for these operations appear to only
> support direct instructions on 68020+. The 68000 core has perfectly good
> mulu/divu muls/divs instructions. Can anyone tell me why they are not used? If
> it is the .md file, is there much documentation/examples on its format and
> usage so I can have a hack at it?
The M68000 only has 16x16->32 division/multiplication instructions. If you
multiply/divide two shorts gcc should use them, but for int/long it needs
libgcc functions. M68020+ fixed this.
-Andi
--
This is like TV. I don't like TV.