This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch AArch64] Add cpu_defines.h for AArch64.
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, Andrew Pinski <pinskia at gmail dot com>
- Cc: Ramana Radhakrishnan <ramana dot radhakrishnan at foss dot arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 21 May 2015 11:37:21 +0100
- Subject: Re: [Patch AArch64] Add cpu_defines.h for AArch64.
- Authentication-results: sourceware.org; auth=none
- References: <555B327F dot 3090107 at foss dot arm dot com> <4075D774-3A43-4507-B34E-DB505371E57D at gmail dot com> <CAJA7tRZujirL9zXbWEuKKfXub-ZTYijWxqnWQtpfOK263YQX5A at mail dot gmail dot com>
On 19/05/15 17:03, Ramana Radhakrishnan wrote:
> On Tue, May 19, 2015 at 4:54 PM, <pinskia@gmail.com> wrote:
>>> On May 19, 2015, at 5:54 AM, Ramana Radhakrishnan <ramana.radhakrishnan@foss.arm.com> wrote:
>>> Like the ARM port, the AArch64 ports needs to set glibc_integral_traps to false as integer divide instructions do not trap.
>>>
>>> Bootstrapped and regression tested on aarch64-none-linux-gnu
>>>
>>> Ok to apply ?
>>
>> Not really questioning your patch but questioning libstdc++'s defaults.
>> I wonder if this should be the default as most targets don't trap, only a few that does. And it should be safer default to say they don't trap too?
>
> How about we #error out if targets do *not* define some of these
> defaults in libstdc++ ?
__glibcxx_integral_traps seems to be used for the 'traps'
numeric_limits<T> member.
i think it can only be meaningful if LIA-1 is properly supported
(eg. div-by-zero is never optimized away) otherwise the standard
dictates UB and anything can happen. (Note that LIA-1 also requires
well-defined semantics for signed int overflow).
i don't see a way for conforming c++ code to use traps, or for
the library to guarantee either traps==true or traps==false on
any machine.