From: Uros Bizjak <ubizjak@gmail.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH, i386 testsuite]: Cleanup gcc.target/i386/ for AVX targets a bit
Date: Wed, 04 May 2011 19:01:00 -0000 [thread overview]
Message-ID: <BANLkTinRxmiCUFoV__yic3JSQQH0QAntZA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 917 bytes --]
Hello!
This patch increases/decreases array sizes a bit to prevent loop
unrolling and adds appropriate -no-* ABI flags.
2011-05-04 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/recip-vec-divf.c: Decrease array sizes.
* gcc.target/i386/recip-vec-sqrtf.c: Ditto.
* gcc.target/i386/recip-vec-divf-avx.c: Increase array sizes.
* gcc.target/i386/recip-vec-sqrtf-avx.c: Ditto. Update scan times.
* gcc.target/i386/ssefn-1.c: Add -mno-sse2 to dg-options.
* gcc.target/i386/pr38824.c: Ditto.
* gcc.target/i386/vecinit-1.c: Add -mno-sse4 to dg-options.
* gcc.target/i386/vecinit-2.c: Ditto.
* gcc.target/i386/sse-19.c: Add -mno-ssse3 to dg-options.
* gcc.target/i386/parity-1.c: Add -mno-popcnt to dg-options.
* gcc.target/i386/parity-2.c: Ditto.
* gcc.target/i386/incoming-8.c: Add -mno-avx to dg-options.
Tested on x86_64-pc-linux-gnu {,-m32} AVX and non-AVX target,
committed to mainline SVN.
Uros.
[-- Attachment #2: t.diff.txt --]
[-- Type: text/plain, Size: 5992 bytes --]
Index: recip-vec-divf-avx.c
===================================================================
--- recip-vec-divf-avx.c (revision 173376)
+++ recip-vec-divf-avx.c (working copy)
@@ -1,15 +1,15 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx -mtune=generic -mfpmath=sse -mrecip" } */
-float a[16];
-float b[16];
-float r[16];
+float a[32];
+float b[32];
+float r[32];
void t1(void)
{
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 32; i++)
r[i] = a[i] / b[i];
}
Index: ssefn-1.c
===================================================================
--- ssefn-1.c (revision 173376)
+++ ssefn-1.c (working copy)
@@ -8,7 +8,7 @@
/* { dg-final { scan-assembler-not "movsd" } } */
/* { dg-final { scan-assembler-not "mulsd" } } */
/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
-/* { dg-options "-O2 -march=i386 -msse -mfpmath=sse -fno-inline" } */
+/* { dg-options "-O2 -march=i386 -msse -mno-sse2 -mfpmath=sse -fno-inline" } */
static float xs (void)
{
Index: parity-1.c
===================================================================
--- parity-1.c (revision 173376)
+++ parity-1.c (working copy)
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -march=k8" } */
+/* { dg-options "-O2 -march=k8 -mno-popcnt" } */
/* { dg-final { scan-assembler "setnp" } } */
int foo(unsigned int x)
Index: vecinit-2.c
===================================================================
--- vecinit-2.c (revision 173376)
+++ vecinit-2.c (working copy)
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -march=k8 -msse2" } */
+/* { dg-options "-O2 -march=k8 -msse2 -mno-sse4" } */
#define vector __attribute__((vector_size(16)))
Index: sse-19.c
===================================================================
--- sse-19.c (revision 173376)
+++ sse-19.c (working copy)
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=x86-64" } } */
-/* { dg-options "-O3 -march=x86-64 -msse2" } */
+/* { dg-options "-O3 -march=x86-64 -msse2 -mno-ssse3" } */
/* { dg-final { scan-assembler "punpcklbw" } } */
extern void abort();
#include <emmintrin.h>
Index: recip-vec-sqrtf.c
===================================================================
--- recip-vec-sqrtf.c (revision 173376)
+++ recip-vec-sqrtf.c (working copy)
@@ -1,9 +1,9 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */
-float a[16];
-float b[16];
-float r[16];
+float a[4];
+float b[4];
+float r[4];
extern float sqrtf (float);
@@ -11,7 +11,7 @@
{
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 4; i++)
r[i] = a[i] / sqrtf (b[i]);
}
@@ -19,7 +19,7 @@
{
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 4; i++)
r[i] = sqrtf (a[i] / b[i]);
}
@@ -27,7 +27,7 @@
{
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 4; i++)
r[i] = sqrtf (a[i]);
}
Index: vecinit-1.c
===================================================================
--- vecinit-1.c (revision 173376)
+++ vecinit-1.c (working copy)
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -march=k8 -msse2" } */
+/* { dg-options "-O2 -march=k8 -msse2 -mno-sse4" } */
#define vector __attribute__((vector_size(16)))
Index: pr38824.c
===================================================================
--- pr38824.c (revision 173376)
+++ pr38824.c (working copy)
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -msse" } */
+/* { dg-options "-O2 -msse -mno-sse2" } */
typedef float v4sf __attribute__ ((__vector_size__ (16)));
Index: parity-2.c
===================================================================
--- parity-2.c (revision 173376)
+++ parity-2.c (working copy)
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -march=k8" } */
+/* { dg-options "-O2 -march=k8 -mno-popcnt" } */
/* { dg-final { scan-assembler "setnp" } } */
int foo(unsigned long long int x)
Index: recip-vec-divf.c
===================================================================
--- recip-vec-divf.c (revision 173376)
+++ recip-vec-divf.c (working copy)
@@ -1,15 +1,15 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */
-float a[16];
-float b[16];
-float r[16];
+float a[4];
+float b[4];
+float r[4];
void t1(void)
{
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 4; i++)
r[i] = a[i] / b[i];
}
Index: recip-vec-sqrtf-avx.c
===================================================================
--- recip-vec-sqrtf-avx.c (revision 173376)
+++ recip-vec-sqrtf-avx.c (working copy)
@@ -1,9 +1,9 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx -mtune=generic -mfpmath=sse -mrecip" } */
-float a[16];
-float b[16];
-float r[16];
+float a[32];
+float b[32];
+float r[32];
extern float sqrtf (float);
@@ -11,7 +11,7 @@
{
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 32; i++)
r[i] = a[i] / sqrtf (b[i]);
}
@@ -19,7 +19,7 @@
{
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 32; i++)
r[i] = sqrtf (a[i] / b[i]);
}
@@ -27,9 +27,8 @@
{
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 32; i++)
r[i] = sqrtf (a[i]);
}
-/* Last loop is small enough to be fully unrolled. */
-/* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" 6 } } */
+/* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" 3 } } */
Index: incoming-8.c
===================================================================
--- incoming-8.c (revision 173376)
+++ incoming-8.c (working copy)
@@ -1,6 +1,6 @@
/* PR target/40838 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
-/* { dg-options "-w -mstackrealign -O3 -msse2 -mpreferred-stack-boundary=4" } */
+/* { dg-options "-w -mstackrealign -O3 -msse2 -mno-avx -mpreferred-stack-boundary=4" } */
float
foo (float f)
reply other threads:[~2011-05-04 18:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTinRxmiCUFoV__yic3JSQQH0QAntZA@mail.gmail.com \
--to=ubizjak@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).