OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [config/] [spu/] [constraints.md] - Diff between revs 282 and 338

Only display areas with differences | Details | Blame | View Log

Rev 282 Rev 338
;; Constraint definitions for SPU
;; Constraint definitions for SPU
;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
;;
;;
;; This file is free software; you can redistribute it and/or modify it under
;; This file 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
;; the terms of the GNU General Public License as published by the Free
;; Software Foundation; either version 3 of the License, or (at your option)
;; Software Foundation; either version 3 of the License, or (at your option)
;; any later version.
;; any later version.
;; This file is distributed in the hope that it will be useful, but WITHOUT
;; This file is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
;; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
;; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
;; for more details.
;; for more details.
;; You should have received a copy of the GNU General Public License
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3.  If not see
;; along with GCC; see the file COPYING3.  If not see
;; .
;; .


;;       ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
;;       ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
;; GCC:      ffffiiiiiiii     x x        x x   xxxx xx
;; GCC:      ffffiiiiiiii     x x        x x   xxxx xx
;; SPU:  xxxx    xxx xxxx xxxx x xxx xx x   xxx         xx
;; SPU:  xxxx    xxx xxxx xxxx x xxx xx x   xxx         xx
;; FREE:     ffff   i    a          a  a  a        a  aa  aaa
;; FREE:     ffff   i    a          a  a  a        a  aa  aaa
;; x - used
;; x - used
;; a - available
;; a - available
;; i - available for integer immediates
;; i - available for integer immediates
;; f - available for floating point immediates
;; f - available for floating point immediates
;; For most immediate constraints we have 3 variations to deal with the
;; For most immediate constraints we have 3 variations to deal with the
;; fact const_int has no mode.  One variation treats const_int as 32 bit,
;; fact const_int has no mode.  One variation treats const_int as 32 bit,
;; another treats it as 64 bit, and the third sign extends it to 128 bit.
;; another treats it as 64 bit, and the third sign extends it to 128 bit.
(define_constraint "A"
(define_constraint "A"
  "An immediate which can be loaded with the il/ila/ilh/ilhu instructions.  const_int is treated as a 32-bit value."
  "An immediate which can be loaded with the il/ila/ilh/ilhu instructions.  const_int is treated as a 32-bit value."
  (ior (and (match_code "const_int,const_double,const_vector")
  (ior (and (match_code "const_int,const_double,const_vector")
            (match_test "immediate_load_p (op, SImode)"))
            (match_test "immediate_load_p (op, SImode)"))
       (match_code "symbol_ref,label_ref,high,const")))
       (match_code "symbol_ref,label_ref,high,const")))
(define_constraint "B"
(define_constraint "B"
  "An immediate for arithmetic instructions (e.g., ai, ceqi).  const_int is treated as a 32-bit value."
  "An immediate for arithmetic instructions (e.g., ai, ceqi).  const_int is treated as a 32-bit value."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "arith_immediate_p (op, SImode, -0x200, 0x1ff)")))
       (match_test "arith_immediate_p (op, SImode, -0x200, 0x1ff)")))
(define_constraint "C"
(define_constraint "C"
  "An immediate for and/xor/or instructions.  const_int is treated as a 32-bit value."
  "An immediate for and/xor/or instructions.  const_int is treated as a 32-bit value."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "logical_immediate_p (op, SImode)")))
       (match_test "logical_immediate_p (op, SImode)")))
(define_constraint "D"
(define_constraint "D"
  "An immediate for iohl instruction.  const_int is treated as a 32-bit value."
  "An immediate for iohl instruction.  const_int is treated as a 32-bit value."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "iohl_immediate_p (op, SImode)")))
       (match_test "iohl_immediate_p (op, SImode)")))
(define_constraint "U"
(define_constraint "U"
  "An immediate which can be loaded with the il/ila/ilh/ilhu instructions.  const_int is sign extended to 128 bit."
  "An immediate which can be loaded with the il/ila/ilh/ilhu instructions.  const_int is sign extended to 128 bit."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "immediate_load_p (op, TImode)")))
       (match_test "immediate_load_p (op, TImode)")))
