This is the mail archive of the gcc@gcc.gnu.org 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]
Other format: [Raw text]

Re: Building glibc for a mult-lib --target=m68k-linux


On Fri, Aug 23, 2002 at 08:22:18PM -0400, Peter Barada wrote:
> 
> >> 
> >> This will build variants for m68020 m68020/m68881 m68040 m68060
> > 
> >I think its not worth to do extra 68040 configuration, for libgcc,
> >libstdc and java it should be sufficiently similar to 68020/68881.
> 
> Are you kidding?  68020/68881 emits instructions that the 68040/68060
> doesn't grok, forcing emulation via line E/F emulation traps.  Why
> generate optocde that the target doesn't support?

it is clear that we need extra handling for 68060, but it is not 
obvious for the 68040. Iirc the only (gcc relevant) differences 
between 68020/68881 and 68040 are a few FPU operations which are
sufficiently slow that extra emulation overhead should not hurt 
much - never benchmarked it but I would hope the Motorolla provided 
fpsp040 emulation performs at least as good (preformance and 
correctness wise) as any library written in C.
My 68040 manual lists them as: f*cos*,f*sin*,f*tan*,fetox*,fgetexp
fint,ftwotox,fintrz,flog*,fmovecr,ftentox,fmod,frem,fscale.. is any
of that likely to be performance critical for gcc/g++/java/glibc libs?

The matters are very different for the 68060 where some integer
insns have to be emulated, emulating the 32x32->64 mul insn is
perhaps 10 times slower than doing the library call.
For the 68060 we need at least this little patch:

--- gcc-3.2-new/gcc/longlong.h.rz	Sun Jul 21 12:11:51 2002
+++ gcc-3.2-new/gcc/longlong.h	Mon Jul 29 22:43:06 2002
@@ -586,11 +586,12 @@
 	     "g" ((USItype) (bl)))
 
 /* The '020, '030, '040 and CPU32 have 32x32->64 and 64/32->32q-32r.  */
-#if defined (__mc68020__) || defined(mc68020) \
+#if !defined(__mc68060__) && !defined(mc68060) && \
+       (defined (__mc68020__) || defined(mc68020) \
 	|| defined(__mc68030__) || defined(mc68030) \
 	|| defined(__mc68040__) || defined(mc68040) \
 	|| defined(__mcpu32__) || defined(mcpu32) \
-	|| defined(__NeXT__)
+	|| defined(__NeXT__))
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ ("mulu%.l %3,%1:%0"						\
 	   : "=d" ((USItype) (w0)),					\
 


Richard


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