[PATCH][newlib][ARM] Add arm directory to libm, use vrint for standard rounding functions

Kyrylo Tkachov kyrylo.tkachov@arm.com
Mon Nov 19 17:18:00 GMT 2012

Hi all,

This patch adds ARM-specific support for the single and double precision
libm functions: ceil, floor, nearbyint, rint, round, trunk.
These functions can be implemented using the vrint family of instructions
introduced in ARMv8 so we use those when the target supports it, otherwise
we revert to the generic implementations.
If approved, can the commiter please generate/regenerate the appropriate
An arm directory is added to libm/machine. The following files need to be
generated with autoconf/automake:
* libm/machine/arm/Makefile.in
* libm/machine/arm/aclocal.m4
* libm/machine/arm/configure

The file
* libm/machine/configure needs to be regenerated.

The patch has been tested with an arm-eabi toolchain running on a model. It
is for the AArch32 / ARM backend of newlib.

P.S. I had sent this to a wrong address before... Sorry if you received this
multiple times.


2012-11-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* configure.host: Define libm_machine_dir value for arm.
	* libm/machine/configure.in: Add arm to libm machines list.
	* libm/machine/configure: Regenerate.
	* libm/machine/arm/Makefile.am: New file.
	* libm/machine/arm/Makefile.in: Generated.
	* libm/machine/arm/aclocal.m4: Generated.
	* libm/machine/arm/configure: Generated.
	* libm/machine/arm/configure.in: New file.
	* libm/machine/arm/s_ceil.c: Likewise.
	* libm/machine/arm/s_floor.c: Likewise.
	* libm/machine/arm/s_nearbyint.c: Likewise.
	* libm/machine/arm/s_rint.c: Likewise.
	* libm/machine/arm/s_round.c: Likewise.
	* libm/machine/arm/s_trunc.c: Likewise.
	* libm/machine/arm/sf_ceil.c: Likewise.
	* libm/machine/arm/sf_floor.c: Likewise.
	* libm/machine/arm/sf_nearbyint.c: Likewise.
	* libm/machine/arm/sf_rint.c: Likewise.
	* libm/machine/arm/sf_round.c: Likewise.
	* libm/machine/arm/sf_trunc.c: Likewise.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: newlib_vrint2.txt
URL: <http://sourceware.org/pipermail/newlib/attachments/20121119/c054e49b/attachment.txt>

More information about the Newlib mailing list