1;; Machine Description for TI MSP43* processors 2;; Copyright (C) 2013-2015 Free Software Foundation, Inc. 3;; Contributed by Red Hat. 4 5;; This file is part of GCC. 6 7;; GCC is free software; you can redistribute it and/or modify 8;; it under the terms of the GNU General Public License as published by 9;; the Free Software Foundation; either version 3, or (at your option) 10;; any later version. 11 12;; GCC is distributed in the hope that it will be useful, 13;; but WITHOUT ANY WARRANTY; without even the implied warranty of 14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15;; GNU General Public License for more details. 16 17;; You should have received a copy of the GNU General Public License 18;; along with GCC; see the file COPYING3. If not see 19;; <http://www.gnu.org/licenses/>. 20 21(define_predicate "msp_volatile_memory_operand" 22 (and (match_code "mem") 23 (match_test ("memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0), MEM_ADDR_SPACE (op))"))) 24) 25 26; TRUE for any valid general operand. We do this because 27; general_operand refuses to match volatile memory refs. 28 29(define_predicate "msp_general_operand" 30 (ior (match_operand 0 "general_operand") 31 (match_operand 0 "msp_volatile_memory_operand")) 32) 33 34; Likewise for nonimmediate_operand. 35 36(define_predicate "msp_nonimmediate_operand" 37 (ior (match_operand 0 "nonimmediate_operand") 38 (match_operand 0 "msp_volatile_memory_operand")) 39) 40 41(define_predicate "ubyte_operand" 42 (and (match_code "const_int") 43 (match_test "IN_RANGE (INTVAL (op), 0, 255)"))) 44 45; TRUE for comparisons we support. 46(define_predicate "msp430_cmp_operator" 47 (match_code "eq,ne,lt,ltu,ge,geu")) 48 49; TRUE for comparisons we need to reverse. 50(define_predicate "msp430_reversible_cmp_operator" 51 (match_code "gt,gtu,le,leu")) 52 53; TRUE for constants the constant generator can produce 54(define_predicate "msp430_constgen_operator" 55 (and (match_code "const_int") 56 (match_test (" INTVAL (op) == 0 57 || INTVAL (op) == 1 58 || INTVAL (op) == 2 59 || INTVAL (op) == 4 60 || INTVAL (op) == 8 61 || INTVAL (op) == -1 ")))) 62 63; TRUE for constants the constant generator can produce 64(define_predicate "msp430_inv_constgen_operator" 65 (and (match_code "const_int") 66 (match_test (" INTVAL (op) == ~0 67 || INTVAL (op) == ~1 68 || INTVAL (op) == ~2 69 || INTVAL (op) == ~4 70 || INTVAL (op) == ~8 71 || INTVAL (op) == ~(-1) ")))) 72 73(define_predicate "msp430_nonsubreg_operand" 74 (match_code "reg,mem")) 75 76(define_predicate "msp430_nonsubreg_or_imm_operand" 77 (ior (match_operand 0 "msp430_nonsubreg_operand") 78 (match_operand 0 "immediate_operand"))) 79 80; TRUE for constants which are bit positions for zero_extract 81(define_predicate "msp430_bitpos" 82 (and (match_code "const_int") 83 (match_test (" INTVAL (op) >= 0 84 && INTVAL (op) <= 15 ")))) 85