From c501a38e3ac91a43e3fcd70b7b5dff116805389e Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 7 Nov 2012 13:15:59 +0100 Subject: [PATCH] i386.c (enum upper_128bits_state): Remove. * config/i386/i386.c (enum upper_128bits_state): Remove. (check_avx256_store): Use bool pointer argument. (ix86_avx_u128_mode_needed): Use note_stores also for CALL insns. * config/i386/predicates.md (vzeroupper_operation): Use match_test. From-SVN: r193294 --- gcc/ChangeLog | 22 +++++++----- gcc/config/i386/i386.c | 79 +++++++++++++++---------------------------- gcc/config/i386/predicates.md | 6 ++-- 3 files changed, 44 insertions(+), 63 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f90132..18f8c7e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-11-07 Uros Bizjak + + * config/i386/i386.c (enum upper_128bits_state): Remove. + (check_avx256_store): Use bool pointer argument. + (ix86_avx_u128_mode_needed): Use note_stores also for CALL insns. + * config/i386/predicates.md (vzeroupper_operation): Use match_test. + 2012-11-07 Yufeng Zhang * config/aarch64/aarch64.c (aarch64_expand_prologue): For the @@ -23,19 +30,18 @@ 2012-11-07 Jan Hubicka * ipa-inline-analysis.c (true_predicate, single_cond_predicate, - reset_inline_edge_summary): Fix - formatting. - (account_size_time): Bump up the limit on number of size/time entries to - 256. + reset_inline_edge_summary): Fix formatting. + (account_size_time): Bump up the limit on number of size/time + entries to 256. (estimate_function_body_sizes): Work in reverse postorder. 2012-11-07 David S. Miller PR bootstrap/55211 Revert: - * config/sparc/constraints.md ("U"): Delete. - * config/sparc/sparc.md: Use 'r' constraint instead of 'U'. - * config/sparc/sync.md: Likewise. + * config/sparc/constraints.md ("U"): Delete. + * config/sparc/sparc.md: Use 'r' constraint instead of 'U'. + * config/sparc/sync.md: Likewise. And revert parts of: * doc/md.texi: Sync sparc constraint documentation with reality. @@ -55,7 +61,7 @@ * dwarf2out.c (output_comdat_type_unit): Check for OBJECT_FORMAT_ELF. 2012-11-06 Aldy Hernandez - Richard Henderson + Richard Henderson * cfg-flags.def (TM_UNINSTRUMENTED, TM_ABORT): New. * trans-mem.c (PROB_VERY_LIKELY, PROB_UNLIKELY, PROB_LIKELY): New. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 934c761..2386017 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -65,27 +65,19 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "tree-flow.h" -enum upper_128bits_state -{ - unknown = 0, - unused, - used -}; - /* Check if a 256bit AVX register is referenced in stores. */ static void check_avx256_stores (rtx dest, const_rtx set, void *data) { - if (((REG_P (dest) || MEM_P(dest)) + if (((REG_P (dest) || MEM_P (dest)) && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (dest))) || (GET_CODE (set) == SET && (REG_P (SET_SRC (set)) || MEM_P (SET_SRC (set))) && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (SET_SRC (set))))) { - enum upper_128bits_state *state - = (enum upper_128bits_state *) data; - *state = used; + bool *used = (bool *) data; + *used = true; } } @@ -14967,23 +14959,24 @@ output_387_binary_op (rtx insn, rtx *operands) static int ix86_avx_u128_mode_needed (rtx insn) { - rtx pat = PATTERN (insn); - rtx arg; - enum upper_128bits_state state; + bool avx_u128_used; if (CALL_P (insn)) { + rtx link; + /* Needed mode is set to AVX_U128_CLEAN if there are no 256bit modes used in function arguments. */ - for (arg = CALL_INSN_FUNCTION_USAGE (insn); arg; - arg = XEXP (arg, 1)) + for (link = CALL_INSN_FUNCTION_USAGE (insn); + link; + link = XEXP (link, 1)) { - if (GET_CODE (XEXP (arg, 0)) == USE) + if (GET_CODE (XEXP (link, 0)) == USE) { - rtx reg = XEXP (XEXP (arg, 0), 0); + rtx arg = XEXP (XEXP (link, 0), 0); - if (reg && REG_P (reg) - && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (reg))) + if (REG_P (arg) + && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (arg))) return AVX_U128_ANY; } } @@ -14992,10 +14985,11 @@ ix86_avx_u128_mode_needed (rtx insn) } /* Check if a 256bit AVX register is referenced in stores. */ - state = unused; - note_stores (pat, check_avx256_stores, &state); - if (state == used) + avx_u128_used = false; + note_stores (PATTERN (insn), check_avx256_stores, &avx_u128_used); + if (avx_u128_used) return AVX_U128_DIRTY; + return AVX_U128_ANY; } @@ -15079,39 +15073,21 @@ static int ix86_avx_u128_mode_after (int mode, rtx insn) { rtx pat = PATTERN (insn); - rtx reg = NULL; - int i; - enum upper_128bits_state state; - - /* Check for CALL instruction. */ - if (CALL_P (insn)) - { - if (GET_CODE (pat) == SET) - reg = SET_DEST (pat); - else if (GET_CODE (pat) == PARALLEL) - for (i = XVECLEN (pat, 0) - 1; i >= 0; i--) - { - rtx x = XVECEXP (pat, 0, i); - if (GET_CODE(x) == SET) - reg = SET_DEST (x); - } - /* Mode after call is set to AVX_U128_DIRTY if there are - 256bit modes used in the function return register. */ - if (reg && REG_P (reg) && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (reg))) - return AVX_U128_DIRTY; - else - return AVX_U128_CLEAN; - } + bool avx_u128_used; if (vzeroupper_operation (pat, VOIDmode) || vzeroall_operation (pat, VOIDmode)) return AVX_U128_CLEAN; /* Check if a 256bit AVX register is referenced in stores. */ - state = unused; - note_stores (pat, check_avx256_stores, &state); - if (state == used) + avx_u128_used = false; + note_stores (pat, check_avx256_stores, &avx_u128_used); + if (avx_u128_used) return AVX_U128_DIRTY; + /* We know that state is clean after CALL insn if there are no + 256bit modes used in the function return register. */ + else if (CALL_P (insn)) + return AVX_U128_CLEAN; return mode; } @@ -15145,9 +15121,10 @@ ix86_avx_u128_mode_entry (void) for (arg = DECL_ARGUMENTS (current_function_decl); arg; arg = TREE_CHAIN (arg)) { - rtx reg = DECL_INCOMING_RTL (arg); + rtx incoming = DECL_INCOMING_RTL (arg); - if (reg && REG_P (reg) && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (reg))) + if (incoming && REG_P (incoming) + && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (incoming))) return AVX_U128_DIRTY; } diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index e108553..485fc63 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -1231,10 +1231,8 @@ ;; return true if OP is a vzeroupper operation. (define_predicate "vzeroupper_operation" - (match_code "unspec_volatile") -{ - return XINT (op, 1) == UNSPECV_VZEROUPPER; -}) + (and (match_code "unspec_volatile") + (match_test "XINT (op, 1) == UNSPECV_VZEROUPPER"))) ;; Return true if OP is a parallel for a vbroadcast permute. -- 2.7.4