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], Add rounding built-ins to the _Float<N> and _Float<N>X built-in functions


Hi Mike,

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?

Do you really need to duplicate everything?  Other than that the generic
parts look fine to me (but someone else will have to approve it).

The rs6000 parts are okay for trunk.

Thanks,


Segher


> 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.


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