(define_constraint "W"
(define_constraint "W"
  "An immediate for shift and rotate instructions.  const_int is treated as a 32-bit value."
  "An immediate for shift and rotate instructions.  const_int is treated as a 32-bit value."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "arith_immediate_p (op, SImode, -0x80000000ll, 0x7fffffffll)")))
       (match_test "arith_immediate_p (op, SImode, -0x80000000ll, 0x7fffffffll)")))
(define_constraint "Y"
(define_constraint "Y"
  "An immediate for and/xor/or instructions.  const_int is sign extended as a 128 bit."
  "An immediate for and/xor/or instructions.  const_int is sign extended as a 128 bit."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "logical_immediate_p (op, TImode)")))
       (match_test "logical_immediate_p (op, TImode)")))
(define_constraint "Z"
(define_constraint "Z"
  "An immediate for iohl instruction.  const_int is sign extended to 128 bit."
  "An immediate for iohl instruction.  const_int is sign extended to 128 bit."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "iohl_immediate_p (op, TImode)")))
       (match_test "iohl_immediate_p (op, TImode)")))
(define_constraint "a"
(define_constraint "a"
  "An immediate which can be loaded with the il/ila/ilh/ilhu instructions.  const_int is treated as a 64-bit value."
  "An immediate which can be loaded with the il/ila/ilh/ilhu instructions.  const_int is treated as a 64-bit value."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "immediate_load_p (op, DImode)")))
       (match_test "immediate_load_p (op, DImode)")))
(define_constraint "c"
(define_constraint "c"
  "An immediate for and/xor/or instructions.  const_int is treated as a 64-bit value."
  "An immediate for and/xor/or instructions.  const_int is treated as a 64-bit value."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "logical_immediate_p (op, DImode)")))
       (match_test "logical_immediate_p (op, DImode)")))
(define_constraint "d"
(define_constraint "d"
  "An immediate for iohl instruction.  const_int is treated as a 64-bit value."
  "An immediate for iohl instruction.  const_int is treated as a 64-bit value."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "iohl_immediate_p (op, DImode)")))
       (match_test "iohl_immediate_p (op, DImode)")))
(define_constraint "f"
(define_constraint "f"
  "An immediate which can be loaded with fsmbi."
  "An immediate which can be loaded with fsmbi."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "fsmbi_const_p (op)")))
       (match_test "fsmbi_const_p (op)")))
(define_constraint "j"
(define_constraint "j"
  "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions.  const_int is treated as a 32-bit value."
  "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions.  const_int is treated as a 32-bit value."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "cpat_const_p (op, SImode)")))
       (match_test "cpat_const_p (op, SImode)")))
(define_constraint "k"
(define_constraint "k"
  "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions.  const_int is treated as a 64-bit value."
  "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions.  const_int is treated as a 64-bit value."
  (and (match_code "const_int,const_double,const_vector")
  (and (match_code "const_int,const_double,const_vector")
       (match_test "cpat_const_p (op, DImode)")))
       (match_test "cpat_const_p (op, DImode)")))
(define_constraint "l"
(define_constraint "l"
  "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions."
  "An immediate which can be loaded with one of the cbd/chd/cwd/cdd instructions."
  (and (match_code "const_double,const_vector")
  (and (match_code "const_double,const_vector")
       (match_test "cpat_const_p (op, TImode)")))
       (match_test "cpat_const_p (op, TImode)")))


;; Integer constraints
;; Integer constraints
(define_constraint "I"
(define_constraint "I"
  "A constant in the range [-64, 63] for shift/rotate instructions."
  "A constant in the range [-64, 63] for shift/rotate instructions."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "ival >= -0x40 && ival <= 0x3f")))
       (match_test "ival >= -0x40 && ival <= 0x3f")))
(define_constraint "J"
(define_constraint "J"
  "An unsigned 7-bit constant for conversion/nop/channel instructions."
  "An unsigned 7-bit constant for conversion/nop/channel instructions."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "ival >= 0 && ival <= 0x7f")))
       (match_test "ival >= 0 && ival <= 0x7f")))
