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]

[PATCH][ARM][1/2] ARMv8 aarch32 round to integral instructions


Hi all,

This patch adds support for the vrint family of instructions in aarch32 (the
32-bit execution state in ARMv8).
These are rounding instructions that can be used to implement round to
integral functions from the math library such as:
trunc, ceil, round, floor, nearbyint, rint. This patch implements the single
and double precision variants of these functions.
There is only one pattern for them in the machine description because it
uses some new iterators to generate the correct variant for each function.

The tests for this are coming in a second patch soon.

These changes have been tested using AEM for the new functionality.
Also, no regressions when testing for ARMv7-a (for which these changes
should not have any effect) on qemu.

Ok for trunk?

Thanks,
Kyrill

gcc/ChangeLog

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

	* config/arm/arm.h (TARGET_FPU_ARMV8): New macro.
	* config/arm/arm.md (UNSPEC_VRINTZ, UNSPEC_VRINTP, UNSPEC_VRINTM,
	 UNSPEC_VRINTR, UNSPEC_VRINTX, UNSPEC_VRINTA): New unspecs.
	 (f_rints, f_rintd): New types.
	* config/arm/iterators.md (VRINT): New int iterator.
	 (F_fma_type): Remove.
	 (vfp_type): New mode attribute.
	 (vfp_double_cond): Likewise.
	 (vrint_pattern, vrint_variant, vrint_predicable): New int
attribute.
	* config/arm/vfp.md (fma<SDF:mode>4, *fmsub<SDF:mode>4,
	 *fnmsub<SDF:mode>4, *fnmadd<SDF:mode>4): Use vfp_type iterator
	 instead of F_fma_type.
	 (<VRINT:pattern><SDF:mode>2): New pattern.

Attachment: vrint_patches.txt
Description: Text document


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