OSDN Git Service

2011-09-08 Uros Bizjak <ubizjak@gmail.com>
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Sep 2011 18:24:04 +0000 (18:24 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Sep 2011 18:24:04 +0000 (18:24 +0000)
* config/i386/i386.c (standard_sse_constant_p): Handle AVX2 modes.
(standard_sse_constant_opcode) <case 2>: Change vpcmpeqd template.

testsuite/ChangeLog:

2011-09-08  Uros Bizjak  <ubizjak@gmail.com>

* gcc.target/i386/all_one_m256i.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178704 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/all_one_m256i.c [new file with mode: 0644]

index 349c15c..b3dc6bd 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-08  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (standard_sse_constant_p): Handle AVX2 modes.
+       (standard_sse_constant_opcode) <case 2>: Change vpcmpeqd template.
+
 2011-09-08  Bernd Schmidt  <bernds@codesourcery.com>
 
        * config/arm/arm.md (push_multi): Emit predicates.
 
        PR c++/33255 - Support -Wunused-local-typedefs warning
        * c-decl.c (lookup_name): Use the new maybe_record_typedef_use.
-       (pushdecl): Use the new
-       record_locally_defined_typedef.
-       (store_parm_decls): Allocate cfun->language.
-       (finish_function): Use the new maybe_warn_unused_local_typedefs,
-       and free cfun->language.
-       (c_push_function_context): Allocate cfun->language here only if
-       needed.
-       (c_pop_function_context): Likewise, mark cfun->language
-       for collection only when it should be done.
-       * c-common.c (handle_used_attribute): Don't ignore TYPE_DECL
-       nodes.
-       * c-typeck.c (c_expr_sizeof_type, c_cast_expr): Use the new
-       maybe_record_local_typedef_use.
+       (pushdecl): Use the new record_locally_defined_typedef.
+       (store_parm_decls): Allocate cfun->language.
+       (finish_function): Use the new maybe_warn_unused_local_typedefs,
+       and free cfun->language.
+       (c_push_function_context): Allocate cfun->language here only if needed.
+       (c_pop_function_context): Likewise, mark cfun->language
+       for collection only when it should be done.
+       * c-common.c (handle_used_attribute): Don't ignore TYPE_DECL nodes.
+       * c-typeck.c (c_expr_sizeof_type, c_cast_expr): Use the new
+       maybe_record_local_typedef_use.
        * doc/invoke.texi: Update documentation for
        -Wunused-local-typedefs.
 
@@ -78,8 +80,9 @@
 
 2011-09-08  Iain Sandoe  <iains@gcc.gnu.org>
 
-       *config/darwin-driver.c (darwin_find_version_from_kernel): New routine 
-       cut from ... (darwin_default_min_version): Amended to provide defaults
+       * config/darwin-driver.c (darwin_find_version_from_kernel): New routine
+       cut from ...
+       (darwin_default_min_version): Amended to provide defaults
        for the cross directory case.
        (darwin_driver_init): call darwin_default_min_version unconditionally.
        * config/darwin.h (DEF_MIN_OSX_VERSION): New.
        (merge_overlapping_regs): Use chain_from_id.  Assert that
        chains don't conflict with themselves.
        (rename_chains): Take no argument.  Iterate over id_to_chain
-       rather to find chains to rename.  Clear tick before the main
-       loop.
+       rather to find chains to rename.  Clear tick before the main loop.
        (struct incoming_reg_info): New struct.
        (struct bb_rename_info): New struct.
        (init_rename_info, set_incoming_from_chain, merge_chains): New
        * hooks.c (hook_int_uint_mode_1): Likewise.
 
        * config/i386/i386.h (ix86_tune_indices): Add
-       X86_TUNE_REASSOC_INT_TO_PARALLEL and
-       X86_TUNE_REASSOC_FP_TO_PARALLEL.
+       X86_TUNE_REASSOC_INT_TO_PARALLEL and X86_TUNE_REASSOC_FP_TO_PARALLEL.
 
        (TARGET_REASSOC_INT_TO_PARALLEL): New.
        (TARGET_REASSOC_FP_TO_PARALLEL): Likewise.
 
        * config/i386/i386.c (initial_ix86_tune_features): Add
-       X86_TUNE_REASSOC_INT_TO_PARALLEL and
-       X86_TUNE_REASSOC_FP_TO_PARALLEL.
+       X86_TUNE_REASSOC_INT_TO_PARALLEL and X86_TUNE_REASSOC_FP_TO_PARALLEL.
 
-       (ix86_reassociation_width) implementation of
-       new hook for i386 target.
+       (ix86_reassociation_width): New function.
 
        * params.def (PARAM_TREE_REASSOC_WIDTH): New param added.
 
        (swap_ops_for_binary_stmt): Likewise.
        (rewrite_expr_tree_parallel): Likewise.
 
-       (rewrite_expr_tree): Refactored. Part of code moved into
+       (rewrite_expr_tree): Refactored.  Part of code moved into
        swap_ops_for_binary_stmt.
 
-       (reassociate_bb): Now checks reassociation width to be used
-       and call rewrite_expr_tree_parallel instead of rewrite_expr_tree
-       if needed.
+       (reassociate_bb): Now checks reassociation width to be used and
+       call rewrite_expr_tree_parallel instead of rewrite_expr_tree if needed.
 
 2011-09-06  Richard Guenther  <rguenther@suse.de>
 
 
 2011-09-06  Richard Guenther  <rguenther@suse.de>
 
-       * tree-ssa-sccvn.c (visit_use): CSE stmt pieces and simplify
-       matching.
+       * tree-ssa-sccvn.c (visit_use): CSE stmt pieces and simplify matching.
 
 2011-09-06  Tom de Vries  <tom@codesourcery.com>
 
        * config/sparc/sparc.md: Add to "cpu" attribute.
        * config/sparc/sparc.h (TARGET_CPU_niagara3,
        TARGET_CPU_niagara4): New, treat as niagara2.
-       * config/sparc/linux64.h: Handle niagara3 and niagara4
-       like niagara2.
+       * config/sparc/linux64.h: Handle niagara3 and niagara4 like niagara2.
        * config/sparc/sol2.h: Likewise.
-       * config/sparc/niagara2.md: Schedule niagara3 like
-       niagara2.
+       * config/sparc/niagara2.md: Schedule niagara3 like niagara2.
        * config/sparc/sparc.c (sparc_option_override): Add
        niagara3 and niagara4 handling.
        (sparc32_initialize_trampoline): Likewise.
        * gimple-fold.c (fold_gimple_assign): Move COND_EXPR folding.
        * tree-object-size.c (cond_expr_object_size): Adjust.
        (collect_object_sizes_for): Likewise.
-       * tree-scalar-evolution.c (interpret_expr): Don't handle
-       ternary RHSs.
+       * tree-scalar-evolution.c (interpret_expr): Don't handle ternary RHSs.
        * tree-ssa-forwprop.c (forward_propagate_into_cond): Fix and simplify.
        (ssa_forward_propagate_and_combine): Adjust.
        * tree-ssa-loop-im.c (move_computations_stmt): Build the COND_EXPR
index 64deb77..171a480 100644 (file)
@@ -8176,7 +8176,7 @@ standard_80387_constant_rtx (int idx)
 }
 
 /* Return 1 if X is all 0s and 2 if x is all 1s
-   in supported SSE vector mode.  */
+   in supported SSE/AVX vector mode.  */
 
 int
 standard_sse_constant_p (rtx x)
