This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][GCC][AArch64] Restrict lrint inlining on ILP32.
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Tamar Christina <Tamar dot Christina at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, "pinskia at gmail dot com" <pinskia at gmail dot com>
- Date: Tue, 24 Oct 2017 16:27:40 +0100
- Subject: Re: [PATCH][GCC][AArch64] Restrict lrint inlining on ILP32.
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- References: <20170913150021.GA23582@arm.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Wed, Sep 13, 2017 at 04:00:24PM +0100, Tamar Christina wrote:
> Hi All,
>
> The inlining of lrint isn't valid in all cases on ILP32 when
> -fno-math-errno is used because an inexact exception is raised in
> certain circumstances.
>
> Instead the restriction is placed such that the integer mode has to
> be larger or equal to the float mode in addition to either inexacts being
> allowed or not caring about trapping math.
>
> This prevents the overflow, and the inexact errors that may arise.
>
> Unfortunately I can't create a test for this as there is a bug where
> the pattern is always passed DI as the smallest mode,
> and later takes a sub-reg of it to SI. This would prevent an overflow
> where one was expected.
>
> This fixed PR/81800.
>
> Regtested on aarch64-none-linux-gnu and no regressions.
>
> Ok for trunk?
OK.
Reviewed By James Greenhalgh <james.greenhalgh@arm.com>
Thanks,
James
>
> Thanks,
>
> PR target/81800
> * config/aarch64/aarch64.md (lrint<GPF:mode><GPI:mode>2): Add flag_trapping_math
> and flag_fp_int_builtin_inexact.
>
> gcc/testsuite/
> 2017-09-13 Tamar Christina <tamar.christina@arm.com>
>
> * gcc.target/aarch64/inline-lrint_2.c (dg-options): Add -fno-trapping-math.
>
> --