Mercurial > hg > CbC > CbC_gcc
diff gcc/config/i386/predicates.md @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/config/i386/predicates.md Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/config/i386/predicates.md Thu Oct 25 07:37:49 2018 +0900 @@ -1,5 +1,5 @@ ;; Predicate definitions for IA-32 and x86-64. -;; Copyright (C) 2004-2017 Free Software Foundation, Inc. +;; Copyright (C) 2004-2018 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -600,7 +600,8 @@ (define_predicate "constant_call_address_operand" (match_code "symbol_ref") { - if (ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC) + if (ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC + || flag_force_indirect_call) return false; if (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op)) return false; @@ -664,7 +665,8 @@ ;; Test for a valid operand for indirect branch. (define_predicate "indirect_branch_operand" (ior (match_operand 0 "register_operand") - (and (not (match_test "TARGET_X32")) + (and (not (match_test "TARGET_INDIRECT_BRANCH_REGISTER")) + (not (match_test "TARGET_X32")) (match_operand 0 "memory_operand")))) ;; Return true if OP is a memory operands that can be used in sibcalls. @@ -707,20 +709,22 @@ (ior (match_test "constant_call_address_operand (op, mode == VOIDmode ? mode : Pmode)") (match_operand 0 "call_register_no_elim_operand") - (ior (and (not (match_test "TARGET_X32")) - (match_operand 0 "memory_operand")) - (and (match_test "TARGET_X32 && Pmode == DImode") - (match_operand 0 "GOT_memory_operand"))))) + (and (not (match_test "TARGET_INDIRECT_BRANCH_REGISTER")) + (ior (and (not (match_test "TARGET_X32")) + (match_operand 0 "memory_operand")) + (and (match_test "TARGET_X32 && Pmode == DImode") + (match_operand 0 "GOT_memory_operand")))))) ;; Similarly, but for tail calls, in which we cannot allow memory references. (define_special_predicate "sibcall_insn_operand" (ior (match_test "constant_call_address_operand (op, mode == VOIDmode ? mode : Pmode)") (match_operand 0 "register_no_elim_operand") - (ior (and (not (match_test "TARGET_X32")) - (match_operand 0 "sibcall_memory_operand")) - (and (match_test "TARGET_X32 && Pmode == DImode") - (match_operand 0 "GOT_memory_operand"))))) + (and (not (match_test "TARGET_INDIRECT_BRANCH_REGISTER")) + (ior (and (not (match_test "TARGET_X32")) + (match_operand 0 "sibcall_memory_operand")) + (and (match_test "TARGET_X32 && Pmode == DImode") + (match_operand 0 "GOT_memory_operand")))))) ;; Return true if OP is a 32-bit GOT symbol operand. (define_predicate "GOT32_symbol_operand" @@ -1004,9 +1008,9 @@ (match_code "mem") { unsigned n_elts; - op = maybe_get_pool_constant (op); + op = avoid_constant_pool_reference (op); - if (!(op && GET_CODE (op) == CONST_VECTOR)) + if (GET_CODE (op) != CONST_VECTOR) return false; n_elts = CONST_VECTOR_NUNITS (op); @@ -1038,11 +1042,6 @@ (ior (match_operand 0 "register_operand") (match_operand 0 "vector_memory_operand"))) -; Return true when OP is operand acceptable for standard SSE move. -(define_predicate "vector_move_operand" - (ior (match_operand 0 "nonimmediate_operand") - (match_operand 0 "const0_operand"))) - ;; Return true when OP is either nonimmediate operand, or any ;; CONST_VECTOR. (define_predicate "nonimmediate_or_const_vector_operand" @@ -1059,6 +1058,11 @@ (ior (match_operand 0 "register_operand") (match_operand 0 "const0_operand"))) +; Return true when OP is a nonimmediate or zero. +(define_predicate "nonimm_or_0_operand" + (ior (match_operand 0 "nonimmediate_operand") + (match_operand 0 "const0_operand"))) + (define_predicate "norex_memory_operand" (and (match_operand 0 "memory_operand") (not (match_test "x86_extended_reg_mentioned_p (op)")))) @@ -1128,74 +1132,9 @@ return true; }) -;; Return true if op is valid MPX address operand without base -(define_predicate "address_mpx_no_base_operand" - (match_test "address_operand (op, VOIDmode)") -{ - struct ix86_address parts; - int ok; - - ok = ix86_decompose_address (op, &parts); - gcc_assert (ok); - - if (parts.index && parts.base) - return false; - - if (parts.seg != ADDR_SPACE_GENERIC) - return false; - - /* Do not support (%rip). */ - if (parts.disp && flag_pic && TARGET_64BIT - && SYMBOLIC_CONST (parts.disp)) - { - if (GET_CODE (parts.disp) != CONST - || GET_CODE (XEXP (parts.disp, 0)) != PLUS - || GET_CODE (XEXP (XEXP (parts.disp, 0), 0)) != UNSPEC - || !CONST_INT_P (XEXP (XEXP (parts.disp, 0), 1)) - || (XINT (XEXP (XEXP (parts.disp, 0), 0), 1) != UNSPEC_DTPOFF - && XINT (XEXP (XEXP (parts.disp, 0), 0), 1) != UNSPEC_NTPOFF)) - return false; - } - - return true; -}) - -;; Return true if op is valid MPX address operand without index -(define_predicate "address_mpx_no_index_operand" - (match_test "address_operand (op, VOIDmode)") -{ - struct ix86_address parts; - int ok; - - ok = ix86_decompose_address (op, &parts); - gcc_assert (ok); - - if (parts.index) - return false; - - if (parts.seg != ADDR_SPACE_GENERIC) - return false; - - /* Do not support (%rip). */ - if (parts.disp && flag_pic && TARGET_64BIT - && SYMBOLIC_CONST (parts.disp) - && (GET_CODE (parts.disp) != CONST - || GET_CODE (XEXP (parts.disp, 0)) != PLUS - || GET_CODE (XEXP (XEXP (parts.disp, 0), 0)) != UNSPEC - || !CONST_INT_P (XEXP (XEXP (parts.disp, 0), 1)) - || (XINT (XEXP (XEXP (parts.disp, 0), 0), 1) != UNSPEC_DTPOFF - && XINT (XEXP (XEXP (parts.disp, 0), 0), 1) != UNSPEC_NTPOFF))) - return false; - - return true; -}) - (define_predicate "vsib_mem_operator" (match_code "mem")) -(define_predicate "bnd_mem_operator" - (match_code "mem")) - ;; Return true if the rtx is known to be at least 32 bits aligned. (define_predicate "aligned_operand" (match_operand 0 "general_operand") @@ -1301,7 +1240,7 @@ machine_mode inmode = GET_MODE (XEXP (op, 0)); enum rtx_code code = GET_CODE (op); - if (inmode == CCFPmode || inmode == CCFPUmode) + if (inmode == CCFPmode) { if (!ix86_trivial_fp_comparison_operator (op, mode)) return false; @@ -1311,8 +1250,7 @@ switch (code) { case LTU: case GTU: case LEU: case GEU: - if (inmode == CCmode || inmode == CCFPmode || inmode == CCFPUmode - || inmode == CCCmode) + if (inmode == CCmode || inmode == CCFPmode || inmode == CCCmode) return true; return false; case ORDERED: case UNORDERED: @@ -1348,7 +1286,7 @@ machine_mode inmode = GET_MODE (XEXP (op, 0)); enum rtx_code code = GET_CODE (op); - if (inmode == CCFPmode || inmode == CCFPUmode) + if (inmode == CCFPmode) return ix86_trivial_fp_comparison_operator (op, mode); switch (code) @@ -1391,7 +1329,7 @@ machine_mode inmode = GET_MODE (XEXP (op, 0)); enum rtx_code code = GET_CODE (op); - if (inmode == CCFPmode || inmode == CCFPUmode) + if (inmode == CCFPmode) { if (!ix86_trivial_fp_comparison_operator (op, mode)) return false; @@ -1468,36 +1406,6 @@ (and (match_code "mem") (match_test "MEM_ALIGN (op) < GET_MODE_BITSIZE (mode)"))) -;; Return true if OP is a emms operation, known to be a PARALLEL. -(define_predicate "emms_operation" - (match_code "parallel") -{ - unsigned i; - - if (XVECLEN (op, 0) != 17) - return false; - - for (i = 0; i < 8; i++) - { - rtx elt = XVECEXP (op, 0, i+1); - - if (GET_CODE (elt) != CLOBBER - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != XFmode - || REGNO (SET_DEST (elt)) != FIRST_STACK_REG + i) - return false; - - elt = XVECEXP (op, 0, i+9); - - if (GET_CODE (elt) != CLOBBER - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != DImode - || REGNO (SET_DEST (elt)) != FIRST_MMX_REG + i) - return false; - } - return true; -}) - ;; Return true if OP is a vzeroall operation, known to be a PARALLEL. (define_predicate "vzeroall_operation" (match_code "parallel") @@ -1514,15 +1422,21 @@ if (GET_CODE (elt) != SET || GET_CODE (SET_DEST (elt)) != REG || GET_MODE (SET_DEST (elt)) != V8SImode - || REGNO (SET_DEST (elt)) != SSE_REGNO (i) + || REGNO (SET_DEST (elt)) != GET_SSE_REGNO (i) || SET_SRC (elt) != CONST0_RTX (V8SImode)) return false; } return true; }) -;; return true if OP is a vzeroupper operation. -(define_predicate "vzeroupper_operation" +;; return true if OP is a vzeroall pattern. +(define_predicate "vzeroall_pattern" + (and (match_code "parallel") + (match_code "unspec_volatile" "a") + (match_test "XINT (XVECEXP (op, 0, 0), 1) == UNSPECV_VZEROALL"))) + +;; return true if OP is a vzeroupper pattern. +(define_predicate "vzeroupper_pattern" (and (match_code "unspec_volatile") (match_test "XINT (op, 1) == UNSPECV_VZEROUPPER")))