This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SuperH: -m4-nofpu flag
- To: gniibe at m17n dot org (NIIBE Yutaka)
- Subject: Re: SuperH: -m4-nofpu flag
- From: Toshi Morita <tm2 at best dot com>
- Date: Fri, 16 Feb 2001 15:29:34 -0800 (PST)
- Cc: gcc at gcc dot gnu dot org
> Alexandre Oliva wrote:
> > On Feb 15, 2001, NIIBE Yutaka <gniibe@m17n.org> wrote:
> >
> > > If we use sh-elf specs, this should be:
> > > ------------------
> > > #if defined(__SH4__) || defined(__SH4_NOFPU__)
> > || defined(__SH4_SINGLE_ONLY__) || defined(__SH4_SINGLE__)
>
> Yup.
>
> > It's a pity there's no macro defined for all SH4 variants. How about
> > defining __sh4__ on them all? Then __sh4__ would denote ``This is a
> > SH4 machine'', defined for all of -m4, -m4-single, -m4-single-only and
> > -m4-nofpu, whereas __SH4__ would denote ``This is a SH4 machine with
> > an single- and double-precision FPU, with double-precision assumed
> > enabled at function entry and exit''. Then, we wouldn't be changing
> > the meaning of any existing preprocessor macros (I'd rather not do it;
> > there may be people out there depending on it), yet it would be easy
> > to tell whether the target machine is a SuperH 4 or some earlier
> > machine.
>
> That's good idea. We will try this approach for the target sh-linux,
> Linux kernel and such. While we're doing that, I'd like to listen from
> sh-elf people.
>
> Thanks for your reply,
> --
I really hate the current approach. It's crufty and counterintuitive
and occasionally generate incorrect code because the target definitions
are so unclear.
It would be nice if the processor type could be cleanly separated
from the code generation attributes like this:
CPU families:
__SH1_FAMILY__
__SH2_FAMILY__
__SH3_FAMILY__
__SH4_FAMILY__
CPU attributes:
__SINGLE_ISSUE__
__DUAL_ISSUE_IOE__
__HAS_DELAYED_BRANCH__
__HAS_DSP__
__HAS_SFMODE_FPU__
__HAS_DFMODE_FPU__
So each processor would have definitions like this:
SH1: __SH1__ __SH1_FAMILY__ __SINGLE_ISSUE__
SH2: __SH2__ __SH2_FMAILY__ __SINGLE_ISSUE__ __HAS_DELAYED_BRANCH__
SH3: __SH3__ __SH3_FAMILY__ __SINGLE_ISSUE__ __HAS_DELAYED_BRANCH__
SH3E: __SH3E__ __SH3_FAMILY__ __SINGLE_ISSUE__ __HAS_DELAYED_BRANCH__
__HAS_SFMODE_FPU__
SH4 -mno-fpu: __SH4__ __SH4_FAMILY__ __DUAL_ISSUE_IOE__ __HAS_DELAYED_BRANCH__
SH4 -m4-single-only: __SH4__ __SH4_FAMILY__ __DUAL_ISSUE_IOE__
__HAS_DELAYED_BRANCH__ __HAS_SFMODE_FPU__
SH4 -m4/-m4-single: __SH4__ __SH4_FAMILY__ __DUAL_ISSUE_IOE__
__HAS_DELAYED_BRANCH__ __HAS_SFMODE_FPU__ __HAS_DFMODE_FPU__
...or something closely approximating this.
Toshi