This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] [SPARC] Add -mfsmuld option


On 26/07/17 10:13, Sebastian Huber wrote:

On 26/07/17 10:09, Eric Botcazou wrote:

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.
OK on principle, but could we avoid all this shuffling with MASK_FSMULD?
Having to write MASK_V8|MASK_FSMULD and MASK_V9|MASK_FSMULD is awkward.

What about automatically setting MASK_FSMULD if MASK_FPU is set and disabling it by default for v7, cypress and leon (i.e MASK_ISA|MASK_FSMULD for them)?

That was my first approach, however, this didn't work well. The -fno-fsmuld option didn't work here and was ignored. I guess this is due to the asymmetric handling of the enable/disable CPU target flags handling with respect to the target_flags_explicit:

  target_flags &= ~cpu->disable;
  target_flags |= (cpu->enable
#ifndef HAVE_AS_FMAF_HPC_VIS3
           & ~(MASK_FMAF | MASK_VIS3)
#endif
#ifndef HAVE_AS_SPARC4
           & ~MASK_CBCOND
#endif
#ifndef HAVE_AS_SPARC5_VIS4
           & ~(MASK_VIS4 | MASK_SUBXC)
#endif
#ifndef HAVE_AS_SPARC6
           & ~(MASK_VIS4B)
#endif
#ifndef HAVE_AS_LEON
           & ~(MASK_LEON | MASK_LEON3)
#endif
           & ~(target_flags_explicit & MASK_FEATURES)
           );


I will try it again using

target_flags |= MASK_FSMULD & ~target_flags_explicit;

before this block above.

If !TARGET_FPU, this flag is cleared later.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]