1 |
12 |
jlechner |
;; Machine Descriptions for R8C/M16C/M32C
|
2 |
|
|
;; Copyright (C) 2005
|
3 |
|
|
;; Free Software Foundation, Inc.
|
4 |
|
|
;; Contributed by Red Hat.
|
5 |
|
|
;;
|
6 |
|
|
;; This file is part of GCC.
|
7 |
|
|
;;
|
8 |
|
|
;; GCC is free software; you can redistribute it and/or modify it
|
9 |
|
|
;; under the terms of the GNU General Public License as published
|
10 |
|
|
;; by the Free Software Foundation; either version 2, or (at your
|
11 |
|
|
;; option) any later version.
|
12 |
|
|
;;
|
13 |
|
|
;; GCC is distributed in the hope that it will be useful, but WITHOUT
|
14 |
|
|
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
15 |
|
|
;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
16 |
|
|
;; License for more details.
|
17 |
|
|
;;
|
18 |
|
|
;; You should have received a copy of the GNU General Public License
|
19 |
|
|
;; along with GCC; see the file COPYING. If not, write to the Free
|
20 |
|
|
;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
21 |
|
|
;; 02110-1301, USA.
|
22 |
|
|
|
23 |
|
|
; conditionals - cmp, jcc, setcc, etc.
|
24 |
|
|
|
25 |
|
|
; Until support for relaxing is supported in gas, we must assume that
|
26 |
|
|
; short labels won't reach, so we must use long labels.
|
27 |
|
|
; Unfortunately, there aren't any conditional jumps with long labels,
|
28 |
|
|
; so instead we invert the conditional and jump around a regular jump.
|
29 |
|
|
|
30 |
|
|
; Note that we can, at some point in the future, add code to omit the
|
31 |
|
|
; "cmp" portion of the insn if the preceding insn happened to set the
|
32 |
|
|
; right flags already. For example, a mov followed by a "cmp *,0" is
|
33 |
|
|
; redundant; the move already set the Z flag.
|
34 |
|
|
|
35 |
|
|
(define_insn "cbranchqi4"
|
36 |
|
|
[(set (pc) (if_then_else
|
37 |
|
|
(match_operator 0 "m32c_cmp_operator"
|
38 |
|
|
[(match_operand:QI 1 "mrai_operand" "RqiSd,RqiSd,?Rmm,?Rmm")
|
39 |
|
|
(match_operand:QI 2 "mrai_operand" "iRqiSd,?Rmm,iRqiSd,?Rmm")])
|
40 |
|
|
(label_ref (match_operand 3 "" ""))
|
41 |
|
|
(pc)))]
|
42 |
|
|
""
|
43 |
|
|
"cmp.b\t%2,%1\n\tj%C0\t1f\n\tjmp.a\t%l3\n1:"
|
44 |
|
|
; "cmp.b\t%2,%1\n\tj%c0\t%l3"
|
45 |
|
|
[(set_attr "flags" "oszc,oszc,oszc,oszc")]
|
46 |
|
|
)
|
47 |
|
|
|
48 |
|
|
(define_insn "cbranchhi4"
|
49 |
|
|
[(set (pc) (if_then_else
|
50 |
|
|
(match_operator 0 "m32c_cmp_operator"
|
51 |
|
|
[(match_operand:HI 1 "mrai_operand" "Rhi,?Sd,Rhi,?Sd,?Rmm,?Rmm")
|
52 |
|
|
(match_operand:HI 2 "mrai_operand" "iRhiSd,iRhiSd,?Rmm,?Rmm,iRhiSd,?Rmm")])
|
53 |
|
|
(label_ref (match_operand 3 "" ""))
|
54 |
|
|
(pc)))]
|
55 |
|
|
""
|
56 |
|
|
"cmp.w\t%2,%1\n\tj%C0\t1f\n\tjmp.a\t%l3\n1:"
|
57 |
|
|
; "cmp.w\t%2,%1\n\tj%c0\t%l3"
|
58 |
|
|
[(set_attr "flags" "oszc,oszc,oszc,oszc,oszc,oszc")]
|
59 |
|
|
)
|
60 |
|
|
|
61 |
|
|
(define_insn "cbranchpsi4"
|
62 |
|
|
[(set (pc) (if_then_else
|
63 |
|
|
(match_operator 0 "m32c_cmp_operator"
|
64 |
|
|
[(match_operand:PSI 1 "mrai_operand" "RsiSd,RsiSd,?Rmm,?Rmm")
|
65 |
|
|
(match_operand:PSI 2 "mrai_operand" "iRsiSd,?Rmm,iRsiSd,?Rmm")])
|
66 |
|
|
(label_ref (match_operand 3 "" ""))
|
67 |
|
|
(pc)))]
|
68 |
|
|
"TARGET_A24"
|
69 |
|
|
"cmp.l\t%2,%1\n\tj%C0\t1f\n\tjmp.a\t%l3\n1:"
|
70 |
|
|
; "cmp.l\t%2,%1\n\tj%c0\t%l3"
|
71 |
|
|
[(set_attr "flags" "oszc,oszc,oszc,oszc")]
|
72 |
|
|
)
|