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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [config/] [m32c/] [jump.md] - Blame information for rev 199

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
;; Machine Descriptions for R8C/M16C/M32C
2
;; Copyright (C) 2005, 2007
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 3, 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 COPYING3.  If not see
20
;; .
21
 
22
;; jump, conditionals, calls, etc
23
 
24
(define_insn "indirect_jump_16"
25
  [(set (pc)
26
       (match_operand:HI 0 "register_operand" "Rhi"))]
27
  "TARGET_A16"
28
;  "jmpi.a\t%0"
29
  ; no 16 bit jmpi in r8c
30
  "push.b #0 | push.w\t%0 | rts"
31
  [(set_attr "flags" "x")]
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
  [(set_attr "flags" "n")]
40
  )
41
 
42
(define_expand "indirect_jump"
43
  [(match_operand 0 "register_operand" "")]
44
  ""
45
  "if (TARGET_A16)
46
     emit_jump_insn (gen_indirect_jump_16(operands[0]));
47
   else
48
     emit_jump_insn (gen_indirect_jump_24(operands[0]));
49
   DONE;"
50
  )
51
 
52
; We can replace this with jmp.s when gas supports relaxing.  m32c
53
; opcodes are too complicated to try to compute their sizes here, it's
54
; far easier (and more reliable) to let gas worry about it.
55
(define_insn "jump"
56
  [(set (pc)
57
        (label_ref (match_operand 0 "" "")))]
58
  ""
59
  "jmp.a\t%l0"
60
  [(set_attr "flags" "n")]
61
)
62
 
63
; No 16 bit indirect calls on r8c/m16c.  */
64
(define_insn "call"
65
  [(call (match_operand:QI 0 "memory_operand" "Si,SaSb,?Rmm")
66
         (match_operand 1 "" ""))
67
   (use (match_operand 2 "immediate_operand" ""))]
68
  ""
69
  "*
70
switch (which_alternative) {
71
  case 0: return \"jsr.a\t%0\";
72
  case 1: return TARGET_A16 ? \"push.w %a0 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a0\";
73
  case 2: return \"jsri.a\t%a0\";
74
}"
75
  [(set_attr "flags" "x")]
76
  )
77
 
78
(define_insn "call_value"
79
  [(set (match_operand 0 "m32c_return_operand" "=RdiRmmRpa,RdiRmmRpa,RdiRmmRpa")
80
        (call (match_operand:QI 1 "memory_operand" "Si,SaSb,?Rmm")
81
              (match_operand 2 "" "")))
82
   (use (match_operand 3 "immediate_operand" ""))]
83
  ""
84
  "*
85
switch (which_alternative) {
86
  case 0: return \"jsr.a\t%1\";
87
  case 1: return TARGET_A16 ? \"push.w %a1 | jsr.a\tm32c_jsri16\" : \"jsri.a\t%a1\";
88
  case 2: return \"jsri.a\t%a1\";
89
}"
90
  [(set_attr "flags" "x,x,x")]
91
  )

powered by: WebSVN 2.1.0

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