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] Add -meb to two Octeon tests


Adam Nemet <anemet@caviumnetworks.com> writes:
> There are two tests that fail when compiled for little-endian.
>
> octeon-exts-2.c is more obvious.  In this structure:
>
> struct bar 
> { 
>   unsigned long long a:1; 
>   long long b:14; 
>   unsigned long long c:48; 
>   long long d:1; 
> }; 
>
> when d is extracted, it is the bottom bit in big-endian but the top bit in
> little-endian.  If d is the top bit then signed extraction can be achieved
> equally well with a arithmetic right shift.

Since we're still supposed to be able to use this instruction for
_some_ code on little endian targets, I'd prefer that we either:

  (a) apply your patch but create an -mel-friendly version too.
  (b) reverse the order of the fields when _MIPSEL is defined.

The first is better really.  (I know it must seem daft having
-mel Octeon tests, but it isn't a rejected combination.)

> In octeon-bbit-3.c -- which is really endian-agnostic --- for both bit
> comparisons a different insn is generated by combine than what we have bbit
> patterns for:
>
> (if_then_else (ne (zero_extract:DI (subreg:DI (truncate:SI (reg:DI 196)) 0)
>                 (const_int 1)
>                 (const_int 0))
>             (const_int 0))
>         (label_ref 20)
>         (pc)))
>
> There is a pattern for this in our compiler but this is something the
> middle-end should be able to simplify.  I added this to my todo list.
>
> I would prefer changing this test to big-endian-only as well.  My intent was
> to guard us from regressing in this area and not to add tests that are known
> to fail.

That's fine, but please put something like the above in a comment.

Richard


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