On 22 October 2014 10:56, Thomas Preud'homme <thomas.preudho...@arm.com> wrote:
>> From: Christophe Lyon [mailto:christophe.l...@linaro.org]
>> Sent: Tuesday, October 21, 2014 10:03 PM
>> > +typedef int SItype __attribute__ ((mode (SI)));
>> What's the purpose of this? It seems unused.
>
> Sigh. Bad copy/paste from optimize-bswapsi-1.c
>
> I'll add it to my patch for pr63259.
>
>
>> I believe this should be:
>> "checks that unknown byte markers are set correctly in case of cast"
>
> Indeed, there is a 's' missing for markers.
>
>>
>> > +
>> > +HItype
>> > +swap16 (HItype in)
>> > +{
>> > +  return (HItype) (((in >> 0) & 0xFF) << 8)
>> > +               | (((in >> 8) & 0xFF) << 0);
>> > +}
>> > +
>> >  /* { dg-final { scan-tree-dump-times "16 bit load in target endianness
>> found at" 3 "bswap" } } */
>> > -/* { dg-final { scan-tree-dump-times "16 bit bswap implementation
>> found at" 3 "bswap" { xfail alpha*-*-* arm*-*-* } } } */
>> > +/* { dg-final { scan-tree-dump-times "16 bit bswap implementation
>> found at" 1 "bswap" { target alpha*-*-* arm*-*-* } } } */
>>
>> This line fails when forcing the compiler to target -march=armv5t for
>> instance. I suspect this is because the check_effective_target_bswap
>> test is too permissive.
>
> Yep, it's likely to be the case. Feel to add a version check in it.
>
I tried to modify check_effective_target_bswap
and added:
+       } else {
+           if { [istarget arm*-*-*]
+                && [check_no_compiler_messages_nocache arm_v6_or_later object {
+                    #if __ARM_ARCH < 6
+                    #error not armv6 or later
+                    #endif
+                    int i;
+                } ""] } {
+               set et_bswap_saved 1
+           }
since the rev* instructions appeared in v6.

Regarding the testsuite, it moves the tests to UNSUPPORTED vs a mix of
PASS/FAIL/XFAIL
< UNSUPPORTED: gcc.dg/optimize-bswaphi-1.c
< UNSUPPORTED: gcc.dg/optimize-bswapsi-1.c
< UNSUPPORTED: gcc.dg/optimize-bswapsi-2.c
---
> PASS: gcc.dg/optimize-bswaphi-1.c (test for excess errors)
> FAIL: gcc.dg/optimize-bswaphi-1.c scan-tree-dump-times bswap "16 bit bswap 
> implementation found at" 1
> XFAIL: gcc.dg/optimize-bswaphi-1.c scan-tree-dump-times bswap "16 bit bswap 
> implementation found at" 4
> PASS: gcc.dg/optimize-bswaphi-1.c scan-tree-dump-times bswap "16 bit load in 
> target endianness found at" 3
> PASS: gcc.dg/optimize-bswapsi-1.c (test for excess errors)
> PASS: gcc.dg/optimize-bswapsi-1.c scan-tree-dump-times bswap "32 bit bswap 
> implementation found at" 4
> PASS: gcc.dg/optimize-bswapsi-2.c (test for excess errors)
> XFAIL: gcc.dg/optimize-bswapsi-2.c scan-tree-dump-times bswap "32 bit bswap 
> implementation found at" 3
> PASS: gcc.dg/optimize-bswapsi-2.c scan-tree-dump-times bswap "32 bit load in 
> target endianness found at" 3

The PASS seems not very informative, so it may not be a problem to
loose these few PASS/XFAIL.

We can also explicitly skip optimize-bswaphi-1 when ARM_ARCH < 6.

Not sure what's preferred?

Christophe.

> Thanks for the review.
>
> Best regards,
>
> Thomas
>
>
>
>

Reply via email to