xref: /openbmc/qemu/target/tricore/helper.h (revision c09124dc)
1 /*
2  *  Copyright (c) 2012-2014 Bastian Koppelmann C-Lab/University Paderborn
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 /* Arithmetic */
19 DEF_HELPER_3(add_ssov, i32, env, i32, i32)
20 DEF_HELPER_3(add64_ssov, i64, env, i64, i64)
21 DEF_HELPER_3(add_suov, i32, env, i32, i32)
22 DEF_HELPER_3(add_h_ssov, i32, env, i32, i32)
23 DEF_HELPER_3(add_h_suov, i32, env, i32, i32)
24 DEF_HELPER_4(addr_h_ssov, i32, env, i64, i32, i32)
25 DEF_HELPER_4(addsur_h_ssov, i32, env, i64, i32, i32)
26 DEF_HELPER_3(sub_ssov, i32, env, i32, i32)
27 DEF_HELPER_3(sub64_ssov, i64, env, i64, i64)
28 DEF_HELPER_3(sub_suov, i32, env, i32, i32)
29 DEF_HELPER_3(sub_h_ssov, i32, env, i32, i32)
30 DEF_HELPER_3(sub_h_suov, i32, env, i32, i32)
31 DEF_HELPER_4(subr_h_ssov, i32, env, i64, i32, i32)
32 DEF_HELPER_4(subadr_h_ssov, i32, env, i64, i32, i32)
33 DEF_HELPER_3(mul_ssov, i32, env, i32, i32)
34 DEF_HELPER_3(mul_suov, i32, env, i32, i32)
35 DEF_HELPER_3(sha_ssov, i32, env, i32, i32)
36 DEF_HELPER_3(absdif_ssov, i32, env, i32, i32)
37 DEF_HELPER_4(madd32_ssov, i32, env, i32, i32, i32)
38 DEF_HELPER_4(madd32_suov, i32, env, i32, i32, i32)
39 DEF_HELPER_4(madd64_ssov, i64, env, i32, i64, i32)
40 DEF_HELPER_5(madd64_q_ssov, i64, env, i64, i32, i32, i32)
41 DEF_HELPER_3(madd32_q_add_ssov, i32, env, i64, i64)
42 DEF_HELPER_5(maddr_q_ssov, i32, env, i32, i32, i32, i32)
43 DEF_HELPER_4(madd64_suov, i64, env, i32, i64, i32)
44 DEF_HELPER_4(msub32_ssov, i32, env, i32, i32, i32)
45 DEF_HELPER_4(msub32_suov, i32, env, i32, i32, i32)
46 DEF_HELPER_4(msub64_ssov, i64, env, i32, i64, i32)
47 DEF_HELPER_5(msub64_q_ssov, i64, env, i64, i32, i32, i32)
48 DEF_HELPER_3(msub32_q_sub_ssov, i32, env, i64, i64)
49 DEF_HELPER_5(msubr_q_ssov, i32, env, i32, i32, i32, i32)
50 DEF_HELPER_4(msub64_suov, i64, env, i32, i64, i32)
51 DEF_HELPER_3(absdif_h_ssov, i32, env, i32, i32)
52 DEF_HELPER_2(abs_ssov, i32, env, i32)
53 DEF_HELPER_2(abs_h_ssov, i32, env, i32)
54 /* hword/byte arithmetic */
55 DEF_HELPER_2(abs_b, i32, env, i32)
56 DEF_HELPER_2(abs_h, i32, env, i32)
57 DEF_HELPER_3(absdif_b, i32, env, i32, i32)
58 DEF_HELPER_3(absdif_h, i32, env, i32, i32)
59 DEF_HELPER_4(addr_h, i32, env, i64, i32, i32)
60 DEF_HELPER_4(addsur_h, i32, env, i64, i32, i32)
61 DEF_HELPER_5(maddr_q, i32, env, i32, i32, i32, i32)
62 DEF_HELPER_3(add_b, i32, env, i32, i32)
63 DEF_HELPER_3(add_h, i32, env, i32, i32)
64 DEF_HELPER_3(sub_b, i32, env, i32, i32)
65 DEF_HELPER_3(sub_h, i32, env, i32, i32)
66 DEF_HELPER_4(subr_h, i32, env, i64, i32, i32)
67 DEF_HELPER_4(subadr_h, i32, env, i64, i32, i32)
68 DEF_HELPER_5(msubr_q, i32, env, i32, i32, i32, i32)
69 DEF_HELPER_FLAGS_2(eq_b, TCG_CALL_NO_RWG_SE, i32, i32, i32)
70 DEF_HELPER_FLAGS_2(eq_h, TCG_CALL_NO_RWG_SE, i32, i32, i32)
71 DEF_HELPER_FLAGS_2(eqany_b, TCG_CALL_NO_RWG_SE, i32, i32, i32)
72 DEF_HELPER_FLAGS_2(eqany_h, TCG_CALL_NO_RWG_SE, i32, i32, i32)
73 DEF_HELPER_FLAGS_2(lt_b, TCG_CALL_NO_RWG_SE, i32, i32, i32)
74 DEF_HELPER_FLAGS_2(lt_bu, TCG_CALL_NO_RWG_SE, i32, i32, i32)
75 DEF_HELPER_FLAGS_2(lt_h, TCG_CALL_NO_RWG_SE, i32, i32, i32)
76 DEF_HELPER_FLAGS_2(lt_hu, TCG_CALL_NO_RWG_SE, i32, i32, i32)
77 DEF_HELPER_FLAGS_2(max_b, TCG_CALL_NO_RWG_SE, i32, i32, i32)
78 DEF_HELPER_FLAGS_2(max_bu, TCG_CALL_NO_RWG_SE, i32, i32, i32)
79 DEF_HELPER_FLAGS_2(max_h, TCG_CALL_NO_RWG_SE, i32, i32, i32)
80 DEF_HELPER_FLAGS_2(max_hu, TCG_CALL_NO_RWG_SE, i32, i32, i32)
81 DEF_HELPER_FLAGS_2(ixmax, TCG_CALL_NO_RWG_SE, i64, i64, i32)
82 DEF_HELPER_FLAGS_2(ixmax_u, TCG_CALL_NO_RWG_SE, i64, i64, i32)
83 DEF_HELPER_FLAGS_2(min_b, TCG_CALL_NO_RWG_SE, i32, i32, i32)
84 DEF_HELPER_FLAGS_2(min_bu, TCG_CALL_NO_RWG_SE, i32, i32, i32)
85 DEF_HELPER_FLAGS_2(min_h, TCG_CALL_NO_RWG_SE, i32, i32, i32)
86 DEF_HELPER_FLAGS_2(min_hu, TCG_CALL_NO_RWG_SE, i32, i32, i32)
87 DEF_HELPER_FLAGS_2(ixmin, TCG_CALL_NO_RWG_SE, i64, i64, i32)
88 DEF_HELPER_FLAGS_2(ixmin_u, TCG_CALL_NO_RWG_SE, i64, i64, i32)
89 /* count leading ... */
90 DEF_HELPER_FLAGS_1(clo_h, TCG_CALL_NO_RWG_SE, i32, i32)
91 DEF_HELPER_FLAGS_1(clz_h, TCG_CALL_NO_RWG_SE, i32, i32)
92 DEF_HELPER_FLAGS_1(cls_h, TCG_CALL_NO_RWG_SE, i32, i32)
93 /* sh */
94 DEF_HELPER_FLAGS_2(sh, TCG_CALL_NO_RWG_SE, i32, i32, i32)
95 DEF_HELPER_FLAGS_2(sh_h, TCG_CALL_NO_RWG_SE, i32, i32, i32)
96 DEF_HELPER_3(sha, i32, env, i32, i32)
97 DEF_HELPER_2(sha_h, i32, i32, i32)
98 /* merge/split/parity */
99 DEF_HELPER_FLAGS_2(bmerge, TCG_CALL_NO_RWG_SE, i32, i32, i32)
100 DEF_HELPER_FLAGS_1(bsplit, TCG_CALL_NO_RWG_SE, i64, i32)
101 DEF_HELPER_FLAGS_1(parity, TCG_CALL_NO_RWG_SE, i32, i32)
102 /* float */
103 DEF_HELPER_FLAGS_4(pack, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32, i32)
104 DEF_HELPER_1(unpack, i64, i32)
105 DEF_HELPER_3(fadd, i32, env, i32, i32)
106 DEF_HELPER_3(fsub, i32, env, i32, i32)
107 DEF_HELPER_3(fmul, i32, env, i32, i32)
108 DEF_HELPER_3(fdiv, i32, env, i32, i32)
109 DEF_HELPER_4(fmadd, i32, env, i32, i32, i32)
110 DEF_HELPER_4(fmsub, i32, env, i32, i32, i32)
111 DEF_HELPER_3(fcmp, i32, env, i32, i32)
112 DEF_HELPER_2(qseed, i32, env, i32)
113 DEF_HELPER_2(ftoi, i32, env, i32)
114 DEF_HELPER_2(itof, i32, env, i32)
115 DEF_HELPER_2(utof, i32, env, i32)
116 DEF_HELPER_2(ftoiz, i32, env, i32)
117 DEF_HELPER_2(ftouz, i32, env, i32)
118 DEF_HELPER_2(updfl, void, env, i32)
119 /* dvinit */
120 DEF_HELPER_3(dvinit_b_13, i64, env, i32, i32)
121 DEF_HELPER_3(dvinit_b_131, i64, env, i32, i32)
122 DEF_HELPER_3(dvinit_h_13, i64, env, i32, i32)
123 DEF_HELPER_3(dvinit_h_131, i64, env, i32, i32)
124 DEF_HELPER_FLAGS_2(dvadj, TCG_CALL_NO_RWG_SE, i64, i64, i32)
125 DEF_HELPER_FLAGS_2(dvstep, TCG_CALL_NO_RWG_SE, i64, i64, i32)
126 DEF_HELPER_FLAGS_2(dvstep_u, TCG_CALL_NO_RWG_SE, i64, i64, i32)
127 DEF_HELPER_3(divide, i64, env, i32, i32)
128 DEF_HELPER_3(divide_u, i64, env, i32, i32)
129 /* mulh */
130 DEF_HELPER_FLAGS_5(mul_h, TCG_CALL_NO_RWG_SE, i64, i32, i32, i32, i32, i32)
131 DEF_HELPER_FLAGS_5(mulm_h, TCG_CALL_NO_RWG_SE, i64, i32, i32, i32, i32, i32)
132 DEF_HELPER_FLAGS_5(mulr_h, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32, i32, i32)
133 /* crc32 */
134 DEF_HELPER_FLAGS_2(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32)
135 /* CSA */
136 DEF_HELPER_2(call, void, env, i32)
137 DEF_HELPER_1(ret, void, env)
138 DEF_HELPER_2(bisr, void, env, i32)
139 DEF_HELPER_1(rfe, void, env)
140 DEF_HELPER_1(rfm, void, env)
141 DEF_HELPER_2(ldlcx, void, env, i32)
142 DEF_HELPER_2(lducx, void, env, i32)
143 DEF_HELPER_2(stlcx, void, env, i32)
144 DEF_HELPER_2(stucx, void, env, i32)
145 DEF_HELPER_1(svlcx, void, env)
146 DEF_HELPER_1(svucx, void, env)
147 DEF_HELPER_1(rslcx, void, env)
148 /* Address mode helper */
149 DEF_HELPER_1(br_update, i32, i32)
150 DEF_HELPER_2(circ_update, i32, i32, i32)
151 /* PSW cache helper */
152 DEF_HELPER_2(psw_write, void, env, i32)
153 DEF_HELPER_1(psw_read, i32, env)
154 /* Exceptions */
155 DEF_HELPER_3(raise_exception_sync, noreturn, env, i32, i32)
156 DEF_HELPER_2(qemu_excp, noreturn, env, i32)
157