This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ping ^2 [PATCH], Add rounding built-ins to the _Float<N> and _Float<N>X built-in functions
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, Joseph Myers <joseph at codesourcery dot com>, Jakub Jelinek <jakub at redhat dot com>, Aldy Hernandez <aldyh at redhat dot com>, Jason Merrill <jason at redhat dot com>
- Date: Mon, 11 Dec 2017 16:19:57 -0500
- Subject: Re: Ping ^2 [PATCH], Add rounding built-ins to the _Float<N> and _Float<N>X built-in functions
- Authentication-results: sourceware.org; auth=none
- References: <20171027223921.GA29559@ibm-tiger.the-meissners.org>
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 <meissner@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 <meissner@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 <meissner@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: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797