On Fri, Oct 27, 2017 at 06:39:21PM -0400, Michael Meissner wrote:
> The power9 (running PowerPC ISA 3.0) has a round to integer instruction
> (XSRQPI) that does various flavors of round an IEEE 128-bit floating point to
> integeral values.  This patch adds the support to the machine independent
> portion of the compiler, and adds the necessary support for ceilf128,
> roundf128, truncf128, and roundf128 to the PowerPC backend when you use
> -mcpu=power9.
> 
> I have done bootstrap builds on both x86-64 and a little endian power8 system.
> Can I install these patches to the trunk?
> 
> [gcc]
> 2017-10-27  Michael Meissner  <meiss...@linux.vnet.ibm.com>
> 
>       * builtins.def: (_Float<N> and _Float<N>X BUILT_IN_CEIL): Add
>       _Float<N> and _Float<N>X variants for rounding built-in
>       functions.
>       (_Float<N> and _Float<N>X BUILT_IN_FLOOR): Likewise.
>       (_Float<N> and _Float<N>X BUILT_IN_NEARBYINT): Likewise.
>       (_Float<N> and _Float<N>X BUILT_IN_RINT): Likewise.
>       (_Float<N> and _Float<N>X BUILT_IN_ROUND): Likewise.
>       (_Float<N> and _Float<N>X BUILT_IN_TRUNC): Likewise.
>       * builtins.c (mathfn_built_in_2): Likewise.
>       * internal-fn.def (CEIL): Likewise.
>       (FLOOR): Likewise.
>       (NEARBYINT): Likewise.
>       (RINT): Likewise.
>       (ROUND): Likewise.
>       (TRUNC): Likewise.
>       * fold-const.c (tree_call_nonnegative_warnv_p): Likewise.
>       (integer_valued_real_call_p): Likewise.
>       * fold-const-call.c (fold_const_call_ss): Likewise.
>       * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
>       128-bit round to integer instructions.
>       (ceil<mode>2): Likewise.
>       (btrunc<mode>2): Likewise.
>       (round<mode>2): Likewise.
> 
> [gcc/c]
> 2017-10-27  Michael Meissner  <meiss...@linux.vnet.ibm.com>
> 
>       * c-decl.c (header_for_builtin_fn): Add integer rounding _Float<N>
>       and _Float<N>X built-in functions.
> 
> [gcc/testsuite]
> 2017-10-27  Michael Meissner  <meiss...@linux.vnet.ibm.com>
> 
>       * gcc.target/powerpc/float128-hw2.c: Add tests for ceilf128,
>       floorf128, truncf128, and roundf128.


Originally posted as:
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01421.html

I posted this in October and ping'ed it the first time in November.  Could a
global or gimple maintainer look at the patch and either approve it or tell me
what I need to do to improve it?  In theory it should be similar to my
previoius patch to add square root, fma, and absolute value _Float<N> and
_Float<N>X support to the infrastructure.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797

Reply via email to