diff options
author | J"orn Rennecke <joern.rennecke@superh.com> | 2002-07-03 09:49:46 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2002-07-03 10:49:46 +0100 |
commit | 34a80643d8c74d96786fa19eec8a39fc94ac10b4 (patch) | |
tree | 4e697d4885e1475c42eeedf76c38e9b4ccdff584 /gcc/c-typeck.c | |
parent | 032b2b29901082316175de7c7edb51c927ab06aa (diff) | |
download | gcc-34a80643d8c74d96786fa19eec8a39fc94ac10b4.zip gcc-34a80643d8c74d96786fa19eec8a39fc94ac10b4.tar.gz gcc-34a80643d8c74d96786fa19eec8a39fc94ac10b4.tar.bz2 |
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
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r-- | gcc/c-typeck.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index d26f877..0a70363 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -2071,6 +2071,8 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) case BIT_XOR_EXPR: if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) shorten = -1; + else if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) + common = 1; break; case TRUNC_MOD_EXPR: @@ -2778,7 +2780,12 @@ build_unary_op (code, xarg, flag) break; case BIT_NOT_EXPR: - if (typecode == COMPLEX_TYPE) + if (typecode == INTEGER_TYPE || typecode == VECTOR_TYPE) + { + if (!noconvert) + arg = default_conversion (arg); + } + else if (typecode == COMPLEX_TYPE) { code = CONJ_EXPR; if (pedantic) @@ -2786,13 +2793,11 @@ build_unary_op (code, xarg, flag) if (!noconvert) arg = default_conversion (arg); } - else if (typecode != INTEGER_TYPE) + else { error ("wrong type argument to bit-complement"); return error_mark_node; } - else if (!noconvert) - arg = default_conversion (arg); break; case ABS_EXPR: |