cpu32 multilib patch
Joel Sherrill
joel@OARcorp.com
Fri Oct 3 10:39:00 GMT 1997
A few rtems users have been testing a tree I put together using the 970904
snapshot. One of them (Eric Norum) has suggested that cpu32 be a multilib
option for the m68k. I think he is right. There is no real good set of
libraries which are optimized for cpu32. "m68020 nobitfield" means the
m68020 libraries could have bitfield instructions and the 68000 ones are
not optimized for the architecture.
His version of the patch is below my signature. I hope something like
this can be added.
--joel
Joel Sherrill Director of Research & Development
joel@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (205) 722-9985
---------- Forwarded message ----------
Date: Mon, 29 Sep 97 11:37:53 -0600
From: Eric Norum <eric@skatter.USask.Ca>
To: Joel Sherrill <joel@OARcorp.com>
Subject: tools-970904
I just installed the tools-970904 snapshot. I was very pleased to
see how easily it all went. I've got a few comments, though.
====================================================================
1. Howcome configuring for m68k-rtems doesn't enable MULTILIB_OPTIONS for
the 68332 (CPU32)? Since the 68360 is a `supported' target in RTEMS
I think it
should be a first-class citizen in gcc as well.
For now I've just added the following lines to `bit' after the
configure and before the gmake:
#
# Add support for CPU32 (683xx) architecture
#
sed -e '/^MULTILIB_OPTIONS.*=/s/m68020/&\/m68332/' \
-e '/^MULTILIB_MATCHES.*=.*m68000=m68332/s/m68000=m68332//' \
-e '/^MULTILIB_EXCEPTIONS.*=/s/$/ *m68332\/*m68881
*m68332\/*msoft-float/'
\
gcc/Makefile >jnk$$
mv jnk$$ gcc/Makefile
This leaves the corresponding lines in gcc/Makefile as
MULTILIB_OPTIONS = m68000/m68020/m68332/m5200 m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 m68020=mc68020
m68020=m68040
MULTILIB_EXCEPTIONS = *m5200/*m68881 *m5200/*msoft-float
*m68332/*m68881 *m68332/*msoft-float
With these definitions in place you get `68332' (CPU32) versions of
the libgcc and newlib libraries. You can also specify:
CPU_CFLAGS = -m68332
CPU_DEFINES = -Dmcpu32 -D__mcpu32__ $(DEFINES)
in c/make/custom/gne68360.cfg. The CPU_DEFINES line would be unnecessary
if my final suggestion (see below) made it into gcc.
=====================================================================
3. A couple of suggestions. Perhaps you could pass (b) on to the
egcs maintainers?
a) Adding `-pipe' to CFLAGS in bit makes things run faster.
b) I think it would be clearer to have a `-mcpu32' flag to gcc
instead of
(or as well as) `-m68332'. The CPU32 covers a family of embedded
microprocessors of which the 68332 is a single member. GAS already
supports the -mcpu32 flag.
Specifying -mcpu32 should:
Set cpu options to -m68020 -mno-bitfield -msoft-float, just like
the -m68332 option does now.
Define preprocessor macros mcpu32 and __mcpu32__.
Pass the -mcpu32 flag on to GAS.
---
Eric Norum eric@skatter.usask.ca
Saskatchewan Accelerator Laboratory Phone: (306) 966-6308
University of Saskatchewan FAX: (306) 966-6058
Saskatoon, Canada.
More information about the Gcc
mailing list