1 ;; Machine Description for TI MSP43* processors
2 ;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
3 ;; Contributed by Red Hat.
5 ;; This file is part of GCC.
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)
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.
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/>.
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))")))
26 ; TRUE for any valid general operand. We do this because
27 ; general_operand refuses to match volatile memory refs.
29 (define_predicate "msp_general_operand"
30 (ior (match_operand 0 "general_operand")
31 (match_operand 0 "msp_volatile_memory_operand"))
34 ; Likewise for nonimmediate_operand.
36 (define_predicate "msp_nonimmediate_operand"
37 (ior (match_operand 0 "nonimmediate_operand")
38 (match_operand 0 "msp_volatile_memory_operand"))
41 (define_predicate "ubyte_operand"
42 (and (match_code "const_int")
43 (match_test "IN_RANGE (INTVAL (op), 0, 255)")))
45 ; TRUE for comparisons we support.
46 (define_predicate "msp430_cmp_operator"
47 (match_code "eq,ne,lt,ltu,ge,geu"))
49 ; TRUE for comparisons we need to reverse.
50 (define_predicate "msp430_reversible_cmp_operator"
51 (match_code "gt,gtu,le,leu"))
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
61 || INTVAL (op) == -1 "))))
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
71 || INTVAL (op) == ~(-1) "))))
73 (define_predicate "msp430_nonsubreg_operand"
74 (match_code "reg,mem"))
76 ; TRUE for constants which are bit positions for zero_extract
77 (define_predicate "msp430_bitpos"
78 (and (match_code "const_int")
79 (match_test (" INTVAL (op) >= 0
80 && INTVAL (op) <= 15 "))))