X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;ds=sidebyside;f=gcc%2Fconfig%2Fmcore%2Fpredicates.md;h=1f5fc00dcfcaef0725e0d8bbab4c8258794df4d9;hb=a37dec0c0921c160e897661b1d32d47dc9b859d3;hp=56089036ba347d3efdd22b667fbd1d8980124606;hpb=1e2352160b0931f247b629e33bdbc2793b26e34b;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/config/mcore/predicates.md b/gcc/config/mcore/predicates.md index 56089036ba3..1f5fc00dcfc 100644 --- a/gcc/config/mcore/predicates.md +++ b/gcc/config/mcore/predicates.md @@ -1,11 +1,11 @@ -;; Predicate definitions for FIXME FIXME. -;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Predicate definitions for Motorola MCore. +;; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ;; ;; 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 2, or (at your option) +;; 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, @@ -14,9 +14,8 @@ ;; 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 COPYING. If not, write to -;; the Free Software Foundation, 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; Nonzero if OP is a normal arithmetic register. @@ -38,7 +37,7 @@ ;; Nonzero if OP can be source of a simple move operation. (define_predicate "mcore_general_movsrc_operand" - (match_code "mem,const_int,reg,subreg,symbol_ref,label_ref") + (match_code "mem,const_int,reg,subreg,symbol_ref,label_ref,const") { /* Any (MEM LABEL_REF) is OK. That is a pc-relative load. */ if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == LABEL_REF) @@ -50,7 +49,7 @@ ;; Nonzero if OP can be destination of a simple move operation. (define_predicate "mcore_general_movdst_operand" - (match_code "mem,const_int,reg,subreg") + (match_code "mem,reg,subreg") { if (GET_CODE (op) == REG && REGNO (op) == CC_REG) return 0; @@ -141,7 +140,7 @@ if (GET_CODE (op) == CONST_INT) { - if (CONST_OK_FOR_K (INTVAL (op)) || CONST_OK_FOR_M (~INTVAL (op))) + if (CONST_OK_FOR_K (INTVAL (op)) || (mcore_num_zeros (INTVAL (op)) <= 2)) return 1; } @@ -212,18 +211,24 @@ if (GET_CODE (op) == CONST_INT) { - return 1; - - /* The following is removed because it precludes large constants from being + /* The following has been removed because it precludes large constants from being returned as valid source operands for and add/sub insn. While large constants may not directly be used in an add/sub, they may if first loaded into a register. Thus, this predicate should indicate that they are valid, and the constraint in mcore.md should control whether an additional load to - register is needed. (see mcore.md, addsi). -- DAC 4/2/1998 */ - /* - if (CONST_OK_FOR_J(INTVAL(op)) || CONST_OK_FOR_L(INTVAL(op))) - return 1; - */ + register is needed. (see mcore.md, addsi). -- DAC 4/2/1998 + + if (CONST_OK_FOR_J (INTVAL (op)) || CONST_OK_FOR_L (INTVAL (op))) + return 1; + + However we do still need to check to make sure that the constant is not too + big, especially if we are running on a 64-bit OS... Nickc 8/1/07. */ + + if (trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op)) + return 0; + + return 1; + } return 0;