From: ktkachov Date: Fri, 26 Feb 2016 15:59:45 +0000 (+0000) Subject: [AArch64] PR target/69613: Return zero TARGET_SHIFT_TRUNCATION_MASK when SHIFT_COUNT_... X-Git-Tag: upstream/6.1~876 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59c58860debb2ec97750c89ad7c4abef36c067a3;p=platform%2Fupstream%2Flinaro-gcc.git [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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233744 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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 + + PR target/69613 + * config/aarch64/aarch64.c (aarch64_shift_truncation_mask): + Return 0 if !SHIFT_COUNT_TRUNCATED. + 2016-02-26 Jakub Jelinek Eric Botcazou 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 + + PR target/69613 + * gcc.dg/torture/pr69613.c: New test. + 2016-02-26 Jakub Jelinek 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; +}