diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2014-09-03 15:53:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-03 15:54:00 +0000 |
commit | 54737a0f41ce0bf1e8f7f8d6d8e3170ef51e07c2 (patch) | |
tree | afd56565c7170158a14ce5c2fa2a1c8752cf5cb2 /gcc-4.9/gcc/testsuite | |
parent | ecf187208f8ec68c49823080179fa1b5f448a35d (diff) | |
parent | 55f9fbb03d0413cb8fe74e5ec5d6c2dd4280933e (diff) | |
download | toolchain_gcc-54737a0f41ce0bf1e8f7f8d6d8e3170ef51e07c2.zip toolchain_gcc-54737a0f41ce0bf1e8f7f8d6d8e3170ef51e07c2.tar.gz toolchain_gcc-54737a0f41ce0bf1e8f7f8d6d8e3170ef51e07c2.tar.bz2 |
Merge "[4.8, 4.9] Backport of additional SLM tuning."
Diffstat (limited to 'gcc-4.9/gcc/testsuite')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52252-ld.c | 30 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.target/i386/pr52252-atom.c | 29 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.target/i386/pr52252-core.c | 29 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.target/i386/pr61403.c | 27 |
4 files changed, 115 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52252-ld.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52252-ld.c new file mode 100644 index 0000000..6e3cb52 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52252-ld.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -g -ftree-vectorize -mssse3 -fdump-tree-vect-details" { target { i?86-*-* x86_64-*-* } } } */ + +#define byte unsigned char + +void +matrix_mul (byte *in, byte *out, int size) +{ + int i; + for (i = 0; i < size; i++) + { + byte in0 = in[0]; + byte in1 = in[1]; + byte in2 = in[2]; + byte out0, out1, out2, out3; + out0 = in0 + in1; + out1 = in0 + in2; + out2 = in1 + in2; + out3 = in0 + in1 + in2; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = out3; + in += 3; + out += 4; + } +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr52252-atom.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr52252-atom.c new file mode 100644 index 0000000..715b459 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr52252-atom.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ssse3 } */ +/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=slm" } */ +#define byte unsigned char + +void +matrix_mul (byte *in, byte *out, int size) +{ + int i; + for (i = 0; i < size; i++) + { + byte in0 = in[0]; + byte in1 = in[1]; + byte in2 = in[2]; + byte out0, out1, out2, out3; + out0 = in0 + in1; + out1 = in0 + in2; + out2 = in1 + in2; + out3 = in0 + in1 + in2; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = out3; + in += 3; + out += 4; + } +} + +/* { dg-final { scan-assembler "palignr" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr52252-core.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr52252-core.c new file mode 100644 index 0000000..ac857a5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr52252-core.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ssse3 } */ +/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=corei7" } */ +#define byte unsigned char + +void +matrix_mul (byte *in, byte *out, int size) +{ + int i; + for (i = 0; i < size; i++) + { + byte in0 = in[0]; + byte in1 = in[1]; + byte in2 = in[2]; + byte out0, out1, out2, out3; + out0 = in0 + in1; + out1 = in0 + in2; + out2 = in1 + in2; + out3 = in0 + in1 + in2; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = out3; + in += 3; + out += 4; + } +} + +/* { dg-final { scan-assembler "pshufb" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61403.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61403.c new file mode 100644 index 0000000..84cc5c5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61403.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse4.2 -mtune=corei7" } */ + +#include <math.h> + +struct XYZ +{ + float x; + float y; + float z; +}; + +void +norm (struct XYZ *in, struct XYZ *out, int size) +{ + int i; + for (i = 0; i < size; ++i) + { + float n = sqrt (in[i].x * in[i].x + in[i].y * in[i].y + in[i].z * in[i].z); + out[i].x = in[i].x / n; + out[i].y = in[i].y / n; + out[i].z = in[i].z / n; + } +} + +/* { dg-final { scan-assembler "blend" } } */ |