This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: m68k machine description question 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 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.


This is like TV. I don't like TV.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]