Michael Eager <[EMAIL PROTECTED]> writes:

> David Edelsohn wrote:
> >>>>>> Michael Eager writes:
> > Michael> I'm adding support to GCC for a different PPC floating
> > point unit.
> > Michael> It's similar to the standard PPC FPU in that it supports most of
> > Michael> the same instructions and all operation are in FP registers.
> > Michael> The FPU comes in a single-precision and double-precision variant.
> > Michael> There's also an option of having no FPU.
> > Michael> Rather than creating yet another configuration with another
> > Michael> TARGET_<whatever> definition and creating ever more cluttered
> > Michael> condition expression, I've thought to replace TARGET_FPRS with
> > Michael> TARGET_FPRS_SINGLE and TARGET_FPRS_DOUBLE.  These would both have
> > Michael> the value 1 for standard PPC, and 1 or 0 depending on whether the
> > Michael> single-or double-precision FPU was available, as specified by a new
> > Michael> option -mfpu=.  There would be some added instruction patterns
> > Michael> for the single-precision operations.
> >     I think you want to look at TARGET_HARD_FLOAT, not TARGET_FPRS.
> > TARGET_FPRS was added for Motorola e500 that has FP in GPRs.
> 
> TARGET_HARD_FLOAT means that you have hardware floating point of
> some kind.  I guess I could split this into TARGET_HARD_FLOAT_SINGLE
> and TARGET_HARD_FLOAT_DOUBLE.

The MIPS has TARGET_SINGLE_FLOAT and TARGET_DOUBLE_FLOAT.  Then it
does this:

(define_mode_macro ANYF [(SF "TARGET_HARD_FLOAT")
                         (DF "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT")
                         (V2SF "TARGET_PAIRED_SINGLE_FLOAT")])

and defines most of the floating point insns using ANYF, so that the
DF versions are only defined if TARGET_DOUBLE_FLOAT.

The command line options are -mhard-float, -msoft-float,
-msingle-float, -mdouble-float.  If -msoft-float is chosen,
-msingle-float and -mdouble-float are irrelevant.  If -mhard-float is
chosen, -mdouble-float is the default.  If -mhard-float and
-msingle-float are chosen, the single precision floating point
instructions are used but not the double precision floating point
instructions.

Ian

Reply via email to