public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed][AArch64] Fix predicate alignment for fixed-length SVE
@ 2019-08-15  9:01 Richard Sandiford
  0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2019-08-15  9:01 UTC (permalink / raw)
  To: gcc-patches

aarch64_simd_vector_alignment was only giving predicates 16-bit
alignment in VLA mode, not VLS mode.  I think the problem is latent
because we can't yet create an ABI predicate type, but it seemed worth
fixing in a standalone patch rather than as part of the main ACLE series.

The ACLE patches have tests for this.

Tested on aarch64-linux-gnu (with and without SVE) and aarch64_be-elf.
Applied as r274522.

Richard


2019-08-15  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64.c (aarch64_simd_vector_alignment): Return
	16 for SVE predicates even if they are fixed-length.

Index: gcc/config/aarch64/aarch64.c
===================================================================
--- gcc/config/aarch64/aarch64.c	2019-08-15 09:52:24.842110687 +0100
+++ gcc/config/aarch64/aarch64.c	2019-08-15 09:56:41.816215015 +0100
@@ -15915,11 +15915,13 @@ aarch64_simd_attr_length_rglist (machine
 static HOST_WIDE_INT
 aarch64_simd_vector_alignment (const_tree type)
 {
+  /* ??? Checking the mode isn't ideal, but VECTOR_BOOLEAN_TYPE_P can
+     be set for non-predicate vectors of booleans.  Modes are the most
+     direct way we have of identifying real SVE predicate types.  */
+  if (GET_MODE_CLASS (TYPE_MODE (type)) == MODE_VECTOR_BOOL)
+    return 16;
   if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
-    /* ??? Checking the mode isn't ideal, but VECTOR_BOOLEAN_TYPE_P can
-       be set for non-predicate vectors of booleans.  Modes are the most
-       direct way we have of identifying real SVE predicate types.  */
-    return GET_MODE_CLASS (TYPE_MODE (type)) == MODE_VECTOR_BOOL ? 16 : 128;
+    return 128;
   return wi::umin (wi::to_wide (TYPE_SIZE (type)), 128).to_uhwi ();
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-15  8:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15  9:01 [committed][AArch64] Fix predicate alignment for fixed-length SVE Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).