-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s390: Add LEN_LOAD/LEN_STORE support.
This patch adds LEN_LOAD/LEN_STORE support for z13 and newer. It defines a bias value of -1 and implements the LEN_LOAD and LEN_STORE optabs. Add vll/vstl testcases adapted from Power. Also change expectations for SLP testcases with more than one rgroup. gcc/ChangeLog: * config/s390/predicates.md (vll_bias_operand): Add -1 bias. * config/s390/s390.cc (s390_option_override_internal): Make partial vector usage the default from z13 on. * config/s390/vector.md (len_load_v16qi): Add. (len_store_v16qi): Add. gcc/testsuite/ChangeLog: * gcc.target/s390/s390.exp: Add partial subdirectory. * gcc.target/s390/vector/vec-nopeel-2.c: Change test expectation. * lib/target-supports.exp: Add s390. * gcc.target/s390/vector/partial/s390-vec-length-1.h: New test. * gcc.target/s390/vector/partial/s390-vec-length-2.h: New test. * gcc.target/s390/vector/partial/s390-vec-length-3.h: New test. * gcc.target/s390/vector/partial/s390-vec-length-7.h: New test. * gcc.target/s390/vector/partial/s390-vec-length-epil-1.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-epil-2.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-epil-3.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-epil-7.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-epil-run-1.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-epil-run-2.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-epil-run-3.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-epil-run-7.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-full-1.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-full-2.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-full-3.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-full-7.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-full-run-1.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-full-run-2.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-full-run-3.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-full-run-7.c: New test. * gcc.target/s390/vector/partial/s390-vec-length-run-1.h: New test. * gcc.target/s390/vector/partial/s390-vec-length-run-2.h: New test. * gcc.target/s390/vector/partial/s390-vec-length-run-3.h: New test. * gcc.target/s390/vector/partial/s390-vec-length-run-7.h: New test. * gcc.target/s390/vector/partial/s390-vec-length-small.c: New test. * gcc.target/s390/vector/partial/s390-vec-length.h: New test.
- Loading branch information
Showing
32 changed files
with
450 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-1.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "s390-vec-length.h" | ||
|
||
/* Test the case loop iteration is known. */ | ||
|
||
#define N 127 | ||
|
||
#define test(TYPE) \ | ||
extern TYPE a_##TYPE[N]; \ | ||
extern TYPE b_##TYPE[N]; \ | ||
extern TYPE c_##TYPE[N]; \ | ||
void __attribute__ ((noinline, noclone)) test##TYPE () \ | ||
{ \ | ||
unsigned int i = 0; \ | ||
for (i = 0; i < N; i++) \ | ||
c_##TYPE[i] = a_##TYPE[i] + b_##TYPE[i]; \ | ||
} | ||
|
||
TEST_ALL (test) |
18 changes: 18 additions & 0 deletions
18
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-2.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "s390-vec-length.h" | ||
|
||
/* Test the case loop iteration is unknown. */ | ||
|
||
#define N 255 | ||
|
||
#define test(TYPE) \ | ||
extern TYPE a_##TYPE[N]; \ | ||
extern TYPE b_##TYPE[N]; \ | ||
extern TYPE c_##TYPE[N]; \ | ||
void __attribute__ ((noinline, noclone)) test##TYPE (unsigned int n) \ | ||
{ \ | ||
unsigned int i = 0; \ | ||
for (i = 0; i < n; i++) \ | ||
c_##TYPE[i] = a_##TYPE[i] + b_##TYPE[i]; \ | ||
} | ||
|
||
TEST_ALL (test) |
31 changes: 31 additions & 0 deletions
31
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-3.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "s390-vec-length.h" | ||
|
||
/* Test the case loop iteration less than VF. */ | ||
|
||
/* For char. */ | ||
#define N_uint8_t 15 | ||
#define N_int8_t 15 | ||
/* For short. */ | ||
#define N_uint16_t 6 | ||
#define N_int16_t 6 | ||
/* For int/float. */ | ||
#define N_uint32_t 3 | ||
#define N_int32_t 3 | ||
#define N_float 3 | ||
/* For long/double. */ | ||
#define N_uint64_t 1 | ||
#define N_int64_t 1 | ||
#define N_double 1 | ||
|
||
#define test(TYPE) \ | ||
extern TYPE a_##TYPE[N_##TYPE]; \ | ||
extern TYPE b_##TYPE[N_##TYPE]; \ | ||
extern TYPE c_##TYPE[N_##TYPE]; \ | ||
void __attribute__ ((noinline, noclone)) test##TYPE () \ | ||
{ \ | ||
unsigned int i = 0; \ | ||
for (i = 0; i < N_##TYPE; i++) \ | ||
c_##TYPE[i] = a_##TYPE[i] + b_##TYPE[i]; \ | ||
} | ||
|
||
TEST_ALL (test) |
17 changes: 17 additions & 0 deletions
17
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-7.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "s390-vec-length.h" | ||
|
||
#define N 64 | ||
#define START 1 | ||
#define END 59 | ||
|
||
#define test(TYPE) \ | ||
TYPE x_##TYPE[N] __attribute__((aligned(16))); \ | ||
void __attribute__((noinline, noclone)) test_npeel_##TYPE() { \ | ||
TYPE v = 0; \ | ||
for (unsigned int i = START; i < END; i++) { \ | ||
x_##TYPE[i] = v; \ | ||
v += 1; \ | ||
} \ | ||
} | ||
|
||
TEST_ALL (test) |
13 changes: 13 additions & 0 deletions
13
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-epil-1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* { dg-do compile { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=1 --param=min-vect-loop-bound=0" } */ | ||
|
||
/* Test that we only vectorize the epilogue with vector load/store with length, | ||
the main body still uses normal vector load/store. */ | ||
|
||
#include "s390-vec-length-1.h" | ||
|
||
/* { dg-final { scan-assembler-times {\mvll\M} 14 } } */ | ||
/* { dg-final { scan-assembler-times {\mvstl\M} 7 } } */ | ||
|
13 changes: 13 additions & 0 deletions
13
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-epil-2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* { dg-do compile { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=1 --param=min-vect-loop-bound=0" } */ | ||
|
||
/* Test that we only vectorize the epilogue with vector load/store with length, | ||
the main body still uses normal vector load/store. */ | ||
|
||
#include "s390-vec-length-2.h" | ||
|
||
/* { dg-final { scan-assembler-times {\mvll\M} 20 } } */ | ||
/* { dg-final { scan-assembler-times {\mvstl\M} 10 } } */ | ||
|
16 changes: 16 additions & 0 deletions
16
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-epil-3.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* { dg-do compile { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=1 --param=min-vect-loop-bound=0" } */ | ||
|
||
/* Test that we only vectorize the epilogue with vector load/store with length, | ||
the main body still uses normal vector load/store. */ | ||
|
||
#include "s390-vec-length-3.h" | ||
|
||
/* { dg-final { scan-assembler-not {\mvl\M} } } */ | ||
/* { dg-final { scan-assembler-not {\mvst\M} } } */ | ||
/* 64bit types get completely unrolled, so only check the others. */ | ||
/* { dg-final { scan-assembler-times {\mvll\M} 14 } } */ | ||
/* { dg-final { scan-assembler-times {\mvstl\M} 7 } } */ | ||
|
11 changes: 11 additions & 0 deletions
11
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-epil-7.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* { dg-do compile { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -ffast-math -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=1 --param=min-vect-loop-bound=0" } */ | ||
|
||
/* Test that we only vectorize the epilogue with vector load/store with length, | ||
the main body still uses normal vector load/store. */ | ||
|
||
#include "s390-vec-length-7.h" | ||
|
||
/* { dg-final { scan-assembler-times {\mvstl\M} 4 } } */ |
7 changes: 7 additions & 0 deletions
7
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-epil-run-1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* { dg-do run { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */ | ||
|
||
#include "s390-vec-length-run-1.h" | ||
|
7 changes: 7 additions & 0 deletions
7
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-epil-run-2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* { dg-do run { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */ | ||
|
||
#include "s390-vec-length-run-2.h" | ||
|
7 changes: 7 additions & 0 deletions
7
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-epil-run-3.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* { dg-do run { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */ | ||
|
||
#include "s390-vec-length-run-3.h" | ||
|
7 changes: 7 additions & 0 deletions
7
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-epil-run-7.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* { dg-do run { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -ffast-math -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */ | ||
|
||
#include "s390-vec-length-run-7.h" | ||
|
12 changes: 12 additions & 0 deletions
12
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-full-1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* { dg-do compile { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */ | ||
|
||
/* Test that the loop body uses vector load/store with length, | ||
there should not be any epilogues. */ | ||
|
||
#include "s390-vec-length-1.h" | ||
|
||
/* { dg-final { scan-assembler-times {\mvll\M} 20 } } */ | ||
/* { dg-final { scan-assembler-times {\mvstl\M} 10 } } */ |
12 changes: 12 additions & 0 deletions
12
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-full-2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* { dg-do compile { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */ | ||
|
||
/* Test that the loop body uses vector load/store with length, | ||
there should not be any epilogues. */ | ||
|
||
#include "s390-vec-length-2.h" | ||
|
||
/* { dg-final { scan-assembler-times {\mvll\M} 20 } } */ | ||
/* { dg-final { scan-assembler-times {\mvstl\M} 10 } } */ |
13 changes: 13 additions & 0 deletions
13
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-full-3.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* { dg-do compile { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=2 --param=min-vect-loop-bound=0" } */ | ||
|
||
/* Test that the loop body uses vector load/store with length, | ||
there should not be any epilogues. */ | ||
|
||
#include "s390-vec-length-3.h" | ||
|
||
/* 64bit types get completely unrolled, so only check the others. */ | ||
/* { dg-final { scan-assembler-times {\mvll\M} 14 } } */ | ||
/* { dg-final { scan-assembler-times {\mvstl\M} 7 } } */ |
14 changes: 14 additions & 0 deletions
14
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-full-7.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* { dg-do compile { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-unroll-loops -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */ | ||
|
||
/* Test that the loop body uses vector load/store with length, | ||
there should not be any epilogues. */ | ||
|
||
#include "s390-vec-length-7.h" | ||
|
||
/* Each type should have one vstl but we do not currently vectorize the | ||
float and double variants and the [u]int64_t ones which do not require | ||
partial vectors. */ | ||
/* { dg-final { scan-assembler-times {\mvstl\M} 6 } } */ |
7 changes: 7 additions & 0 deletions
7
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-full-run-1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* { dg-do run { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */ | ||
|
||
#include "s390-vec-length-run-1.h" | ||
|
7 changes: 7 additions & 0 deletions
7
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-full-run-2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* { dg-do run { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */ | ||
|
||
#include "s390-vec-length-run-2.h" | ||
|
7 changes: 7 additions & 0 deletions
7
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-full-run-3.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* { dg-do run { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */ | ||
|
||
#include "s390-vec-length-run-3.h" | ||
|
7 changes: 7 additions & 0 deletions
7
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-full-run-7.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* { dg-do run { target { lp64 && s390_vx } } } */ | ||
/* { dg-options "-march=native -O2 -ftree-vectorize -fno-vect-cost-model -ffast-math -fno-trapping-math" } */ | ||
|
||
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */ | ||
|
||
#include "s390-vec-length-run-7.h" | ||
|
34 changes: 34 additions & 0 deletions
34
gcc/testsuite/gcc.target/s390/vector/partial/s390-vec-length-run-1.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "s390-vec-length-1.h" | ||
|
||
#define decl(TYPE) \ | ||
TYPE a_##TYPE[N]; \ | ||
TYPE b_##TYPE[N]; \ | ||
TYPE c_##TYPE[N]; | ||
|
||
#define run(TYPE) \ | ||
{ \ | ||
unsigned int i = 0; \ | ||
for (i = 0; i < N; i++) \ | ||
{ \ | ||
a_##TYPE[i] = i * 2 + 1; \ | ||
b_##TYPE[i] = i % 2 - 2; \ | ||
} \ | ||
test##TYPE (); \ | ||
for (i = 0; i < N; i++) \ | ||
{ \ | ||
TYPE a1 = i * 2 + 1; \ | ||
TYPE b1 = i % 2 - 2; \ | ||
TYPE exp_c = a1 + b1; \ | ||
if (c_##TYPE[i] != exp_c) \ | ||
__builtin_abort (); \ | ||
} \ | ||
} | ||
|
||
TEST_ALL (decl) | ||
|
||
int | ||
main (void) | ||
{ | ||
TEST_ALL (run) | ||
return 0; | ||
} |
Oops, something went wrong.