This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [m68k] Convert CPP_SPEC to TARGET_CPU_CPP_BUILTINS
- From: Bernardo Innocenti <bernie at develer dot com>
- To: Gunther Nikl <gni at gecko dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>
- Date: Mon, 15 Sep 2003 16:13:33 +0200
- Subject: Re: [m68k] Convert CPP_SPEC to TARGET_CPU_CPP_BUILTINS
- Organization: Develer S.r.l.
- References: <3F64D105.1050001@develer.com> <20030915085959.GA20030@lorien.int.gecko.de>
Gunther Nikl wrote:
On Sun, Sep 14, 2003 at 10:35:17PM +0200, Bernardo Innocenti wrote:
+ builtin_define_std ("mc68000"); \
+ if (TARGET_68020) \
+ { \
+ builtin_define_std ("mc68020"); \
+ builtin_define_std ("mc68030"); \
+ } \
Its true that -m68030 is a synonym for -m68020 with GCC. However, defining
mc68030 together with mc68020 changes previous behaviour. mc68030 was only
defined through the specsfile when -m68030 was really specified on the
commandline.
I know, but there's no easy way to recover this information at this time.
Because the 68030 looks exactly like a 68020 except for the cache size,
the compiler doesn't care and user code should care even less.
To get that right, we would have to add dummy MASK_68030 and
TARGET_68030 macros just for that porpose.
+ if (TARGET_68040 || TARGET_68040_ONLY) \
+ builtin_define_std ("mc68040"); \
I think that TARGET_68040 is enough.
Hmmm... not if we want -m68060 to also define __mc68040__:
{ "68060", (MASK_68020|MASK_68881|MASK_BITFIELD
|MASK_68040_ONLY|MASK_68060), "" },
But wait, the old behavior was to define just __mc68060__
in that case.
This is probably done because the 68060 lacks some 68040 FPU
instructions (and if I remember correctly, perhaps even some
integer ones such as CHK2).
Ok, I'll change it back to TARGET_68040 only.
+ if (TARGET_68881) \
+ builtin_define ("__HAVE_68881__"); \
This is also a change in behaviour if soft-float was default. TARGET_68881
is also true when -m680[46]0 was specified on the commandline.
This behavior should still hold:
{ "68881", MASK_68881, "" },
-m68881 adds the MASK_68881 flag.
{ "soft-float", - (MASK_68040_ONLY|MASK_68881),
-msoft-float removes the MASK_68881 flag.
{ "68020-40", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040), ""},
{ "68020-60", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040
|MASK_68060), "" },
These include MASK_68881 as well.
{ "68030", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY),
N_("Generate code for a 68030") },
{ "68030", (MASK_68020|MASK_BITFIELD), "" },
Oddly, this doesn't...
{ "68040", - (MASK_ALL_CF_BITS|MASK_68060),
N_("Generate code for a 68040") },
{ "68040", (MASK_68020|MASK_68881|MASK_BITFIELD
|MASK_68040_ONLY|MASK_68040), "" },
{ "68060", - (MASK_ALL_CF_BITS|MASK_68040),
{ "68060", (MASK_68020|MASK_68881|MASK_BITFIELD
|MASK_68040_ONLY|MASK_68060), "" },
... and these do :-)
+ if (TARGET_CPU32) \
+ { \
+ builtin_define_std ("mc68332"); \
+ builtin_define_std ("mcpu32"); \
+ } \
I believe that will also change the behaviour because TARGET_CPU32 is
"TARGET_68020 && !TARGET_BITFIELD" which you can also get without
specifying -mcpu32.
No, you can't:
{ { "68020", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY),
N_("Generate code for a 68020") },
{ "c68020", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY),
N_("Generate code for a 68020") },
{ "68020", (MASK_68020|MASK_BITFIELD), "" },
{ "c68020", (MASK_68020|MASK_BITFIELD), "" },
+ if (flag_pic) \
+ { \
+ builtin_define ("__PIC__"); \
+ builtin_define ("__pic__"); \
+ } \
Shouldn't these defined depending an the specific flag_pic value?
That's right, but I noticed all other back-ends just
define both symbols without caring at all... I thought
it was odd, but there has to be a reason.
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/
Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html