i386.c (TARGET_INSTANTIATE_DECLS): New define.
authorUros Bizjak <uros@gcc.gnu.org>
Tue, 6 Nov 2012 16:00:35 +0000 (17:00 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 6 Nov 2012 16:00:35 +0000 (17:00 +0100)
* config/i386/i386.c (TARGET_INSTANTIATE_DECLS): New define.
(ix86_instantiate_decls): New function.
(ix86_expand_builtin) <case IX86_BUILTIN_LDMXCSR>: Use SLOT_TEMP
stack slot instead of SLOT_VIRTUAL.
<case IX86_BUILTIN_STMXCSR>: Ditto.
(assign_386_stack_local): Do not assert when virtual slot is valid.
* config/i386/i386.h (enum ix86_stack_slot): Remove SLOT_VIRTUAL.
* config/i386/i386.md (truncdfsf2): Do not use SLOT_VIRTUAL stack slot.
(truncxf<mode>2): Ditto.
(floatunssi<mode>2): Ditto.
(isinf<mode>2): Ditto.
* config/i386/sync.md (atomic_load<mode>): Ditto.
(atomic_store<mode>): Ditto.

From-SVN: r193244

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/config/i386/sync.md

index ad525d3..9dbc1fc 100644 (file)
@@ -1,3 +1,19 @@
+2012-11-06  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (TARGET_INSTANTIATE_DECLS): New define.
+       (ix86_instantiate_decls): New function.
+       (ix86_expand_builtin) <case IX86_BUILTIN_LDMXCSR>: Use SLOT_TEMP
+       stack slot instead of SLOT_VIRTUAL.
+       <case IX86_BUILTIN_STMXCSR>: Ditto.
+       (assign_386_stack_local): Do not assert when virtual slot is valid.
+       * config/i386/i386.h (enum ix86_stack_slot): Remove SLOT_VIRTUAL.
+       * config/i386/i386.md (truncdfsf2): Do not use SLOT_VIRTUAL stack slot.
+       (truncxf<mode>2): Ditto.
+       (floatunssi<mode>2): Ditto.
+       (isinf<mode>2): Ditto.
+       * config/i386/sync.md (atomic_load<mode>): Ditto.
+       (atomic_store<mode>): Ditto.
+
 2012-11-06  Jan Hubicka  <jh@suse.cz>
 
        * tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound,
 
 2012-11-06  Vladimir Yakovlev  <vladimir.b.yakovlev@intel.com>
 
-       * config/i386/i386-protos.h (emit_i387_cw_initialization): Deleted.
-       (emit_vzero): Added prototype.
+       * config/i386/i386-protos.h (emit_i387_cw_initialization): Delete.
+       (emit_vzero): Add prototype.
        (ix86_mode_entry): Likewise.
        (ix86_mode_exit): Likewise.
        (ix86_emit_mode_set): Likewise.
 
-       * config/i386/i386.c (typedef struct block_info_def): Deleted.
-       (define BLOCK_INFO): Deleted.
-       (check_avx256_stores): Added checking for MEM_P.
-       (move_or_delete_vzeroupper_2): Deleted.
-       (move_or_delete_vzeroupper_1): Deleted.
-       (move_or_delete_vzeroupper): Deleted.
-       (ix86_maybe_emit_epilogue_vzeroupper): Deleted.
-       (function_pass_avx256_p): Deleted.
-       (ix86_function_ok_for_sibcall): Deleted disabling sibcall.
-       (nit_cumulative_args): Deleted initialization of of avx256 fields of
+       * config/i386/i386.c (typedef struct block_info_def): Delete.
+       (define BLOCK_INFO): Delete.
+       (check_avx256_stores): Add checking for MEM_P.
+       (move_or_delete_vzeroupper_2): Delete.
+       (move_or_delete_vzeroupper_1): Delete.
+       (move_or_delete_vzeroupper): Delete.
+       (ix86_maybe_emit_epilogue_vzeroupper): Delete.
+       (function_pass_avx256_p): Delete.
+       (ix86_function_ok_for_sibcall): Remove sibcall disabling.
+       (nit_cumulative_args): Remove initialization of of avx256 fields of
        cfun->machine.
-       (ix86_emit_restore_sse_regs_using_mov): Deleted vzeroupper generation.
+       (ix86_emit_restore_sse_regs_using_mov): Remove vzeroupper generation.
        (ix86_expand_epilogue): Likewise.
        (ix86_avx_u128_mode_needed): New.
-       (ix86_i387_mode_needed): Renamed ix86_mode_needed.
+       (ix86_i387_mode_needed): Rename from ix86_mode_needed.
        (ix86_mode_needed): New.
        (ix86_avx_u128_mode_after): New.
        (ix86_mode_after): New.
        (ix86_avx_u128_mode_exit): New.
        (ix86_mode_exit): New.
        (ix86_emit_mode_set): New.
-       (ix86_expand_call): Deleted vzeroupper generation.
-       (ix86_split_call_vzeroupper): Deleted.
-       (ix86_init_machine_status): Initialzed optimize_mode_switching.
-       (ix86_expand_special_args_builtin): Changed.
-       (ix86_reorg): Deleted a call of move_or_delete_vzeroupper.
+       (ix86_expand_call): Delete vzeroupper generation.
+       (ix86_split_call_vzeroupper): Delete.
+       (ix86_init_machine_status): Initialize optimize_mode_switching.
+       (ix86_expand_special_args_builtin): Change.
+       (ix86_reorg): Delete a call of move_or_delete_vzeroupper.
 
        * config/i386/i386.h  (VALID_AVX256_REG_OR_OI_MODE): New.
        (AVX_U128): New.
        (MODE_AFTER): New.
        (MODE_ENTRY): New.
        (MODE_EXIT): New.
-       (EMIT_MODE_SET): Changed.
-       (machine_function): Deleted avx256 fields.
-
-       * config/i386/i386.md (UNSPEC_CALL_NEEDS_VZEROUPPER): Deleted.
-       (define_insn_and_split "*call_vzeroupper"): Deleted.
-       (define_insn_and_split "*call_rex64_ms_sysv_vzeroupper"): Deleted.
-       (define_insn_and_split "*sibcall_vzeroupper"): Deleted.
-       (define_insn_and_split "*call_pop_vzeroupper"): Deleted.
-       (define_insn_and_split "*sibcall_pop_vzeroupper"): Deleted.
-       (define_insn_and_split "*call_value_vzeroupper"): Deleted.
-       (define_insn_and_split "*sibcall_value_vzeroupper"): Deleted.
-       (define_insn_and_split "*call_value_rex64_ms_sysv_vzeroupper"): Deleted.
-       (define_insn_and_split "*call_value_pop_vzeroupper"): Deleted.
-       (define_insn_and_split "*sibcall_value_pop_vzeroupper"): Deleted.
-       (define_expand "return"): Deleted vzeroupper emitting.
-       (define_expand "simple_return"): Deleted.
+       (EMIT_MODE_SET): Change.
+       (machine_function): Delete avx256 fields.
+
+       * config/i386/i386.md (UNSPEC_CALL_NEEDS_VZEROUPPER): Delete.
+       (define_insn_and_split "*call_vzeroupper"): Delete.
+       (define_insn_and_split "*call_rex64_ms_sysv_vzeroupper"): Delete.
+       (define_insn_and_split "*sibcall_vzeroupper"): Delete.
+       (define_insn_and_split "*call_pop_vzeroupper"): Delete.
+       (define_insn_and_split "*sibcall_pop_vzeroupper"): Delete.
+       (define_insn_and_split "*call_value_vzeroupper"): Delete.
+       (define_insn_and_split "*sibcall_value_vzeroupper"): Delete.
+       (define_insn_and_split "*call_value_rex64_ms_sysv_vzeroupper"): Delete.
+       (define_insn_and_split "*call_value_pop_vzeroupper"): Delete.
+       (define_insn_and_split "*sibcall_value_pop_vzeroupper"): Delete.
+       (define_expand "return"): Remove vzeroupper emitting.
+       (define_expand "simple_return"): Delete.
 
        * config/i386/predicates.md (vzeroupper_operation): New.
 
-       * config/i386/sse.md (avx_vzeroupper): Changed.
+       * config/i386/sse.md (avx_vzeroupper): Change.
 
 2012-11-06  Uros Bizjak  <ubizjak@gmail.com>
            Kaz Kojima  <kkojima@gcc.gnu.org>
 
 2012-11-06  Andrey Turetskiy  <andrey.turetskiy@gmail.com>
 
-       * config/i386/i386.c (bdesc_args): Rename CODE_FOR_avx2_umulhrswv16hi3 to
-       CODE_FOR_avx2_pmulhrswv16hi3.
+       * config/i386/i386.c (bdesc_args): Rename CODE_FOR_avx2_umulhrswv16hi3
+       to CODE_FOR_avx2_pmulhrswv16hi3.
        * config/i386/predicates.md (const1_operand): Extend for vectors.
        * config/i386/sse.md (ssse3_avx2): Extend.
        (ssedoublemode): Ditto.
index d747a5a..ec40dd5 100644 (file)
@@ -23435,9 +23435,6 @@ assign_386_stack_local (enum machine_mode mode, enum ix86_stack_slot n)
 
   gcc_assert (n < MAX_386_STACK_LOCALS);
 
-  /* Virtual slot is valid only before vregs are instantiated.  */
-  gcc_assert ((n == SLOT_VIRTUAL) == !virtuals_instantiated);
-
   for (s = ix86_stack_locals; s; s = s->next)
     if (s->mode == mode && s->n == n)
       return validize_mem (copy_rtx (s->rtl));
@@ -23451,6 +23448,16 @@ assign_386_stack_local (enum machine_mode mode, enum ix86_stack_slot n)
   ix86_stack_locals = s;
   return validize_mem (s->rtl);
 }
