diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-13 13:25:09 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-13 13:25:09 +0000 |
commit | 690f1a75338622ca47f02ae4a503c75411dffb6b (patch) | |
tree | a8a16dc9bcef08e8adcbcecd5caf0f41f0e7d0dd /gcc/testsuite/gcc.target/sparc | |
parent | 61a98835eb32cb811714c00067d54d8fea078106 (diff) | |
download | gcc-690f1a75338622ca47f02ae4a503c75411dffb6b.tar.gz |
PR target/18230
* config/sparc/sparc.c (sparc_rtx_costs): Handle the NAND vector
patterns.
* config/sparc/sparc.md (V64I): New macro for 64-bit modes.
(V32I): New macro for 32-bit modes.
(anddi3, anddi_sp32, anddi_sp64, and_not_di_sp32, and_not_di_sp64,
iordi3, iordi3_sp32, iordi_sp64, or_not_di_sp32, or_not_di_sp64,
xordi3, xordi3_sp32, xordi3_sp64, {AND, IOR, XOR} DI splitter,
xor_not_di_sp32, xordi_not_di_sp64, one_cmpldi2, one_cmpldi_sp32,
one_cmpldi_sp64): Use V64I instead of DI.
(andsi3, andsi_sp32, andsi_sp64, and_not_si, iorsi3, or_not_si,
xorsi3, xor_not_si, one_cmplsi2): Use V32I instead of SI.
(addv2si3, addv4hi3, addv2hi3): Remove % modifier.
(nandv64i_vis, nandv32i_vis): New patterns.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90578 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/sparc')
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/combined-1.c | 31 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fand.c | 55 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fandnot.c | 96 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fandnots.c | 34 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fands.c | 22 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fnand.c | 48 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fnands.c | 33 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fnot.c | 56 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fnots.c | 20 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/for.c | 55 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fornot.c | 96 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fornots.c | 34 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fors.c | 22 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fxnor.c | 96 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fxnors.c | 34 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fxor.c | 55 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/fxors.c | 22 |
17 files changed, 809 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/sparc/combined-1.c b/gcc/testsuite/gcc.target/sparc/combined-1.c new file mode 100644 index 00000000000..5f19db3b0b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/combined-1.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +vec16 fun16(vec16 a, vec16 b) +{ + return (~a & b) + (b | a) - (a ^ b); +} + +vec32 fun32(vec32 a, vec32 b) +{ + return (~a & b) + (b | a) - (a ^ b); +} + +/* This should be transformed into ~b & a. */ +vec16 fun16b(vec16 a, vec16 b) +{ + return (a & ~b) + (b | a) - (a ^ b); +} + +vec32 fun32b(vec32 a, vec32 b) +{ + return (a & ~b) + (b | a) - (a ^ b); +} + +/* { dg-final { scan-assembler-times "fandnot1\t%" 4 } } */ +/* { dg-final { scan-assembler-times "for\t%" 4 } } */ +/* { dg-final { scan-assembler-times "fpadd" 4 } } */ +/* { dg-final { scan-assembler-times "fxor\t%" 4 } } */ +/* { dg-final { scan-assembler-times "fpsub" 4 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fand.c b/gcc/testsuite/gcc.target/sparc/fand.c new file mode 100644 index 00000000000..3194c921ccd --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fand.c @@ -0,0 +1,55 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(8))); +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return foo1_8 () & foo2_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2(vec8 a, vec8 b) +{ + return a & b; +} +#endif + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return foo1_16 () & foo2_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2(vec16 a, vec16 b) +{ + return a & b; +} +#endif + +extern vec32 foo1_32(void); +extern vec32 foo2_32(void); + +vec32 fun32(void) +{ + return foo1_32 () & foo2_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2(vec32 a, vec32 b) +{ + return a & b; +} +#endif + +/* { dg-final { scan-assembler-times "fand\t%" 3 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fandnot.c b/gcc/testsuite/gcc.target/sparc/fandnot.c new file mode 100644 index 00000000000..41db849c239 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fandnot.c @@ -0,0 +1,96 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(8))); +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return ~foo1_8 () & foo2_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2(vec8 a, vec8 b) +{ + return ~a & b; +} +#endif + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return ~foo1_16 () & foo2_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2(vec16 a, vec16 b) +{ + return ~a & b; +} +#endif + +extern vec32 foo1_32(void); +extern vec32 foo2_32(void); + +vec32 fun32(void) +{ + return ~foo1_32 () & foo2_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2(vec32 a, vec32 b) +{ + return ~a & b; +} +#endif + + +/* This should be transformed into ~b & a. */ +vec8 fun8b(void) +{ + return foo1_8 () & ~foo2_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2b(vec8 a, vec8 b) +{ + return a & ~b; +} +#endif + +vec16 fun16b(void) +{ + return foo1_16 () & ~foo2_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2b(vec16 a, vec16 b) +{ + return a & ~b; +} +#endif + +vec32 fun32b(void) +{ + return foo1_32 () & ~foo2_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2b(vec32 a, vec32 b) +{ + return a & ~b; +} +#endif + +/* { dg-final { scan-assembler-times "fandnot1\t%" 6 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fandnots.c b/gcc/testsuite/gcc.target/sparc/fandnots.c new file mode 100644 index 00000000000..7a5ed24148c --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fandnots.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(4))); +typedef short vec16 __attribute__((vector_size(4))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return ~foo1_8 () & foo2_8 (); +} + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return ~foo1_16 () & foo1_16 (); +} + + +/* This should be transformed into ~b & a. */ +vec8 fun8b(void) +{ + return foo1_8 () & ~foo2_8 (); +} + +vec16 fun16b(void) +{ + return foo1_16 () & ~foo1_16 (); +} + +/* { dg-final { scan-assembler-times "fandnot1s\t%" 4 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fands.c b/gcc/testsuite/gcc.target/sparc/fands.c new file mode 100644 index 00000000000..f924f4531de --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fands.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(4))); +typedef short vec16 __attribute__((vector_size(4))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return foo1_8 () & foo2_8 (); +} + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return foo1_16 () & foo1_16 (); +} + +/* { dg-final { scan-assembler-times "fands\t%" 2 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fnand.c b/gcc/testsuite/gcc.target/sparc/fnand.c new file mode 100644 index 00000000000..89fe8694df3 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fnand.c @@ -0,0 +1,48 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(8))); +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return ~(foo1_8 () & foo2_8 ()); +} + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return ~(foo1_16 () & foo2_16 ()); +} + +extern vec32 foo1_32(void); +extern vec32 foo2_32(void); + +vec32 fun32(void) +{ + return ~(foo1_32 () & foo2_32 ()); +} + + +/* DeMorgan's Law's at work. */ +vec8 fun8b(void) +{ + return ~foo1_8 () | ~foo2_8 (); +} + +vec16 fun16b(void) +{ + return ~foo1_16 () | ~foo2_16 (); +} + +vec32 fun32b(void) +{ + return ~foo1_32 () | ~foo2_32 (); +} + +/* { dg-final { scan-assembler-times "fnand\t%" 6 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fnands.c b/gcc/testsuite/gcc.target/sparc/fnands.c new file mode 100644 index 00000000000..05d6c4733cd --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fnands.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(4))); +typedef short vec16 __attribute__((vector_size(4))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return ~(foo1_8 () & foo2_8 ()); +} + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return ~(foo1_16 () & foo1_16 ()); +} + +/* DeMorgan's Law's at work. */ +vec8 fun8b(void) +{ + return ~foo1_8 () | ~foo2_8 (); +} + +vec16 fun16b(void) +{ + return ~foo1_16 () | ~foo1_16 (); +} + +/* { dg-final { scan-assembler-times "fnands\t%" 4 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fnot.c b/gcc/testsuite/gcc.target/sparc/fnot.c new file mode 100644 index 00000000000..e6f98d412a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fnot.c @@ -0,0 +1,56 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(8))); +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +extern vec8 foo1_8(void); +extern void foo2_8(vec8); + +vec8 fun8(void) +{ + return ~foo1_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2(vec8 a) +{ + foo2_8 (~a); +} +#endif + +extern vec16 foo1_16(void); +extern void foo2_16(vec8); + + +vec16 fun16(void) +{ + return ~foo1_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2(vec16 a) +{ + foo2_16 (~a); +} +#endif + +extern vec32 foo1_32(void); +extern void foo2_32(vec8); + +vec32 fun32(void) +{ + return ~foo1_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2(vec32 a) +{ + foo2_32 (~a); +} +#endif + +/* { dg-final { scan-assembler-times "fnot1\t%" 3 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fnots.c b/gcc/testsuite/gcc.target/sparc/fnots.c new file mode 100644 index 00000000000..f50eb0b3a6b --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fnots.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(4))); +typedef short vec16 __attribute__((vector_size(4))); + +extern vec8 foo1_8(void); + +vec8 fun8(void) +{ + return ~foo1_8 (); +} + +extern vec16 foo1_16(void); + +vec16 fun16(void) +{ + return ~foo1_16 (); +} + +/* { dg-final { scan-assembler-times "fnot1s\t%" 2 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/for.c b/gcc/testsuite/gcc.target/sparc/for.c new file mode 100644 index 00000000000..7348dce2035 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/for.c @@ -0,0 +1,55 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(8))); +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return foo1_8 () | foo2_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2(vec8 a, vec8 b) +{ + return a | b; +} +#endif + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return foo1_16 () | foo2_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2(vec16 a, vec16 b) +{ + return a | b; +} +#endif + +extern vec32 foo1_32(void); +extern vec32 foo2_32(void); + +vec32 fun32(void) +{ + return foo1_32 () | foo2_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2(vec32 a, vec32 b) +{ + return a | b; +} +#endif + +/* { dg-final { scan-assembler-times "for\t%" 3 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fornot.c b/gcc/testsuite/gcc.target/sparc/fornot.c new file mode 100644 index 00000000000..09fdb4f98f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fornot.c @@ -0,0 +1,96 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(8))); +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return ~foo1_8 () | foo2_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2(vec8 a, vec8 b) +{ + return ~a | b; +} +#endif + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return ~foo1_16 () | foo2_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2(vec16 a, vec16 b) +{ + return ~a | b; +} +#endif + +extern vec32 foo1_32(void); +extern vec32 foo2_32(void); + +vec32 fun32(void) +{ + return ~foo1_32 () | foo2_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2(vec32 a, vec32 b) +{ + return ~a | b; +} +#endif + + +/* This should be transformed into ~b | a. */ +vec8 fun8b(void) +{ + return foo1_8 () | ~foo2_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2b(vec8 a, vec8 b) +{ + return a | ~b; +} +#endif + +vec16 fun16b(void) +{ + return foo1_16 () | ~foo2_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2b(vec16 a, vec16 b) +{ + return a | ~b; +} +#endif + +vec32 fun32b(void) +{ + return foo1_32 () | ~foo2_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2b(vec32 a, vec32 b) +{ + return a | ~b; +} +#endif + +/* { dg-final { scan-assembler-times "fornot1\t%" 6 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fornots.c b/gcc/testsuite/gcc.target/sparc/fornots.c new file mode 100644 index 00000000000..db29a992636 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fornots.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(4))); +typedef short vec16 __attribute__((vector_size(4))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return ~foo1_8 () | foo2_8 (); +} + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return ~foo1_16 () | foo1_16 (); +} + + +/* This should be transformed into ~b | a. */ +vec8 fun8b(void) +{ + return foo1_8 () | ~foo2_8 (); +} + +vec16 fun16b(void) +{ + return foo1_16 () | ~foo1_16 (); +} + +/* { dg-final { scan-assembler-times "fornot1s\t%" 4 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fors.c b/gcc/testsuite/gcc.target/sparc/fors.c new file mode 100644 index 00000000000..0afdd4bbc65 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fors.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(4))); +typedef short vec16 __attribute__((vector_size(4))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return foo1_8 () | foo2_8 (); +} + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return foo1_16 () | foo1_16 (); +} + +/* { dg-final { scan-assembler-times "fors\t%" 2 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fxnor.c b/gcc/testsuite/gcc.target/sparc/fxnor.c new file mode 100644 index 00000000000..a685e08e04c --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fxnor.c @@ -0,0 +1,96 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(8))); +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return ~(foo1_8 () ^ foo2_8 ()); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2(vec8 a, vec8 b) +{ + return ~(a ^ b); +} +#endif + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return ~(foo1_16 () ^ foo2_16 ()); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2(vec16 a, vec16 b) +{ + return ~(a ^ b); +} +#endif + +extern vec32 foo1_32(void); +extern vec32 foo2_32(void); + +vec32 fun32(void) +{ + return ~(foo1_32 () ^ foo2_32 ()); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2(vec32 a, vec32 b) +{ + return ~(a ^ b); +} +#endif + + +/* This should be transformed into ~(b ^ a). */ +vec8 fun8b(void) +{ + return foo1_8 () ^ ~foo2_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2b(vec8 a, vec8 b) +{ + return a ^ ~b; +} +#endif + +vec16 fun16b(void) +{ + return foo1_16 () ^ ~foo2_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2b(vec16 a, vec16 b) +{ + return a ^ ~b; +} +#endif + +vec32 fun32b(void) +{ + return foo1_32 () ^ ~foo2_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2b(vec32 a, vec32 b) +{ + return a ^ ~b; +} +#endif + +/* { dg-final { scan-assembler-times "fxnor\t%" 6 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fxnors.c b/gcc/testsuite/gcc.target/sparc/fxnors.c new file mode 100644 index 00000000000..29775cffe3f --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fxnors.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(4))); +typedef short vec16 __attribute__((vector_size(4))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return ~(foo1_8 () ^ foo2_8 ()); +} + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return ~(foo1_16 () ^ foo1_16 ()); +} + + +/* This should be transformed into ~(b ^ a). */ +vec8 fun8b(void) +{ + return foo1_8 () ^ ~foo2_8 (); +} + +vec16 fun16b(void) +{ + return foo1_16 () ^ ~foo1_16 (); +} + +/* { dg-final { scan-assembler-times "fxnors\t%" 4 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fxor.c b/gcc/testsuite/gcc.target/sparc/fxor.c new file mode 100644 index 00000000000..581b37b54fb --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fxor.c @@ -0,0 +1,55 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(8))); +typedef short vec16 __attribute__((vector_size(8))); +typedef int vec32 __attribute__((vector_size(8))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return foo1_8 () ^ foo2_8 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec8 fun8_2(vec8 a, vec8 b) +{ + return a ^ b; +} +#endif + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return foo1_16 () ^ foo2_16 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec16 fun16_2(vec16 a, vec16 b) +{ + return a ^ b; +} +#endif + +extern vec32 foo1_32(void); +extern vec32 foo2_32(void); + +vec32 fun32(void) +{ + return foo1_32 () ^ foo2_32 (); +} + +#ifndef __LP64__ +/* Test the 32-bit splitter. */ +vec32 fun32_2(vec32 a, vec32 b) +{ + return a ^ b; +} +#endif + +/* { dg-final { scan-assembler-times "fxor\t%" 3 } } */ diff --git a/gcc/testsuite/gcc.target/sparc/fxors.c b/gcc/testsuite/gcc.target/sparc/fxors.c new file mode 100644 index 00000000000..5da017a28fe --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/fxors.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=ultrasparc -mvis" } */ +typedef char vec8 __attribute__((vector_size(4))); +typedef short vec16 __attribute__((vector_size(4))); + +extern vec8 foo1_8(void); +extern vec8 foo2_8(void); + +vec8 fun8(void) +{ + return foo1_8 () ^ foo2_8 (); +} + +extern vec16 foo1_16(void); +extern vec16 foo2_16(void); + +vec16 fun16(void) +{ + return foo1_16 () ^ foo1_16 (); +} + +/* { dg-final { scan-assembler-times "fxors\t%" 2 } } */ |