diff options
author | Walter Lee <walt@tilera.com> | 2012-02-14 10:02:21 +0000 |
---|---|---|
committer | Walter Lee <walt@gcc.gnu.org> | 2012-02-14 10:02:21 +0000 |
commit | dd552284fd817c9d946598a7b647f9e67753bed6 (patch) | |
tree | 2ebff3fcffa7603a372455fbc14c68ad06466730 /gcc/config/tilepro/predicates.md | |
parent | 62513f7bedaa6e0467da08030b61a35a1b83ab39 (diff) | |
download | gcc-dd552284fd817c9d946598a7b647f9e67753bed6.tar.gz |
Add ports for TILE-Gx and TILEPro.
.
* MAINTAINERS (tilegx port): Add myself.
(tilepro port): Add myself.
contrib
* config-list.mk (LIST): Add tilegx-linux-gnu and
tilepro-linux-gnu.
* gcc_update (gcc/config/tilegx/mul-tables.c): New dependencies.
(gcc/config/tilepro/mul-tables.c): New dependencies.
gcc
* config.gcc: Handle tilegx and tilepro.
* configure.ac (gcc_cv_as_dwarf2_debug_line): Enable test for
tilegx and tilepro.
Add HAVE_AS_TLS check for tilegx and tilepro.
* configure: Regenerate.
* doc/contrib.texi: Add Mat Hostetter and self.
* doc/extend.texi (TILE-Gx Built-in Functions): New node.
Document instruction intrinsics and network accessing intrinsics.
(TILEPro Built-in Functions): New node. Document instruction
intrinsics and network accessing intrinsics.
* doc/install.texi (Specific, tilegx-*-linux*): Document it.
(Specific, tilepro-*-linux*): Likewise.
* doc/invoke.texi (TILE-Gx Options): New section.
(TILEPro Options): New section.
* doc/md.texi (TILE-Gx): New section.
(TILEPro): New section.
* common/config/tilegx: New directory for tilegx.
* common/config/tilepro: New directory for tilepro.
* config/tilegx: New directory for tilegx.
* config/tilepro: New directory for tilepro.
gcc/testsuite
* g++.dg/other/PR23205.C: Disable test on tile.
* g++.dg/other/pr23205-2.C: Disable test on tile.
* gcc.dg/20020312-2.c: Add a condition for __tile__.
* gcc.dg/20040813-1.c: Disable test on tile.
* gcc.dg/lower-subreg-1.c: Disable test on tilegx.
* gcc.misc-tests/linkage.exp: Handle tilegx.
libcpp
* configure.ac: Require 64-bit hwint for tilegx and tilepro.
* configure: Regenerate.
libgcc
* config.host: Handle tilegx and tilepro.
* config/tilegx: New directory for tilegx.
* config/tilepro: New directory for tilepro.
libgomp
* configure.tgt: Handle tilegx and tilepro.
* config/linux/tile: New directory for tilegx and tilepro.
Added:
trunk/gcc/common/config/tilegx/tilegx-common.c
trunk/gcc/common/config/tilepro/tilepro-common.c
trunk/gcc/config/tilegx/constraints.md
trunk/gcc/config/tilegx/linux.h
trunk/gcc/config/tilegx/mul-tables.c
trunk/gcc/config/tilegx/predicates.md
trunk/gcc/config/tilegx/sync.md
trunk/gcc/config/tilegx/t-tilegx
trunk/gcc/config/tilegx/tilegx-builtins.h
trunk/gcc/config/tilegx/tilegx-c.c
trunk/gcc/config/tilegx/tilegx-generic.md
trunk/gcc/config/tilegx/tilegx-modes.def
trunk/gcc/config/tilegx/tilegx-multiply.h
trunk/gcc/config/tilegx/tilegx-protos.h
trunk/gcc/config/tilegx/tilegx.c
trunk/gcc/config/tilegx/tilegx.h
trunk/gcc/config/tilegx/tilegx.md
trunk/gcc/config/tilegx/tilegx.opt
trunk/gcc/config/tilepro/constraints.md
trunk/gcc/config/tilepro/gen-mul-tables.cc
trunk/gcc/config/tilepro/linux.h
trunk/gcc/config/tilepro/mul-tables.c
trunk/gcc/config/tilepro/predicates.md
trunk/gcc/config/tilepro/t-tilepro
trunk/gcc/config/tilepro/tilepro-builtins.h
trunk/gcc/config/tilepro/tilepro-c.c
trunk/gcc/config/tilepro/tilepro-generic.md
trunk/gcc/config/tilepro/tilepro-modes.def
trunk/gcc/config/tilepro/tilepro-multiply.h
trunk/gcc/config/tilepro/tilepro-protos.h
trunk/gcc/config/tilepro/tilepro.c
trunk/gcc/config/tilepro/tilepro.h
trunk/gcc/config/tilepro/tilepro.md
trunk/gcc/config/tilepro/tilepro.opt
trunk/libgcc/config/tilegx/sfp-machine.h
trunk/libgcc/config/tilegx/sfp-machine32.h
trunk/libgcc/config/tilegx/sfp-machine64.h
trunk/libgcc/config/tilegx/t-crtstuff
trunk/libgcc/config/tilegx/t-softfp
trunk/libgcc/config/tilegx/t-tilegx
trunk/libgcc/config/tilepro/atomic.c
trunk/libgcc/config/tilepro/atomic.h
trunk/libgcc/config/tilepro/linux-unwind.h
trunk/libgcc/config/tilepro/sfp-machine.h
trunk/libgcc/config/tilepro/softdivide.c
trunk/libgcc/config/tilepro/softmpy.S
trunk/libgcc/config/tilepro/t-crtstuff
trunk/libgcc/config/tilepro/t-tilepro
trunk/libgomp/config/linux/tile/futex.h
Modified:
trunk/MAINTAINERS
trunk/contrib/config-list.mk
trunk/contrib/gcc_update
trunk/gcc/config.gcc
trunk/gcc/configure
trunk/gcc/configure.ac
trunk/gcc/doc/contrib.texi
trunk/gcc/doc/extend.texi
trunk/gcc/doc/install.texi
trunk/gcc/doc/invoke.texi
trunk/gcc/doc/md.texi
trunk/gcc/testsuite/g++.dg/other/PR23205.C
trunk/gcc/testsuite/g++.dg/other/pr23205-2.C
trunk/gcc/testsuite/gcc.dg/20020312-2.c
trunk/gcc/testsuite/gcc.dg/20040813-1.c
trunk/gcc/testsuite/gcc.dg/lower-subreg-1.c
trunk/gcc/testsuite/gcc.misc-tests/linkage.exp
trunk/libcpp/configure
trunk/libcpp/configure.ac
trunk/libgcc/config.host
trunk/libgomp/configure.tgt
From-SVN: r184203
Diffstat (limited to 'gcc/config/tilepro/predicates.md')
-rw-r--r-- | gcc/config/tilepro/predicates.md | 261 |
1 files changed, 261 insertions, 0 deletions
diff --git a/gcc/config/tilepro/predicates.md b/gcc/config/tilepro/predicates.md new file mode 100644 index 00000000000..6c4ffbe4a20 --- /dev/null +++ b/gcc/config/tilepro/predicates.md @@ -0,0 +1,261 @@ +;; Predicate definitions for Tilera TILEPro chip. +;; Copyright (C) 2011, 2012 +;; Free Software Foundation, Inc. +;; Contributed by Walter Lee (walt@tilera.com) +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 3, or (at your +;; option) any later version. +;; +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING3. If not see +;; <http://www.gnu.org/licenses/>. + +;; Return true if OP is the zero constant for MODE. +(define_predicate "const_zero_operand" + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST0_RTX (mode)"))) + +;; Returns true if OP is either the constant zero or a register. +(define_predicate "reg_or_0_operand" + (and (ior (match_operand 0 "register_operand") + (match_operand 0 "const_zero_operand")) + (match_test "GET_MODE_SIZE (mode) <= UNITS_PER_WORD"))) + +; Return 1 if OP is a network register identifier. +(define_predicate "netreg_operand" + (and (match_code "const_int") + (match_test "IN_RANGE (INTVAL (op), 0, 6)"))) + +; Return 1 if OP is an unsigned 5-bit constant. +(define_predicate "u5bit_cint_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == (INTVAL (op) & 0x1F)"))) + +;; Return 1 if OP is an unsigned 16-bit constant. +(define_predicate "u16bit_cint_operand" + (and (match_code "const_int") + (match_test "(unsigned HOST_WIDE_INT)INTVAL (op) < (1U << 16)"))) + +;; Return 1 if OP is a signed 8-bit constant. +(define_predicate "s8bit_cint_operand" + (and (match_code "const_int") + (match_test "satisfies_constraint_I (op)"))) + +;; Return 1 if OP is a signed 16-bit constant. +(define_predicate "s16bit_cint_operand" + (and (match_code "const_int") + (match_test "satisfies_constraint_J (op)"))) + +;; Return 1 if OP is a nonzero integer constant whose low 16 bits are zero. +(define_predicate "auli_cint_operand" + (and (match_code "const_int") + (match_test "satisfies_constraint_K (op)"))) + +;; Return 1 if OP is an unsigned 15-bit constant. +(define_predicate "u15bit_cint_operand" + (and (match_code "const_int") + (match_test "(unsigned HOST_WIDE_INT)INTVAL (op) < (1U << 15)"))) + +;; Return 1 if OP is a constant or any register. +(define_predicate "reg_or_cint_operand" + (ior (match_operand 0 "register_operand") + (match_operand 0 "const_int_operand"))) + +;; Return 1 if OP is a 4-element vector constant with identical signed +;; 8-bit elements or any register. +(define_predicate "reg_or_v4s8bit_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_vector") + (match_test "CONST_VECTOR_NUNITS (op) == 4 + && satisfies_constraint_I (CONST_VECTOR_ELT (op, 0)) + && CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 1) + && CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 2) + && CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 3)")))) + +;; Return 1 if OP is a 2-element vector constant with identical signed +;; 8-bit elements or any register. +(define_predicate "reg_or_v2s8bit_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_vector") + (match_test "CONST_VECTOR_NUNITS (op) == 2 + && satisfies_constraint_I (CONST_VECTOR_ELT (op, 0)) + && CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 1)")))) + +;; Return 1 if the operand is a valid second operand to an add insn. +(define_predicate "add_operand" + (if_then_else (match_code "const_int") + (match_test "satisfies_constraint_J (op) || satisfies_constraint_K (op)") + (match_operand 0 "register_operand"))) + +;; Return 1 if the operand is a register or signed 8-bit immediate operand. +(define_predicate "reg_or_s8bit_operand" + (if_then_else (match_code "const_int") + (match_test "satisfies_constraint_I (op)") + (match_operand 0 "register_operand"))) + +;; Return 1 for an operand suitable for ANDing with a register. +(define_predicate "and_operand" + (if_then_else (match_code "const_int") + (match_test "satisfies_constraint_I (op) || satisfies_constraint_M (op)") + (match_operand 0 "register_operand"))) + +;; Return 1 if the operand is a register or unsigned 5-bit immediate operand. +(define_predicate "reg_or_u5bit_operand" + (if_then_else (match_code "const_int") + (match_test "INTVAL (op) == (INTVAL (op) & 0x1F)") + (match_operand 0 "register_operand"))) + +; Return 1 if the operand is 2, 4 or 8. +(define_predicate "cint_248_operand" + (and (match_code "const_int") + (match_test + "INTVAL (op) == 2 || INTVAL (op) == 4 || INTVAL (op) == 8"))) + + +;; Return true if OP is a TLS symbolic operand. +(define_predicate "tls_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) != TLS_MODEL_NONE"))) + +;; Return true if OP is a symbolic operand for the TLS Global Dynamic model. +(define_predicate "tls_gd_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_GLOBAL_DYNAMIC"))) + +;; Return true if OP is a symbolic operand for the TLS Local Dynamic model. +(define_predicate "tls_ld_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_DYNAMIC"))) + +;; Return true if OP is a symbolic operand that can be used for the +;; TLS Initial Exec model. +(define_predicate "tls_ie_symbolic_operand" + (and (match_code "symbol_ref") + (ior (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_INITIAL_EXEC") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_EXEC")))) + +;; Return true if OP is a symbolic operand for the TLS Local Exec model. +(define_predicate "tls_le_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_EXEC"))) + +;; Returns true if OP is any general operand except for an +;; auto-incrementing address operand. +(define_predicate "nonautoinc_operand" + (and (match_operand 0 "general_operand") + (not (ior (match_code "pre_dec") (match_code "pre_inc") + (match_code "post_dec") (match_code "post_inc") + (match_code "post_modify") (match_code "pre_modify"))))) + +;; Returns true if OP is a non-auto-incrementing memory operand. +(define_predicate "nonautoincmem_operand" + (match_operand 0 "memory_operand") +{ + return nonautoinc_operand (XEXP (op, 0), GET_MODE (XEXP (op, 0))); +}) + +;; Returns true if OP is a non-auto-incrementing memory, general +;; operand. +(define_predicate "nonautoincmem_general_operand" + (match_operand 0 "general_operand") +{ + if (memory_operand (op, mode)) + return nonautoinc_operand (XEXP (op, 0), GET_MODE (XEXP (op, 0))); + else + return true; +}) + +;; Returns true if OP is a non-auto-incrementing memory, non-immediate +;; operand. +(define_predicate "nonautoincmem_nonimmediate_operand" + (match_operand 0 "nonimmediate_operand") +{ + if (memory_operand (op, mode)) + return nonautoinc_operand (XEXP (op, 0), GET_MODE (XEXP (op, 0))); + else + return true; +}) + +;; Return true if OP is a valid operand for the source of a move insn. +(define_predicate "move_operand" + (match_operand 0 "general_operand") +{ + /* If both modes are non-void they must be the same. */ + if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op)) + return false; + + if (GET_MODE_SIZE (mode) > 4) + return false; + + switch (GET_CODE (op)) + { + case CONST_INT: + return (satisfies_constraint_J (op) + || satisfies_constraint_K (op) + || satisfies_constraint_N (op) + || satisfies_constraint_P (op)); + + case HIGH: + return true; + + case MEM: + return memory_address_p (mode, XEXP (op, 0)); + + default: + return register_operand (op, mode); + } +}) + +;; Returns 1 if OP is a symbolic operand, i.e. a symbol_ref or a label_ref, +;; possibly with an offset. +(define_predicate "symbolic_operand" + (ior (match_code "symbol_ref,label_ref") + (and (match_code "const") + (match_test "GET_CODE (XEXP (op,0)) == PLUS + && (GET_CODE (XEXP (XEXP (op,0), 0)) == SYMBOL_REF + || GET_CODE (XEXP (XEXP (op,0), 0)) == LABEL_REF) + && CONST_INT_P (XEXP (XEXP (op,0), 1))")))) + +;; Returns 1 if OP is a symbolic operand, or a const unspec wrapper +;; representing a got reference, a tls reference, or pc-relative +;; reference. +(define_predicate "const_symbolic_operand" + (ior (match_operand 0 "symbolic_operand") + (and (match_code "const") + (match_test "GET_CODE (XEXP (op,0)) == UNSPEC") + (ior (match_test "XINT (XEXP (op,0), 1) == UNSPEC_GOT16_SYM") + (match_test "XINT (XEXP (op,0), 1) == UNSPEC_GOT32_SYM") + (match_test "XINT (XEXP (op,0), 1) == UNSPEC_PCREL_SYM") + (match_test "XINT (XEXP (op,0), 1) == UNSPEC_TLS_GD") + (match_test "XINT (XEXP (op,0), 1) == UNSPEC_TLS_IE") + (match_test "XINT (XEXP (op,0), 1) == UNSPEC_TLS_LE"))))) + +;; Return true if OP is an address suitable for a call insn. +;; Call insn on TILE can take a PC-relative constant address +;; or any regular memory address. +(define_predicate "call_address_operand" + (ior (match_operand 0 "symbolic_operand") + (match_test "memory_address_p (Pmode, op)"))) + +;; Return true if OP is an operand suitable for a call insn. +(define_predicate "call_operand" + (and (match_code "mem") + (match_test "call_address_operand (XEXP (op, 0), mode)"))) + +;; Return 1 if OP is a signed comparison operation. +;; We can use these directly in compares against zero. +(define_predicate "signed_comparison_operator" + (match_code "eq,ne,le,lt,ge,gt")) + +;; Return 1 if OP is a equal or not-equal operation. +(define_predicate "eqne_operator" + (match_code "eq,ne")) |