+
+static void
+ix86_instantiate_decls (void)
+{
+  struct stack_local_entry *s;
+
+  for (s = ix86_stack_locals; s; s = s->next)
+    if (s->rtl != NULL_RTX)
+      instantiate_decl_rtl (s->rtl);
+}
 \f
 /* Calculate the length of the memory address in the instruction encoding.
    Includes addr32 prefix, does not include the one-byte modrm, opcode,
@@ -31235,13 +31242,13 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
 
     case IX86_BUILTIN_LDMXCSR:
       op0 = expand_normal (CALL_EXPR_ARG (exp, 0));
-      target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
+      target = assign_386_stack_local (SImode, SLOT_TEMP);
       emit_move_insn (target, op0);
       emit_insn (gen_sse_ldmxcsr (target));
       return 0;
 
     case IX86_BUILTIN_STMXCSR:
-      target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
+      target = assign_386_stack_local (SImode, SLOT_TEMP);
       emit_insn (gen_sse_stmxcsr (target));
       return copy_to_mode_reg (SImode, target);
 
@@ -42061,6 +42068,9 @@ ix86_memmodel_check (unsigned HOST_WIDE_INT val)
 #undef TARGET_MEMBER_TYPE_FORCES_BLK
 #define TARGET_MEMBER_TYPE_FORCES_BLK ix86_member_type_forces_blk
 
+#undef TARGET_INSTANTIATE_DECLS
+#define TARGET_INSTANTIATE_DECLS ix86_instantiate_decls
+
 #undef TARGET_SECONDARY_RELOAD
 #define TARGET_SECONDARY_RELOAD ix86_secondary_reload
 
index 67403c5..18d476d 100644 (file)
@@ -2154,8 +2154,7 @@ enum ix86_entity
 
 enum ix86_stack_slot
 {
-  SLOT_VIRTUAL = 0,
-  SLOT_TEMP,
+  SLOT_TEMP = 0,
   SLOT_CW_STORED,
   SLOT_CW_TRUNC,
   SLOT_CW_FLOOR,
index f2d2cd6..243ab4e 100644 (file)
     ;
   else
     {
-      enum ix86_stack_slot slot = (virtuals_instantiated
-                                  ? SLOT_TEMP
-                                  : SLOT_VIRTUAL);
-      rtx temp = assign_386_stack_local (SFmode, slot);
+      rtx temp = assign_386_stack_local (SFmode, SLOT_TEMP);
       emit_insn (gen_truncdfsf2_with_temp (operands[0], operands[1], temp));
       DONE;
     }
       DONE;
     }
   else
-    {
-      enum ix86_stack_slot slot = (virtuals_instantiated
-                                  ? SLOT_TEMP
-                                  : SLOT_VIRTUAL);
-      operands[2] = assign_386_stack_local (<MODE>mode, slot);
-    }
+    operands[2] = assign_386_stack_local (<MODE>mode, SLOT_TEMP);
 })
 
 (define_insn "*truncxfsf2_mixed"
       DONE;
     }
   else
-    {
-      enum ix86_stack_slot slot = (virtuals_instantiated
-                                  ? SLOT_TEMP
-                                  : SLOT_VIRTUAL);
-      operands[2] = assign_386_stack_local (DImode, slot);
-    }
+    operands[2] = assign_386_stack_local (DImode, SLOT_TEMP);
 })
 
 (define_expand "floatunsdisf2"
     emit_insn (gen_fxam<mode>2_i387_with_temp (scratch, operands[1]));
   else
     {
-      enum ix86_stack_slot slot = (virtuals_instantiated
-                                  ? SLOT_TEMP
-                                  : SLOT_VIRTUAL);
-      rtx temp = assign_386_stack_local (<MODE>mode, slot);
+      rtx temp = assign_386_stack_local (<MODE>mode, SLOT_TEMP);
 
       emit_move_insn (temp, operands[1]);
       emit_insn (gen_fxam<mode>2_i387_with_temp (scratch, temp));
index 44cb5d4..d855571 100644 (file)
   if (<MODE>mode == DImode && !TARGET_64BIT)
     emit_insn (gen_atomic_loaddi_fpu
               (operands[0], operands[1],
-               assign_386_stack_local (DImode,
-                                       (virtuals_instantiated
-                                        ? SLOT_TEMP : SLOT_VIRTUAL))));
+               assign_386_stack_local (DImode, SLOT_TEMP)));
   else
     emit_move_insn (operands[0], operands[1]);
   DONE;
         out to be significantly larger than this plus a barrier.  */
       emit_insn (gen_atomic_storedi_fpu
                 (operands[0], operands[1],
-                 assign_386_stack_local (DImode,
-                                         (virtuals_instantiated
-                                          ? SLOT_TEMP : SLOT_VIRTUAL))));
+                 assign_386_stack_local (DImode, SLOT_TEMP)));
     }
   else
     {