diff mbox

[AArch64] Add support for TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES hook.

Message ID 1354806586-9449-1-git-send-email-james.greenhalgh@arm.com
State New
Headers show

Commit Message

James Greenhalgh Dec. 6, 2012, 3:09 p.m. UTC
Hi,

This patch wires up TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES on
AArch64 to allow for 64-bit or 128-bit vectorization if the
preferred vector mode is not acceptable.

The patch has been regression tested on aarch64-none-elf with
no regressions.

Thanks,
James Greenhalgh

---
gcc/

2012-12-06  James Greenhalgh  <james.greenhalgh@arm.com>
	    Tejas Belagod  <tejas.belagod@arm.com>

	* config/aarch64/aarch64.c
	(aarch64_autovectorize_vector_sizes): New.
	(TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Define.

gcc/testsuite/

2012-12-06  James Greenhalgh  <james.greenhalgh@arm.com>
	    Tejas Belagod  <tejas.belagod@arm.com>

	* lib/target-supports.exp
	(check_effective_target_vect_multiple_sizes): Enable for AArch64.

Comments

James Greenhalgh Dec. 13, 2012, 11:21 a.m. UTC | #1
*ping*

Thanks,
James

> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of James Greenhalgh
> Sent: 06 December 2012 15:10
> To: gcc-patches@gcc.gnu.org
> Cc: Marcus Shawcroft
> Subject: [AArch64] Add support for
> TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES hook.
> 
> 
> Hi,
> 
> This patch wires up TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES on
> AArch64 to allow for 64-bit or 128-bit vectorization if the
> preferred vector mode is not acceptable.
> 
> The patch has been regression tested on aarch64-none-elf with
> no regressions.
> 
> Thanks,
> James Greenhalgh
> 
> ---
> gcc/
> 
> 2012-12-06  James Greenhalgh  <james.greenhalgh@arm.com>
> 	    Tejas Belagod  <tejas.belagod@arm.com>
> 
> 	* config/aarch64/aarch64.c
> 	(aarch64_autovectorize_vector_sizes): New.
> 	(TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Define.
> 
> gcc/testsuite/
> 
> 2012-12-06  James Greenhalgh  <james.greenhalgh@arm.com>
> 	    Tejas Belagod  <tejas.belagod@arm.com>
> 
> 	* lib/target-supports.exp
> 	(check_effective_target_vect_multiple_sizes): Enable for AArch64.
Marcus Shawcroft Dec. 13, 2012, 12:08 p.m. UTC | #2
On 06/12/12 15:09, James Greenhalgh wrote:
>
> Hi,
>
> This patch wires up TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES on
> AArch64 to allow for 64-bit or 128-bit vectorization if the
> preferred vector mode is not acceptable.
>
> The patch has been regression tested on aarch64-none-elf with
> no regressions.
>
> Thanks,
> James Greenhalgh
>
> ---
> gcc/
>
> 2012-12-06  James Greenhalgh  <james.greenhalgh@arm.com>
> 	    Tejas Belagod  <tejas.belagod@arm.com>
>
> 	* config/aarch64/aarch64.c
> 	(aarch64_autovectorize_vector_sizes): New.
> 	(TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Define.
>
> gcc/testsuite/
>
> 2012-12-06  James Greenhalgh  <james.greenhalgh@arm.com>
> 	    Tejas Belagod  <tejas.belagod@arm.com>
>
> 	* lib/target-supports.exp
> 	(check_effective_target_vect_multiple_sizes): Enable for AArch64.
>

OK
Thanks
/Marcus
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index f262ef9..02f888e 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -5861,6 +5861,14 @@  aarch64_preferred_simd_mode (enum machine_mode mode)
   return word_mode;
 }
 
+/* Return the bitmask of possible vector sizes for the vectorizer
+   to iterate over.  */
+static unsigned int
+aarch64_autovectorize_vector_sizes (void)
+{
+  return (16 | 8);
+}
+
 /* Return the equivalent letter for size.  */
 static unsigned char
 sizetochar (int size)
@@ -6853,6 +6861,10 @@  aarch64_c_mode_for_suffix (char suffix)
 #undef TARGET_VECTORIZE_PREFERRED_SIMD_MODE
 #define TARGET_VECTORIZE_PREFERRED_SIMD_MODE aarch64_preferred_simd_mode
 
+#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES
+#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES \
+  aarch64_autovectorize_vector_sizes
+
 /* Section anchor support.  */
 
 #undef TARGET_MIN_ANCHOR_OFFSET
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 5935346..5e53b72 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3842,7 +3842,8 @@  proc check_effective_target_vect_multiple_sizes { } {
     global et_vect_multiple_sizes_saved
 
     set et_vect_multiple_sizes_saved 0
-    if { ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
+    if { ([istarget aarch64*-*-*]
+	  || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok])) } {
        set et_vect_multiple_sizes_saved 1
     }
     if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {