1 ;; Machine Descriptions for R8C/M16C/M32C
3 ;; Free Software Foundation, Inc.
4 ;; Contributed by Red Hat.
6 ;; This file is part of GCC.
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.
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.
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
23 ;; jump, conditionals, calls, etc
25 (define_insn "indirect_jump_16"
27 (match_operand:HI 0 "register_operand" "Rhi"))]
30 ; no 16 bit jmpi in r8c
31 "push.b #0 | push.w\t%0 | rts"
32 [(set_attr "flags" "x")]
35 (define_insn "indirect_jump_24"
37 (match_operand:PSI 0 "register_operand" "Rpi"))]
40 [(set_attr "flags" "n")]
43 (define_expand "indirect_jump"
44 [(match_operand 0 "register_operand" "")]
47 emit_jump_insn (gen_indirect_jump_16(operands[0]));
49 emit_jump_insn (gen_indirect_jump_24(operands[0]));
53 ; We can replace this with jmp.s when gas supports relaxing. m32c
54 ; opcodes are too complicated to try to compute their sizes here, it's
55 ; far easier (and more reliable) to let gas worry about it.
58 (label_ref (match_operand 0 "" "")))]
61 [(set_attr "flags" "n")]
64 ; No 16 bit indirect calls on r8c/m16c. */
66 [(call (match_operand:QI 0 "memory_operand" "Si,SaSb,?Rmm")
67 (match_operand 1 "" ""))
68 (use (match_operand 2 "immediate_operand" ""))]
71 switch (which_alternative) {
72 case 0: return \"jsr.a\t%0\";
73 case 1: return TARGET_A16 ? \"push.w %a0 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a0\";
74 case 2: return \"jsri.a\t%a0\";
76 [(set_attr "flags" "x")]
79 (define_insn "call_value"
80 [(set (match_operand 0 "m32c_return_operand" "=RdiRmmRpa,RdiRmmRpa,RdiRmmRpa")
81 (call (match_operand:QI 1 "memory_operand" "Si,SaSb,?Rmm")
82 (match_operand 2 "" "")))
83 (use (match_operand 3 "immediate_operand" ""))]
86 switch (which_alternative) {
87 case 0: return \"jsr.a\t%1\";
88 case 1: return TARGET_A16 ? \"push.w %a1 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a1\";
89 case 2: return \"jsri.a\t%a1\";
91 [(set_attr "flags" "x,x,x")]