diff mbox

[testsuite,AArch64,ARM] support bswap tests on aarch64_be

Message ID CAKdteObDZJp7m0G-dXOqLqDKvAa3=Qc+UewHhZw-o0=2p72_ww@mail.gmail.com
State New
Headers show

Commit Message

Christophe Lyon Oct. 29, 2014, 1:22 p.m. UTC
Hi,

Following discussions after Thomas's patches improving bswap support
https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01279.html

I noticed that:
* the associated tests weren't executed on aarch64_be
* ARM targets older than v6 do not support the needed instructions.

The attached patch changes check_effective_target_bswap():
- accept aarch64*-*-* instead of aarch64-*-*
- when target is arm*-*-*, check __ARM_ARCH >= 6

2014-10-29  Christophe Lyon  <christophe.lyon@linaro.org>

    * lib/target-supports.exp (check_effective_target_bswap): Update
    conditions for AArch64 and ARM targets.

OK?

Christophe.

Comments

Ramana Radhakrishnan Oct. 31, 2014, 5:15 p.m. UTC | #1
On Wed, Oct 29, 2014 at 1:22 PM, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
> Hi,
>
> Following discussions after Thomas's patches improving bswap support
> https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01279.html
>
> I noticed that:
> * the associated tests weren't executed on aarch64_be
> * ARM targets older than v6 do not support the needed instructions.
>
> The attached patch changes check_effective_target_bswap():
> - accept aarch64*-*-* instead of aarch64-*-*
> - when target is arm*-*-*, check __ARM_ARCH >= 6
>
> 2014-10-29  Christophe Lyon  <christophe.lyon@linaro.org>
>
>     * lib/target-supports.exp (check_effective_target_bswap): Update
>     conditions for AArch64 and ARM targets.
>
> OK?

The ARM (AArch32) changes are ok.

Ramana

>
> Christophe.
Christophe Lyon Nov. 5, 2014, 12:08 p.m. UTC | #2
On 31 October 2014 18:15, Ramana Radhakrishnan
<ramana.gcc@googlemail.com> wrote:
> On Wed, Oct 29, 2014 at 1:22 PM, Christophe Lyon
> <christophe.lyon@linaro.org> wrote:
>> Hi,
>>
>> Following discussions after Thomas's patches improving bswap support
>> https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01279.html
>>
>> I noticed that:
>> * the associated tests weren't executed on aarch64_be
>> * ARM targets older than v6 do not support the needed instructions.
>>
>> The attached patch changes check_effective_target_bswap():
>> - accept aarch64*-*-* instead of aarch64-*-*
>> - when target is arm*-*-*, check __ARM_ARCH >= 6
>>
>> 2014-10-29  Christophe Lyon  <christophe.lyon@linaro.org>
>>
>>     * lib/target-supports.exp (check_effective_target_bswap): Update
>>     conditions for AArch64 and ARM targets.
>>
>> OK?
>
> The ARM (AArch32) changes are ok.
>
> Ramana
>
Thank you Ramana.

Marcus, I believe the AArch64 part is obvious. OK?

Christophe.

>>
>> Christophe.
Marcus Shawcroft Nov. 5, 2014, 12:11 p.m. UTC | #3
On 5 November 2014 12:08, Christophe Lyon <christophe.lyon@linaro.org> wrote:
> On 31 October 2014 18:15, Ramana Radhakrishnan
> <ramana.gcc@googlemail.com> wrote:
>> On Wed, Oct 29, 2014 at 1:22 PM, Christophe Lyon
>> <christophe.lyon@linaro.org> wrote:
>>> Hi,
>>>
>>> Following discussions after Thomas's patches improving bswap support
>>> https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01279.html
>>>
>>> I noticed that:
>>> * the associated tests weren't executed on aarch64_be
>>> * ARM targets older than v6 do not support the needed instructions.
>>>
>>> The attached patch changes check_effective_target_bswap():
>>> - accept aarch64*-*-* instead of aarch64-*-*
>>> - when target is arm*-*-*, check __ARM_ARCH >= 6
>>>
>>> 2014-10-29  Christophe Lyon  <christophe.lyon@linaro.org>
>>>
>>>     * lib/target-supports.exp (check_effective_target_bswap): Update
>>>     conditions for AArch64 and ARM targets.
>>>
>>> OK?
>>
>> The ARM (AArch32) changes are ok.
>>
>> Ramana
>>
> Thank you Ramana.
>
> Marcus, I believe the AArch64 part is obvious. OK?

Yep, it looks obvious to me.  /Marcus
diff mbox

Patch

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 4398345..80ff52d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4892,9 +4892,8 @@  proc check_effective_target_bswap { } {
         verbose "check_effective_target_bswap: using cached result" 2
     } else {
 	set et_bswap_saved 0
-	if { [istarget aarch64-*-*]
+	if { [istarget aarch64*-*-*]
 	     || [istarget alpha*-*-*]
-	     || [istarget arm*-*-*]
 	     || [istarget i?86-*-*]
 	     || [istarget m68k-*-*]
 	     || [istarget powerpc*-*-*]
@@ -4902,6 +4901,16 @@  proc check_effective_target_bswap { } {
 	     || [istarget s390*-*-*]
 	     || [istarget x86_64-*-*] } {
 	    set et_bswap_saved 1
+	} 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
+	    }
 	}
     }