diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-04-12 21:37:21 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-04-12 21:37:21 +0200 |
commit | 6512fa6dc09a8de843d9d4921d9e8f717dec5a80 (patch) | |
tree | bca4d0d594bb17de510c93e22b980b91d0796409 /gcc | |
parent | 13bd7c2bc5c87fd1c9193203bcc750dfed740802 (diff) | |
download | gcc-6512fa6dc09a8de843d9d4921d9e8f717dec5a80.zip gcc-6512fa6dc09a8de843d9d4921d9e8f717dec5a80.tar.gz gcc-6512fa6dc09a8de843d9d4921d9e8f717dec5a80.tar.bz2 |
i386.c (ix86_simd_clone_compute_vecsize_and_simdlen): Bump the upper SIMDLEN limits...
* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
Bump the upper SIMDLEN limits, so that if the return type or
characteristic type if the return type is void can be passed in
all available SSE2/AVX/AVX2/AVX512-F registers, the SIMDLEN is
allowed.
* c-c++-common/cilk-plus/SE/ef_error2.c (func2): Use vectorlength
128 instead of 32.
From-SVN: r234913
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 39 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c | 4 |
4 files changed, 36 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d132dcf..949ab9e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-04-12 Jakub Jelinek <jakub@redhat.com> + + * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen): + Bump the upper SIMDLEN limits, so that if the return type or + characteristic type if the return type is void can be passed in + all available SSE2/AVX/AVX2/AVX512-F registers, the SIMDLEN is + allowed. + 2016-04-12 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/70680 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index acbecbd..1fa007e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -53761,7 +53761,7 @@ ix86_simd_clone_compute_vecsize_and_simdlen (struct cgraph_node *node, if (clonei->simdlen && (clonei->simdlen < 2 - || clonei->simdlen > 128 + || clonei->simdlen > 1024 || (clonei->simdlen & (clonei->simdlen - 1)) != 0)) { warning_at (DECL_SOURCE_LOCATION (node->decl), 0, @@ -53867,21 +53867,28 @@ ix86_simd_clone_compute_vecsize_and_simdlen (struct cgraph_node *node, clonei->simdlen /= GET_MODE_BITSIZE (TYPE_MODE (base_type)); } else if (clonei->simdlen > 16) - switch (clonei->vecsize_int) - { - case 512: - /* For AVX512-F, support VLEN up to 128. */ - break; - case 256: - /* For AVX2, support VLEN up to 32. */ - if (clonei->simdlen <= 32) - break; - /* FALLTHRU */ - default: - /* Otherwise, support VLEN up to 16. */ - warning_at (DECL_SOURCE_LOCATION (node->decl), 0, - "unsupported simdlen %d", clonei->simdlen); - return 0; + { + /* For compatibility with ICC, use the same upper bounds + for simdlen. In particular, for CTYPE below, use the return type, + unless the function returns void, in that case use the characteristic + type. If it is possible for given SIMDLEN to pass CTYPE value + in registers (8 [XYZ]MM* regs for 32-bit code, 16 [XYZ]MM* regs + for 64-bit code), accept that SIMDLEN, otherwise warn and don't + emit corresponding clone. */ + tree ctype = ret_type; + if (TREE_CODE (ret_type) == VOID_TYPE) + ctype = base_type; + int cnt = GET_MODE_BITSIZE (TYPE_MODE (ctype)) * clonei->simdlen; + if (SCALAR_INT_MODE_P (TYPE_MODE (ctype))) + cnt /= clonei->vecsize_int; + else + cnt /= clonei->vecsize_float; + if (cnt > (TARGET_64BIT ? 16 : 8)) + { + warning_at (DECL_SOURCE_LOCATION (node->decl), 0, + "unsupported simdlen %d", clonei->simdlen); + return 0; + } } return ret; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e4adde8..d7964de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-04-12 Jakub Jelinek <jakub@redhat.com> + * c-c++-common/cilk-plus/SE/ef_error2.c (func2): Use vectorlength + 128 instead of 32. + PR c++/70571 * g++.dg/ext/pr70571.C: New test. diff --git a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c b/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c index 518d640..89e0c39 100644 --- a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c +++ b/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c @@ -1,8 +1,8 @@ /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */ /* { dg-options "-fcilkplus -Wall" } */ -__attribute__((vector (vectorlength(32)))) -//#pragma omp simd simdlen (32) +__attribute__((vector (vectorlength(128)))) +//#pragma omp simd simdlen (128) int func2 (int x, int y) /* { dg-warning "unsupported simdlen" } */ { return (x+y); |