From 34a80643d8c74d96786fa19eec8a39fc94ac10b4 Mon Sep 17 00:00:00 2001 From: "J\"orn Rennecke" Date: Wed, 3 Jul 2002 09:49:46 +0000 Subject: optabs.c (expand_vector_binop): Don't store using a SUBREG smaller than UNITS_PER_WORD... gcc: * optabs.c (expand_vector_binop): Don't store using a SUBREG smaller than UNITS_PER_WORD, unless this is little endian and the first unit in this word. Let extract_bit_field decide how to load an element. Force arguments to matching mode. (expand_vector_unop): Likewise. * simplify-rtx.c (simplify_subreg): Don't assume that all vectors consist of word_mode elements. * c-typeck.c (build_binary_op): Allow vector types for BIT_AND_EXPR, BIT_ANDTC_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR. (build_unary_op): Allow vector types for BIT_NOT_EPR. * emit-rtl.c (gen_lowpart_common): Use simplify_gen_subreg for CONST_VECTOR. * optabs.c (expand_vector_binop): Try to perform operation in smaller vector modes with same inner size. Add handling of AND, IOR and XOR. Reject expansion to inner-mode sized scalars when using OPTAB_DIRECT. Use simplify_gen_subreg on constants. (expand_vector_unop): Try to perform operation in smaller vector modes with same inner size. Add handling of one's complement. When there is no vector negate operation, try a vector subtract operation. Use simplify_gen_subreg on constants. * simplify-rtx.c (simplify_subreg): Add capability to convert vector constants into smaller vectors with same inner mode, and to integer CONST_DOUBLEs. gcc/testsuite: * gcc.c-torture/execute/simd-1.c (main): Also test &, |, ^, ~. * gcc.c-torture/execute/simd-2.c (main): Likewise. From-SVN: r55209 --- gcc/testsuite/gcc.c-torture/execute/simd-1.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gcc/testsuite/gcc.c-torture/execute/simd-1.c') diff --git a/gcc/testsuite/gcc.c-torture/execute/simd-1.c b/gcc/testsuite/gcc.c-torture/execute/simd-1.c index cb503e4..a93a619 100644 --- a/gcc/testsuite/gcc.c-torture/execute/simd-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/simd-1.c @@ -45,10 +45,29 @@ main () verify (res.i[0], res.i[1], res.i[2], res.i[3], 15, 7, 7, 6); + k = i & j; + res.v = k; + + verify (res.i[0], res.i[1], res.i[2], res.i[3], 2, 4, 20, 8); + + k = i | j; + res.v = k; + + verify (res.i[0], res.i[1], res.i[2], res.i[3], 158, 109, 150, 222); + + k = i ^ j; + res.v = k; + + verify (res.i[0], res.i[1], res.i[2], res.i[3], 156, 105, 130, 214); + k = -i; res.v = k; verify (res.i[0], res.i[1], res.i[2], res.i[3], -150, -100, -150, -200); + k = ~i; + res.v = k; + verify (res.i[0], res.i[1], res.i[2], res.i[3], -151, -101, -151, -201); + exit (0); } -- cgit v1.1