comparison gcc/config/h8300/proepi.md @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 ;; ----------------------------------------------------------------------
2 ;; PROLOGUE/EPILOGUE-RELATED INSTRUCTIONS
3 ;; ----------------------------------------------------------------------
4
5 (define_expand "push_h8300hs_advanced"
6 [(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
7 (match_operand:SI 0 "register_operand" ""))]
8 "TARGET_H8300H && TARGET_H8300S && !TARGET_NORMAL_MODE"
9 "")
10
11 (define_expand "push_h8300hs_normal"
12 [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
13 (match_operand:SI 0 "register_operand" ""))]
14 "TARGET_H8300H && TARGET_H8300S && TARGET_NORMAL_MODE"
15 "")
16
17 (define_expand "pop_h8300hs_advanced"
18 [(set (match_operand:SI 0 "register_operand" "")
19 (mem:SI (post_inc:SI (reg:SI SP_REG))))]
20 "TARGET_H8300H && TARGET_H8300S && !TARGET_NORMAL_MODE"
21 "")
22
23 (define_expand "pop_h8300hs_normal"
24 [(set (match_operand:SI 0 "register_operand" "")
25 (mem:SI (post_inc:HI (reg:HI SP_REG))))]
26 "TARGET_H8300H && TARGET_H8300S && TARGET_NORMAL_MODE"
27 "")
28
29 (define_insn "ldm_h8300sx"
30 [(match_parallel 0 "h8300_ldm_parallel"
31 [(set (match_operand:SI 1 "register_operand" "")
32 (match_operand:SI 2 "memory_operand" ""))])]
33 "TARGET_H8300S"
34 {
35 operands[3] = SET_DEST (XVECEXP (operands[0], 0,
36 XVECLEN (operands[0], 0) - 2));
37 return "ldm.l\t@er7+,%S1-%S3";
38 }
39 [(set_attr "cc" "none")
40 (set_attr "length" "4")])
41
42 (define_insn "stm_h8300sx"
43 [(match_parallel 0 "h8300_stm_parallel"
44 [(set (match_operand:SI 1 "memory_operand" "")
45 (match_operand:SI 2 "register_operand" ""))])]
46 "TARGET_H8300S"
47 {
48 operands[3] = SET_SRC (XVECEXP (operands[0], 0,
49 XVECLEN (operands[0], 0) - 2));
50 return "stm.l\t%S2-%S3,@-er7";
51 }
52 [(set_attr "cc" "none")
53 (set_attr "length" "4")])
54
55 (define_insn "return_h8sx"
56 [(match_parallel 0 "h8300_return_parallel"
57 [(return)
58 (set (match_operand:SI 1 "register_operand" "")
59 (match_operand:SI 2 "memory_operand" ""))])]
60 "TARGET_H8300SX"
61 {
62 operands[3] = SET_DEST (XVECEXP (operands[0], 0,
63 XVECLEN (operands[0], 0) - 2));
64 if (h8300_current_function_interrupt_function_p ()
65 || h8300_current_function_monitor_function_p ())
66 return "rte/l\t%S1-%S3";
67 else
68 return "rts/l\t%S1-%S3";
69 }
70 [(set_attr "cc" "none")
71 (set_attr "can_delay" "no")
72 (set_attr "length" "2")])
73
74 (define_expand "return"
75 [(return)]
76 "h8300_can_use_return_insn_p ()"
77 "")
78
79 (define_insn "*return_1"
80 [(return)]
81 "reload_completed"
82 {
83 if (h8300_current_function_interrupt_function_p ()
84 || h8300_current_function_monitor_function_p ())
85 return "rte";
86 else
87 return "rts";
88 }
89 [(set_attr "cc" "none")
90 (set_attr "can_delay" "no")
91 (set_attr "length" "2")])
92
93 (define_expand "prologue"
94 [(const_int 0)]
95 ""
96 {
97 h8300_expand_prologue ();
98 DONE;
99 })
100
101 (define_expand "epilogue"
102 [(return)]
103 ""
104 {
105 h8300_expand_epilogue ();
106 DONE;
107 })
108
109 (define_insn "monitor_prologue"
110 [(unspec_volatile [(const_int 0)] UNSPEC_MONITOR)]
111 ""
112 {
113 if (TARGET_H8300H && TARGET_NORMAL_MODE)
114 return "subs\\t#2,er7\;mov.l\\ter0,@-er7\;stc\\tccr,r0l\;mov.b\\tr0l,@(4,er7)\;mov.l\\t@er7+,er0\;orc\\t#128,ccr";
115 else if (TARGET_H8300H)
116 return "mov.l\\ter0,@-er7\;stc\\tccr,r0l\;mov.b\\tr0l,@(4,er7)\;mov.l\\t@er7+,er0\;orc\\t#128,ccr";
117 else if (TARGET_H8300S && TARGET_NEXR )
118 return "mov.l\\ter0,@-er7\;stc\tccr,r0l\;mov.b\tr0l,@(4,er7)\;mov.l\\t@er7+,er0\;orc\t#128,ccr";
119 else if (TARGET_H8300S && TARGET_NEXR && TARGET_NORMAL_MODE)
120 return "subs\\t#2,er7\;mov.l\\ter0,@-er7\;stc\tccr,r0l\;mov.b\tr0l,@(4,er7)\;mov.l\\t@er7+,er0\;orc\t#128,ccr";
121 else if (TARGET_H8300S && TARGET_NORMAL_MODE)
122 return "subs\\t#2,er7\;stc\texr,@-er7\;mov.l\\ter0,@-er7\;stc\tccr,r0l\;mov.b\tr0l,@(6,er7)\;mov.l\\t@er7+,er0\;orc\t#128,ccr";
123 else if (TARGET_H8300S)
124 return "stc\texr,@-er7\;mov.l\\ter0,@-er7\;stc\tccr,r0l\;mov.b\tr0l,@(6,er7)\;mov.l\\t@er7+,er0\;orc\t#128,ccr";
125 gcc_unreachable ();
126 }
127 [(set_attr "length" "20")])