aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2016-02-26 15:59:45 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2016-02-26 15:59:45 +0000
commitac59ad4efc2f01ea4aaae648d59195616e3fa894 (patch)
tree35b93605bdf6ac75d8b97fb13a2d8d48cd442ea6 /gcc
parenta2ad54a07a7336103ff30140b591b4d6eb348dfd (diff)
downloadgcc-ac59ad4efc2f01ea4aaae648d59195616e3fa894.zip
gcc-ac59ad4efc2f01ea4aaae648d59195616e3fa894.tar.gz
gcc-ac59ad4efc2f01ea4aaae648d59195616e3fa894.tar.bz2
[AArch64] PR target/69613: Return zero TARGET_SHIFT_TRUNCATION_MASK when SHIFT_COUNT_TRUNCATED is false
PR target/69613 * config/aarch64/aarch64.c (aarch64_shift_truncation_mask): Return 0 if !SHIFT_COUNT_TRUNCATED. * gcc.dg/torture/pr69613.c: New test. From-SVN: r233744
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/aarch64/aarch64.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr69613.c40
4 files changed, 53 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 520275a..916c381 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/69613
+ * config/aarch64/aarch64.c (aarch64_shift_truncation_mask):
+ Return 0 if !SHIFT_COUNT_TRUNCATED.
+
2016-02-26 Jakub Jelinek <jakub@redhat.com>
Eric Botcazou <ebotcazou@adacore.com>
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 6dc8330..30d6f41 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -11154,7 +11154,8 @@ static unsigned HOST_WIDE_INT
aarch64_shift_truncation_mask (machine_mode mode)
{
return
- (aarch64_vector_mode_supported_p (mode)
+ (!SHIFT_COUNT_TRUNCATED
+ || aarch64_vector_mode_supported_p (mode)
|| aarch64_vect_struct_mode_p (mode)) ? 0 : (GET_MODE_BITSIZE (mode) - 1);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c03759f..d5b890d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/69613
+ * gcc.dg/torture/pr69613.c: New test.
+
2016-02-26 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/69891
diff --git a/gcc/testsuite/gcc.dg/torture/pr69613.c b/gcc/testsuite/gcc.dg/torture/pr69613.c
new file mode 100644
index 0000000..44f2b0c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr69613.c
@@ -0,0 +1,40 @@
+/* PR target/69613. */
+/* { dg-do run { target int128 } } */
+/* { dg-additional-options "-mavx" { target { i?86-*-* x86_64-*-* } } } */
+
+typedef unsigned short u16;
+typedef unsigned short v32u16 __attribute__ ((vector_size (32)));
+typedef unsigned int u32;
+typedef unsigned int v32u32 __attribute__ ((vector_size (32)));
+typedef unsigned long long u64;
+typedef unsigned long long v32u64 __attribute__ ((vector_size (32)));
+typedef unsigned __int128 u128;
+typedef unsigned __int128 v32u128 __attribute__ ((vector_size (32)));
+
+u128 __attribute__ ((noinline, noclone))
+foo (u32 u32_0, u64 u64_1, u128 u128_1, v32u16 v32u16_0, v32u128 v32u128_0,
+ v32u16 v32u16_1, v32u32 v32u32_1, v32u64 v32u64_1, v32u128 v32u128_1)
+{
+ u128 temp = (v32u128_1[0] << ((-u32_0) & 127));
+ u32 t2 = (u32_0 & 127);
+ v32u128_1[0] = (v32u128_1[0] >> t2);
+
+ v32u128_1[0] ^= temp;
+ v32u128_1 |= (v32u128){ v32u128_0[1] };
+
+ return u64_1 + u128_1 + v32u16_0[0] + v32u16_0[1] + v32u16_1[11]
+ + v32u16_1[12] + v32u16_1[13] + v32u32_1[0] + v32u32_1[1]
+ + v32u32_1[2] + v32u64_1[1] + v32u64_1[2] + v32u64_1[3] + v32u128_1[0]
+ + v32u128_1[1];
+}
+
+int
+main ()
+{
+ u128 x
+ = foo (1, 1, 1, (v32u16){ 1, 1, 1 }, (v32u128){ 1 }, (v32u16){ 1, 1, 1 },
+ (v32u32){ 1 }, (v32u64){ 1, 1, 1 }, (v32u128){ -1 });
+ if (x != 6)
+ __builtin_abort ();
+ return 0;
+}