[PATCH version 2, rs6000] Add builtins to convert from float/double to int/long using current rounding mode

Segher Boessenkool segher@kernel.crashing.org
Tue Sep 12 16:49:00 GMT 2017


Hi Carl,

On Fri, Sep 08, 2017 at 11:41:13AM -0700, Carl Love wrote:
> The following patch adds support for a couple of requested builtins that
> convert from float/double to int / long using the current rounding
> mode.  I initially posted an early version of this patch which generated
> redundant instructions.  

> 2017-09-08  Carl Love  <cel@us.ibm.com>
> 
> 	* config/rs6000/rs6000-builtin.def (FCTID, FCTIW): Add BU_P7_MISC_1
> 	macro expansion for builtins.
> 	* config/rs6000/rs6000.md (fctid, fctiw): Add define_insn for the
> 	fctid and fctiw instructions.

There already is fctiwz_<mode> for SF, DF; how do these relate?  Could they
be joined?  Similar for lrint<mode>di2.

Or do we really want fcti* here instead of potentially the VSX equivalent?

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/builtin-fctid-fctiw-runnable.c
> @@ -0,0 +1,140 @@
> +/* { dg-do run { target { powerpc64*-*-* && { lp64 && p8vector_hw } } } } */

powerpc*-*-*


Segher



More information about the Gcc-patches mailing list