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, middle end]: Fix PR 37908, thinko with atomic NAND operation


Lu, Hongjiu wrote:
Hi,

According to Dan, __sync_fetch_and_nand intrinsic should be implemented as ~(target & val). Uros's patch is correct.

At a minimum, it is incomplete. If one were to change the semantics of __sync_fetch_and_nand, they probably should do it universally rather than just for a subset of GCC's targets.


The MIPS port would have to be changed, and IIRC sparc as well.

David Daney



Thanks.


H.J.
hongjiu.lu@intel.com

-----Original Message-----
From: Andrew Haley [mailto:aph@redhat.com]
Sent: Friday, October 24, 2008 6:01 AM
To: Jakub Jelinek
Cc: Uros Bizjak; GCC Patches; Lu, Hongjiu
Subject: Re: [PATCH, middle end]: Fix PR 37908, thinko with atomic NAND
operation

Jakub Jelinek wrote:
On Fri, Oct 24, 2008 at 01:29:55PM +0100, Andrew Haley wrote:
I don't think it's that exactly, but that what the builtins do is
wrong, or at best very misleading.  NAND is a well-defined term of
the art; it isn't defined by the gcc documentation.
The name of the builtin may be misleading, but changing semantics of a
builtin after it has been in use for 9 years is even worse.  The origin
of the builtin is in ia64intrin.h and therefore icc, I guess, so
it matters what icc is implementing.
Indeed.  It's a wonder no-one commented at the time.  At least, I can't
remember anyone doing so.

FAOD, I'm certainly not suggesting that we should change anything except
perhaps to add a line or two to the documentation.

Andrew.



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