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 version 2, rs6000] Add builtins to convert from float/double to int/long using current rounding mode


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


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