This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/56024] New: ARM NEON polynomial types behave as if signed
- From: "Tim.Northover at arm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 Jan 2013 09:27:23 +0000
- Subject: [Bug c/56024] New: ARM NEON polynomial types behave as if signed
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56024
Bug #: 56024
Summary: ARM NEON polynomial types behave as if signed
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: Tim.Northover@arm.com
(Apologies for any broken conventions, this is my first GCC bug).
The ARM NEON intrinsic header arm_neon.h defines two scalar types poly8_t and
poly16_t. The existence of these types is at least implicit in the vget_lane
and vset_lane intrinsics. However on GCC they seem to be treated as "signed" in
some sense with extremely dodgy mathematical consequences. For example:
poly8_t p = 0x80;
poly16_t q = (poly16_t)p;
The polynomial "q" has the value 0xff80. This means that the cast has converted
the polynomial "x^7" into "x^15 + x^14 + ... + x^7".
This behaviour is also incompatible with the ARM compiler's implementation of
these types (they are typedefs from the obvious unsigned types there).