> Add the -mfsmuld option to control the generation of the FsMULd
> instruction.  In general, this instruction is available in architecture
> version V8 and V9 CPUs with FPU.  Some CPUs of this category do not
> support this instruction properly, e.g. AT697E, AT697F and UT699.  Some
> CPUs of this category do not implement it in hardware, e.g. LEON3/4 with
> GRFPU-lite.
> 
> gcc/
>       * config/sparc/sparc.c (dump_target_flag_bits): Dump MASK_FSMULD.
>       (sparc_option_override): Honour MASK_FSMULD.
>       * config/sparc/sparc.h (MASK_FEATURES): Add MASK_FSMULD.
>       * config/sparc/sparc.md (muldf3_extend): Use TARGET_FSMULD.
>       * config/sparc/sparc.opt (mfsmuld): New option.
>       * doc/invoke.texi (mfsmuld): Document option.

OK for mainline and 7 branch modulo:

> @@ -1511,6 +1513,11 @@ sparc_option_override (void)
>        target_flags |= MASK_LONG_DOUBLE_128;
>      }
> 
> +  /* Enable the FSMULD instruction by default if not explicitly configured
> by +     the user.  It may be later disabled by the CPU target flags or if
> +     !TARGET_FPU.  */
> +  target_flags |= MASK_FSMULD & ~target_flags_explicit;

I think that:

  if (!(target_flags_explicit & MASK_FSMULD))
    target_flags |= MASK_FSMULD;

is easier to grasp (and there is a precedent with MASK_LRA a few lines below).

>    /* Code model selection.  */
>    sparc_cmodel = SPARC_DEFAULT_CMODEL;
> 
> @@ -1603,11 +1610,11 @@ sparc_option_override (void)
>    if (TARGET_VIS4B)
>      target_flags |= MASK_VIS4 | MASK_VIS3 | MASK_VIS2 | MASK_VIS;
> 
> -  /* Don't allow -mvis, -mvis2, -mvis3, -mvis4, -mvis4b and -mfmaf if
> +  /* Don't allow -mvis, -mvis2, -mvis3, -mvis4, -mvis4b, -mfmaf and
> -mfsmuld if FPU is disabled.  */
>    if (! TARGET_FPU)
>      target_flags &= ~(MASK_VIS | MASK_VIS2 | MASK_VIS3 | MASK_VIS4
> -                   | MASK_VIS4B | MASK_FMAF);
> +                   | MASK_VIS4B | MASK_FMAF | MASK_FSMULD);
> 
>    /* -mvis assumes UltraSPARC+, so we are sure v9 instructions
>       are available; -m64 also implies v9.  */
> @@ -1641,6 +1648,9 @@ sparc_option_override (void)
>    if (sparc_fix_ut699 || sparc_fix_ut700 || sparc_fix_gr712rc)
>      sparc_fix_b2bst = 1;
> 
> +  if (sparc_fix_ut699)
> +    target_flags &= ~MASK_FSMULD;

Add a stupid comment line here, something like:

"Disable FsMULd for the UT699 since it doesn't work correctly."

-- 
Eric Botcazou

Reply via email to