OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [config/] [cr16/] [constraints.md] - Rev 729

Go to most recent revision | Compare with Previous | Blame | View Log

;; Predicates of machine description for CR16.
;; Copyright (C) 2012 Free Software Foundation, Inc.
;; Contributed by KPIT Cummins Infosystems Limited.
;;
;; 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/>.  

;; Constraints
;; Register constraints
(define_register_constraint "b" "NOSP_REGS"
  "@no sp registers")

(define_register_constraint "c" "SHORT_REGS"
  "@short registers")

(define_register_constraint "d" "LONG_REGS"
  "@long registers")

;; Integer constraints.
(define_constraint "I"
  "A signed 4-bit immediate."
  (and (match_code "const_int")
       (match_test "SIGNED_INT_FITS_N_BITS (ival, 4)")))

(define_constraint "J"
  "A signed 5-bit immediate."
  (and (match_code "const_int")
       (match_test "SIGNED_INT_FITS_N_BITS (ival, 5)")))

(define_constraint "K"
  "A signed 6-bit immediate."
  (and (match_code "const_int")
       (match_test "SIGNED_INT_FITS_N_BITS (ival, 6)")))

(define_constraint "L"
  "A unsigned 4-bit immediate."
  (and (match_code "const_int")
       (match_test "UNSIGNED_INT_FITS_N_BITS (ival, 4)")))

(define_constraint "M"
  "A unsigned and customized  4-bit immediate."
  (and (match_code "const_int")
       (match_test "(IN_RANGE_P (ival, 0, 15) && ((ival != 9) && (ival != 11)))")))

(define_constraint "N"
  "A signed 16-bit immediate."
  (and (match_code "const_int")
       (match_test "IN_RANGE_P (ival, -32768, 32767)")))

(define_constraint "O"
  "A unsigned 20-bit immediate."
  (and (match_code "const_int")
       (match_test "IN_RANGE_P (ival, 0, 1048575)")))

(define_constraint "Q"
  "A shift QI immediate."
  (and (match_code "const_int")
       (match_test "IN_RANGE_P (ival, 0, 7)")))

(define_constraint "R"
  "A shift HI immediate."
  (and (match_code "const_int")
       (match_test "IN_RANGE_P (ival, 0, 15)")))

(define_constraint "S"
  "A shift SI immediate."
  (and (match_code "const_int")
       (match_test "IN_RANGE_P (ival, 0, 31)")))

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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