@@ -8194,6 +8194,12 @@ standard_sse_constant_p (rtx x)
       case V2DImode:
        if (TARGET_SSE2)
          return 2;
+      case V32QImode:
+      case V16HImode:
+      case V8SImode:
+      case V4DImode:
+       if (TARGET_AVX2)
+         return 2;
       default:
        break;
       }
@@ -8235,7 +8241,8 @@ standard_sse_constant_opcode (rtx insn, rtx x)
        }
 
     case 2:
-      return "%vpcmpeqd\t%0, %d0";
+      return "%vpcmpeqd\t%0, %0, %0";
+
     default:
       break;
     }
index fcf62c7..3670296 100644 (file)
@@ -1,3 +1,7 @@
+2011-09-08  Uros Bizjak  <ubizjak@gmail.com>
+
+       * gcc.target/i386/all_one_m256i.c: New test.
+
 2011-09-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/50324
@@ -56,7 +60,7 @@
        PR middle-end/48571
        * gcc.c-torture/execute/pr48571-1.c (bar): Use offsets sizeof(int)
        instead of 4.
-       
+
 2011-09-07  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/50309
diff --git a/gcc/testsuite/gcc.target/i386/all_one_m256i.c b/gcc/testsuite/gcc.target/i386/all_one_m256i.c
new file mode 100644 (file)
index 0000000..1c3ca08
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx2" } */
+
+typedef long long __m256i __attribute__ ((__vector_size__ (32)));
+typedef int __v8si __attribute__ ((__vector_size__ (32)));
+
+__m256i foo ()
+{
+  __m256i minus_1 = (__m256i) (__v8si) { -1, -1, -1, -1, -1, -1, -1, -1 };
+
+  return minus_1;
+}
+
+/* { dg-final { scan-assembler "vpcmpeqd" } } */