(define_constraint "K"
(define_constraint "K"
  "A signed 10-bit constant for most arithmetic instructions."
  "A signed 10-bit constant for most arithmetic instructions."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "ival >= -0x200 && ival <= 0x1ff")))
       (match_test "ival >= -0x200 && ival <= 0x1ff")))
(define_constraint "M"
(define_constraint "M"
  "A signed 16-bit immediate for @code{stop}."
  "A signed 16-bit immediate for @code{stop}."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "ival >= -0x8000ll && ival <= 0x7fffll")))
       (match_test "ival >= -0x8000ll && ival <= 0x7fffll")))
(define_constraint "N"
(define_constraint "N"
  "An unsigned 16-bit constant for @code{iohl} and @code{fsmbi}."
  "An unsigned 16-bit constant for @code{iohl} and @code{fsmbi}."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "ival >= 0 && ival <= 0xffff")))
       (match_test "ival >= 0 && ival <= 0xffff")))
(define_constraint "O"
(define_constraint "O"
  "An unsigned 7-bit constant whose 3 least significant bits are 0."
  "An unsigned 7-bit constant whose 3 least significant bits are 0."
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "(ival & 7) == 0")))
       (match_test "(ival & 7) == 0")))
(define_constraint "P"
(define_constraint "P"
  "An unsigned 3-bit constant for 16-byte rotates and shifts"
  "An unsigned 3-bit constant for 16-byte rotates and shifts"
  (and (match_code "const_int")
  (and (match_code "const_int")
       (match_test "ival >= 0 && ival <= 7")))
       (match_test "ival >= 0 && ival <= 7")))


;; Memory constraints
;; Memory constraints
(define_memory_constraint "R"
(define_memory_constraint "R"
  "Call operand, reg, for indirect calls"
  "Call operand, reg, for indirect calls"
  (and (match_code "mem")
  (and (match_code "mem")
       (match_test "GET_CODE(XEXP(op, 0)) == REG")))
       (match_test "GET_CODE(XEXP(op, 0)) == REG")))
(define_memory_constraint "S"
(define_memory_constraint "S"
  "Call operand, symbol, for relative calls."
  "Call operand, symbol, for relative calls."
  (and (match_code "mem")
  (and (match_code "mem")
       (match_test "!TARGET_LARGE_MEM
       (match_test "!TARGET_LARGE_MEM
                    && ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
                    && ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
                         || GET_CODE (XEXP (op, 0)) == LABEL_REF))")))
                         || GET_CODE (XEXP (op, 0)) == LABEL_REF))")))
(define_memory_constraint "T"
(define_memory_constraint "T"
  "Call operand, const_int, for absolute calls."
  "Call operand, const_int, for absolute calls."
  (and (match_code "mem")
  (and (match_code "mem")
       (match_test "GET_CODE (XEXP (op, 0)) == CONST_INT
       (match_test "GET_CODE (XEXP (op, 0)) == CONST_INT
                    && INTVAL (XEXP (op, 0)) >= 0
                    && INTVAL (XEXP (op, 0)) >= 0
                    && INTVAL (XEXP (op, 0)) <= 0x3ffff")))
                    && INTVAL (XEXP (op, 0)) <= 0x3ffff")))


;; Floating-point constant constraints.
;; Floating-point constant constraints.
(define_constraint "v"
(define_constraint "v"
  "Floating point power of 2 with exponent in [0..127]"
  "Floating point power of 2 with exponent in [0..127]"
  (and (match_code "const_double,const_vector")
  (and (match_code "const_double,const_vector")
       (match_test "exp2_immediate_p (op, VOIDmode, 0, 127)")))
       (match_test "exp2_immediate_p (op, VOIDmode, 0, 127)")))
(define_constraint "w"
(define_constraint "w"
  "Floating point power of 2 with exponent in [-126..0]"
  "Floating point power of 2 with exponent in [-126..0]"
  (and (match_code "const_double,const_vector")
  (and (match_code "const_double,const_vector")
       (match_test "exp2_immediate_p (op, VOIDmode, -126, 0)")))
       (match_test "exp2_immediate_p (op, VOIDmode, -126, 0)")))
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.