OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [config/] [m32c/] [jump.md] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
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
;; jump, conditionals, calls, etc
24
 
25
(define_insn "indirect_jump_16"
26
  [(set (pc)
27
       (match_operand:HI 0 "register_operand" "Rhi"))]
28
  "TARGET_A16"
29
;  "jmpi.a\t%0"
30
  ; no 16 bit jmpi in r8c
31
  "push.b #0 | push.w\t%0 | rts"
32
  )
33
 
34
(define_insn "indirect_jump_24"
35
  [(set (pc)
36
       (match_operand:PSI 0 "register_operand" "Rpi"))]
37
  "TARGET_A24"
38
  "jmpi.a\t%0"
39
  )
40
 
41
(define_expand "indirect_jump"
42
  [(match_operand 0 "register_operand" "")]
43
  ""
44
  "if (TARGET_A16)
45
     emit_jump_insn (gen_indirect_jump_16(operands[0]));
46
   else
47
     emit_jump_insn (gen_indirect_jump_24(operands[0]));
48
   DONE;"
49
  )
50
 
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.
54
(define_insn "jump"
55
  [(set (pc)
56
        (label_ref (match_operand 0 "" "")))]
57
  ""
58
  "jmp.a\t%l0"
59
)
60
 
61
; No 16 bit indirect calls on r8c/m16c.  */
62
(define_insn "call"
63
  [(call (match_operand:QI 0 "memory_operand" "Si,SaSb,?Rmm")
64
         (match_operand 1 "" ""))
65
   (use (match_operand 2 "immediate_operand" ""))]
66
  ""
67
  "*
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\";
72
}"
73
  )
74
 
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" ""))]
80
  ""
81
  "*
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\";
86
}"
87
  )

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.