aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-08-15 08:57:29 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-08-15 08:57:29 +0000
commit07108a9ebe4776610bb23f684b3a346d28511bed (patch)
tree17a9c85ec343f419a5305da7288f58a2c25f8207 /gcc
parent2d2388f82f2e7f2fd1da063192ba98be45f099d2 (diff)
downloadgcc-07108a9ebe4776610bb23f684b3a346d28511bed.zip
gcc-07108a9ebe4776610bb23f684b3a346d28511bed.tar.gz
gcc-07108a9ebe4776610bb23f684b3a346d28511bed.tar.bz2
[AArch64] Fix predicate alignment for fixed-length SVE
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. 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. From-SVN: r274522
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/aarch64/aarch64.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 917278e..c5dbcf0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2019-08-15 Richard Sandiford <richard.sandiford@arm.com>
+ * config/aarch64/aarch64.c (aarch64_simd_vector_alignment): Return
+ 16 for SVE predicates even if they are fixed-length.
+
+2019-08-15 Richard Sandiford <richard.sandiford@arm.com>
+
* config/aarch64/aarch64-sve.md (and<PRED_ALL:mode>3): Make the
operand order match the MOV /Z alias.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index ca220b5..7779458 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -15915,11 +15915,13 @@ aarch64_simd_attr_length_rglist (machine_mode mode)
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 ();
}