aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorArtjoms Sinkarovs <artyom.shinkaroff@gmail.com>2011-09-29 11:29:03 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-09-29 11:29:03 +0000
commitd246ab4f578b2e3369963386bafd66b26de8e63d (patch)
tree288524066a797ac20c1839c796218ffa83932145 /gcc/config
parent7c99ecef0b605466c522f4c170811761339dac16 (diff)
downloadgcc-d246ab4f578b2e3369963386bafd66b26de8e63d.zip
gcc-d246ab4f578b2e3369963386bafd66b26de8e63d.tar.gz
gcc-d246ab4f578b2e3369963386bafd66b26de8e63d.tar.bz2
expr.c (do_store_flag): Expand vector comparison by building an appropriate VEC_COND_EXPR.
2011-09-29 Artjoms Sinkarovs <artyom.shinkaroff@gmail.com> * expr.c (do_store_flag): Expand vector comparison by building an appropriate VEC_COND_EXPR. * c-typeck.c (build_binary_op): Typecheck vector comparisons. (c_objc_common_truthvalue_conversion): Adjust. * tree-vect-generic.c (do_compare): Helper function. (expand_vector_comparison): Check if hardware supports vector comparison of the given type or expand vector piecewise. (expand_vector_operation): Treat comparison as binary operation of vector type. (expand_vector_operations_1): Adjust. * gcc.c-torture/execute/vector-compare-1.c: New testcase. * gcc.c-torture/execute/vector-compare-2.c: Likewise. * gcc.dg/vector-compare-1.c: Likewise. * gcc.dg/vector-compare-2.c: Likewise. From-SVN: r179342
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 119dc9b..7e89dbd 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -18890,7 +18890,12 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false)
enum machine_mode mode = GET_MODE (dest);
rtx t2, t3, x;
- if (op_false == CONST0_RTX (mode))
+ if (vector_all_ones_operand (op_true, GET_MODE (op_true))
+ && rtx_equal_p (op_false, CONST0_RTX (mode)))
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, dest, cmp));
+ }
+ else if (op_false == CONST0_RTX (mode))
{
op_true = force_reg (mode, op_true);
x = gen_rtx_AND (mode, cmp, op_true);