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"
34 (define_insn "indirect_jump_24"
36 (match_operand:PSI 0 "register_operand" "Rpi"))]
41 (define_expand "indirect_jump"
42 [(match_operand 0 "register_operand" "")]
45 emit_jump_insn (gen_indirect_jump_16(operands[0]));
47 emit_jump_insn (gen_indirect_jump_24(operands[0]));
51 ; We can replace this with jmp.s when gas supports relaxing. m32c
52 ; opcodes are too complicated to try to compute their sizes here, it's
53 ; far easier (and more reliable) to let gas worry about it.
56 (label_ref (match_operand 0 "" "")))]
61 ; No 16 bit indirect calls on r8c/m16c. */
63 [(call (match_operand:QI 0 "memory_operand" "Si,SaSb,?Rmm")
64 (match_operand 1 "" ""))
65 (use (match_operand 2 "immediate_operand" ""))]
68 switch (which_alternative) {
69 case 0: return \"jsr.a\t%0\";
70 case 1: return TARGET_A16 ? \"push.w %a0 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a0\";
71 case 2: return \"jsri.a\t%a0\";
75 (define_insn "call_value"
76 [(set (match_operand 0 "m32c_return_operand" "=RdiRmmRpa,RdiRmmRpa,RdiRmmRpa")
77 (call (match_operand:QI 1 "memory_operand" "Si,SaSb,?Rmm")
78 (match_operand 2 "" "")))
79 (use (match_operand 3 "immediate_operand" ""))]
82 switch (which_alternative) {
83 case 0: return \"jsr.a\t%1\";
84 case 1: return TARGET_A16 ? \"push.w %a1 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a1\";
85 case 2: return \"jsri.a\t%a1\";