This is the mail archive of the gcc-bugs@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]

[Bug c/56024] New: ARM NEON polynomial types behave as if signed


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).


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