OSDN Git Service

* config/m32c/cond.md: Set condition flags properly throughout.
[pf3gnuchains/gcc-fork.git] / gcc / config / m32c / m32c.md
1 ;; 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 (define_constants
24   [(R0_REGNO 0)
25    (R2_REGNO 1)
26    (R1_REGNO 2)
27    (R3_REGNO 3)
28
29    (A0_REGNO 4)
30    (A1_REGNO 5)
31    (SB_REGNO 6)
32    (FB_REGNO 7)
33
34    (SP_REGNO 8)
35    (PC_REGNO 9)
36    (FLG_REGNO 10)
37    (MEM0_REGNO 12)
38    (MEM7_REGNO 19)
39    ])
40
41 (define_constants
42   [(UNS_PROLOGUE_END 1)
43    (UNS_EPILOGUE_START 2)
44    (UNS_EH_EPILOGUE 3)
45    (UNS_PUSHM 4)
46    (UNS_POPM 5)
47    (UNS_SMOVF 6)
48    (UNS_SSTR 7)
49    (UNS_SCMPU 8)
50    (UNS_SMOVU 9)
51    ])
52
53 ;; n = no change, x = clobbered.  The first 16 values are chosen such
54 ;; that the enum has one bit set for each flag.
55 (define_attr "flags" "x,c,z,zc,s,sc,sz,szc,o,oc,oz,ozc,os,osc,osz,oszc,n" (const_string "n"))
56 (define_asm_attributes [(set_attr "flags" "x")])
57
58 (define_mode_macro QHI [QI HI])
59 (define_mode_macro HPSI [(HI "TARGET_A16") (PSI "TARGET_A24")])
60 (define_mode_macro QHPSI [QI HI (PSI "TARGET_A24")])
61 (define_mode_macro QHSI [QI HI (SI "TARGET_A24")])
62 (define_mode_attr bwl [(QI "b") (HI "w") (PSI "l") (SI "l")])
63
64 (define_code_macro any_cond [eq ne gt ge lt le gtu geu ltu leu])
65 (define_code_macro eqne_cond [eq ne])
66 (define_code_macro gl_cond [gt ge lt le gtu geu ltu leu])
67
68
69
70 (define_insn "nop"
71   [(const_int 0)]
72   ""
73   "nop"
74   [(set_attr "flags" "n")]
75 )
76
77 (define_insn "no_insn"
78   [(const_int 1)]
79   ""
80   ""
81   [(set_attr "flags" "n")]
82 )