1 #include "exec/def-helper.h" 2 3 DEF_HELPER_3(raise_exception_err, void, env, i32, int) 4 DEF_HELPER_2(raise_exception, void, env, i32) 5 DEF_HELPER_1(interrupt_restart, void, env) 6 7 #ifdef TARGET_MIPS64 8 DEF_HELPER_4(ldl, tl, env, tl, tl, int) 9 DEF_HELPER_4(ldr, tl, env, tl, tl, int) 10 DEF_HELPER_4(sdl, void, env, tl, tl, int) 11 DEF_HELPER_4(sdr, void, env, tl, tl, int) 12 #endif 13 DEF_HELPER_4(lwl, tl, env, tl, tl, int) 14 DEF_HELPER_4(lwr, tl, env, tl, tl, int) 15 DEF_HELPER_4(swl, void, env, tl, tl, int) 16 DEF_HELPER_4(swr, void, env, tl, tl, int) 17 18 #ifndef CONFIG_USER_ONLY 19 DEF_HELPER_3(ll, tl, env, tl, int) 20 DEF_HELPER_4(sc, tl, env, tl, tl, int) 21 #ifdef TARGET_MIPS64 22 DEF_HELPER_3(lld, tl, env, tl, int) 23 DEF_HELPER_4(scd, tl, env, tl, tl, int) 24 #endif 25 #endif 26 27 DEF_HELPER_FLAGS_1(clo, TCG_CALL_NO_RWG_SE, tl, tl) 28 DEF_HELPER_FLAGS_1(clz, TCG_CALL_NO_RWG_SE, tl, tl) 29 #ifdef TARGET_MIPS64 30 DEF_HELPER_FLAGS_1(dclo, TCG_CALL_NO_RWG_SE, tl, tl) 31 DEF_HELPER_FLAGS_1(dclz, TCG_CALL_NO_RWG_SE, tl, tl) 32 DEF_HELPER_2(dmult, void, tl, tl) 33 DEF_HELPER_2(dmultu, void, tl, tl) 34 #endif 35 36 DEF_HELPER_3(muls, tl, env, tl, tl) 37 DEF_HELPER_3(mulsu, tl, env, tl, tl) 38 DEF_HELPER_3(macc, tl, env, tl, tl) 39 DEF_HELPER_3(maccu, tl, env, tl, tl) 40 DEF_HELPER_3(msac, tl, env, tl, tl) 41 DEF_HELPER_3(msacu, tl, env, tl, tl) 42 DEF_HELPER_3(mulhi, tl, env, tl, tl) 43 DEF_HELPER_3(mulhiu, tl, env, tl, tl) 44 DEF_HELPER_3(mulshi, tl, env, tl, tl) 45 DEF_HELPER_3(mulshiu, tl, env, tl, tl) 46 DEF_HELPER_3(macchi, tl, env, tl, tl) 47 DEF_HELPER_3(macchiu, tl, env, tl, tl) 48 DEF_HELPER_3(msachi, tl, env, tl, tl) 49 DEF_HELPER_3(msachiu, tl, env, tl, tl) 50 51 #ifndef CONFIG_USER_ONLY 52 /* CP0 helpers */ 53 DEF_HELPER_1(mfc0_mvpcontrol, tl, env) 54 DEF_HELPER_1(mfc0_mvpconf0, tl, env) 55 DEF_HELPER_1(mfc0_mvpconf1, tl, env) 56 DEF_HELPER_1(mfc0_random, tl, env) 57 DEF_HELPER_1(mfc0_tcstatus, tl, env) 58 DEF_HELPER_1(mftc0_tcstatus, tl, env) 59 DEF_HELPER_1(mfc0_tcbind, tl, env) 60 DEF_HELPER_1(mftc0_tcbind, tl, env) 61 DEF_HELPER_1(mfc0_tcrestart, tl, env) 62 DEF_HELPER_1(mftc0_tcrestart, tl, env) 63 DEF_HELPER_1(mfc0_tchalt, tl, env) 64 DEF_HELPER_1(mftc0_tchalt, tl, env) 65 DEF_HELPER_1(mfc0_tccontext, tl, env) 66 DEF_HELPER_1(mftc0_tccontext, tl, env) 67 DEF_HELPER_1(mfc0_tcschedule, tl, env) 68 DEF_HELPER_1(mftc0_tcschedule, tl, env) 69 DEF_HELPER_1(mfc0_tcschefback, tl, env) 70 DEF_HELPER_1(mftc0_tcschefback, tl, env) 71 DEF_HELPER_1(mfc0_count, tl, env) 72 DEF_HELPER_1(mftc0_entryhi, tl, env) 73 DEF_HELPER_1(mftc0_status, tl, env) 74 DEF_HELPER_1(mfc0_lladdr, tl, env) 75 DEF_HELPER_2(mfc0_watchlo, tl, env, i32) 76 DEF_HELPER_2(mfc0_watchhi, tl, env, i32) 77 DEF_HELPER_1(mfc0_debug, tl, env) 78 DEF_HELPER_1(mftc0_debug, tl, env) 79 #ifdef TARGET_MIPS64 80 DEF_HELPER_1(dmfc0_tcrestart, tl, env) 81 DEF_HELPER_1(dmfc0_tchalt, tl, env) 82 DEF_HELPER_1(dmfc0_tccontext, tl, env) 83 DEF_HELPER_1(dmfc0_tcschedule, tl, env) 84 DEF_HELPER_1(dmfc0_tcschefback, tl, env) 85 DEF_HELPER_1(dmfc0_lladdr, tl, env) 86 DEF_HELPER_2(dmfc0_watchlo, tl, env, i32) 87 #endif /* TARGET_MIPS64 */ 88 89 DEF_HELPER_2(mtc0_index, void, env, tl) 90 DEF_HELPER_2(mtc0_mvpcontrol, void, env, tl) 91 DEF_HELPER_2(mtc0_vpecontrol, void, env, tl) 92 DEF_HELPER_2(mtc0_vpeconf0, void, env, tl) 93 DEF_HELPER_2(mtc0_vpeconf1, void, env, tl) 94 DEF_HELPER_2(mtc0_yqmask, void, env, tl) 95 DEF_HELPER_2(mtc0_vpeopt, void, env, tl) 96 DEF_HELPER_2(mtc0_entrylo0, void, env, tl) 97 DEF_HELPER_2(mtc0_tcstatus, void, env, tl) 98 DEF_HELPER_2(mttc0_tcstatus, void, env, tl) 99 DEF_HELPER_2(mtc0_tcbind, void, env, tl) 100 DEF_HELPER_2(mttc0_tcbind, void, env, tl) 101 DEF_HELPER_2(mtc0_tcrestart, void, env, tl) 102 DEF_HELPER_2(mttc0_tcrestart, void, env, tl) 103 DEF_HELPER_2(mtc0_tchalt, void, env, tl) 104 DEF_HELPER_2(mttc0_tchalt, void, env, tl) 105 DEF_HELPER_2(mtc0_tccontext, void, env, tl) 106 DEF_HELPER_2(mttc0_tccontext, void, env, tl) 107 DEF_HELPER_2(mtc0_tcschedule, void, env, tl) 108 DEF_HELPER_2(mttc0_tcschedule, void, env, tl) 109 DEF_HELPER_2(mtc0_tcschefback, void, env, tl) 110 DEF_HELPER_2(mttc0_tcschefback, void, env, tl) 111 DEF_HELPER_2(mtc0_entrylo1, void, env, tl) 112 DEF_HELPER_2(mtc0_context, void, env, tl) 113 DEF_HELPER_2(mtc0_pagemask, void, env, tl) 114 DEF_HELPER_2(mtc0_pagegrain, void, env, tl) 115 DEF_HELPER_2(mtc0_wired, void, env, tl) 116 DEF_HELPER_2(mtc0_srsconf0, void, env, tl) 117 DEF_HELPER_2(mtc0_srsconf1, void, env, tl) 118 DEF_HELPER_2(mtc0_srsconf2, void, env, tl) 119 DEF_HELPER_2(mtc0_srsconf3, void, env, tl) 120 DEF_HELPER_2(mtc0_srsconf4, void, env, tl) 121 DEF_HELPER_2(mtc0_hwrena, void, env, tl) 122 DEF_HELPER_2(mtc0_count, void, env, tl) 123 DEF_HELPER_2(mtc0_entryhi, void, env, tl) 124 DEF_HELPER_2(mttc0_entryhi, void, env, tl) 125 DEF_HELPER_2(mtc0_compare, void, env, tl) 126 DEF_HELPER_2(mtc0_status, void, env, tl) 127 DEF_HELPER_2(mttc0_status, void, env, tl) 128 DEF_HELPER_2(mtc0_intctl, void, env, tl) 129 DEF_HELPER_2(mtc0_srsctl, void, env, tl) 130 DEF_HELPER_2(mtc0_cause, void, env, tl) 131 DEF_HELPER_2(mtc0_ebase, void, env, tl) 132 DEF_HELPER_2(mtc0_config0, void, env, tl) 133 DEF_HELPER_2(mtc0_config2, void, env, tl) 134 DEF_HELPER_2(mtc0_lladdr, void, env, tl) 135 DEF_HELPER_3(mtc0_watchlo, void, env, tl, i32) 136 DEF_HELPER_3(mtc0_watchhi, void, env, tl, i32) 137 DEF_HELPER_2(mtc0_xcontext, void, env, tl) 138 DEF_HELPER_2(mtc0_framemask, void, env, tl) 139 DEF_HELPER_2(mtc0_debug, void, env, tl) 140 DEF_HELPER_2(mttc0_debug, void, env, tl) 141 DEF_HELPER_2(mtc0_performance0, void, env, tl) 142 DEF_HELPER_2(mtc0_taglo, void, env, tl) 143 DEF_HELPER_2(mtc0_datalo, void, env, tl) 144 DEF_HELPER_2(mtc0_taghi, void, env, tl) 145 DEF_HELPER_2(mtc0_datahi, void, env, tl) 146 147 /* MIPS MT functions */ 148 DEF_HELPER_2(mftgpr, tl, env, i32) 149 DEF_HELPER_2(mftlo, tl, env, i32) 150 DEF_HELPER_2(mfthi, tl, env, i32) 151 DEF_HELPER_2(mftacx, tl, env, i32) 152 DEF_HELPER_1(mftdsp, tl, env) 153 DEF_HELPER_3(mttgpr, void, env, tl, i32) 154 DEF_HELPER_3(mttlo, void, env, tl, i32) 155 DEF_HELPER_3(mtthi, void, env, tl, i32) 156 DEF_HELPER_3(mttacx, void, env, tl, i32) 157 DEF_HELPER_2(mttdsp, void, env, tl) 158 DEF_HELPER_0(dmt, tl) 159 DEF_HELPER_0(emt, tl) 160 DEF_HELPER_1(dvpe, tl, env) 161 DEF_HELPER_1(evpe, tl, env) 162 #endif /* !CONFIG_USER_ONLY */ 163 DEF_HELPER_2(fork, void, tl, tl) 164 DEF_HELPER_2(yield, tl, env, tl) 165 166 /* CP1 functions */ 167 DEF_HELPER_2(cfc1, tl, env, i32) 168 DEF_HELPER_3(ctc1, void, env, tl, i32) 169 170 DEF_HELPER_2(float_cvtd_s, i64, env, i32) 171 DEF_HELPER_2(float_cvtd_w, i64, env, i32) 172 DEF_HELPER_2(float_cvtd_l, i64, env, i64) 173 DEF_HELPER_2(float_cvtl_d, i64, env, i64) 174 DEF_HELPER_2(float_cvtl_s, i64, env, i32) 175 DEF_HELPER_2(float_cvtps_pw, i64, env, i64) 176 DEF_HELPER_2(float_cvtpw_ps, i64, env, i64) 177 DEF_HELPER_2(float_cvts_d, i32, env, i64) 178 DEF_HELPER_2(float_cvts_w, i32, env, i32) 179 DEF_HELPER_2(float_cvts_l, i32, env, i64) 180 DEF_HELPER_2(float_cvts_pl, i32, env, i32) 181 DEF_HELPER_2(float_cvts_pu, i32, env, i32) 182 DEF_HELPER_2(float_cvtw_s, i32, env, i32) 183 DEF_HELPER_2(float_cvtw_d, i32, env, i64) 184 185 DEF_HELPER_3(float_addr_ps, i64, env, i64, i64) 186 DEF_HELPER_3(float_mulr_ps, i64, env, i64, i64) 187 188 #define FOP_PROTO(op) \ 189 DEF_HELPER_2(float_ ## op ## l_s, i64, env, i32) \ 190 DEF_HELPER_2(float_ ## op ## l_d, i64, env, i64) \ 191 DEF_HELPER_2(float_ ## op ## w_s, i32, env, i32) \ 192 DEF_HELPER_2(float_ ## op ## w_d, i32, env, i64) 193 FOP_PROTO(round) 194 FOP_PROTO(trunc) 195 FOP_PROTO(ceil) 196 FOP_PROTO(floor) 197 #undef FOP_PROTO 198 199 #define FOP_PROTO(op) \ 200 DEF_HELPER_2(float_ ## op ## _s, i32, env, i32) \ 201 DEF_HELPER_2(float_ ## op ## _d, i64, env, i64) 202 FOP_PROTO(sqrt) 203 FOP_PROTO(rsqrt) 204 FOP_PROTO(recip) 205 #undef FOP_PROTO 206 207 #define FOP_PROTO(op) \ 208 DEF_HELPER_1(float_ ## op ## _s, i32, i32) \ 209 DEF_HELPER_1(float_ ## op ## _d, i64, i64) \ 210 DEF_HELPER_1(float_ ## op ## _ps, i64, i64) 211 FOP_PROTO(abs) 212 FOP_PROTO(chs) 213 #undef FOP_PROTO 214 215 #define FOP_PROTO(op) \ 216 DEF_HELPER_2(float_ ## op ## _s, i32, env, i32) \ 217 DEF_HELPER_2(float_ ## op ## _d, i64, env, i64) \ 218 DEF_HELPER_2(float_ ## op ## _ps, i64, env, i64) 219 FOP_PROTO(recip1) 220 FOP_PROTO(rsqrt1) 221 #undef FOP_PROTO 222 223 #define FOP_PROTO(op) \ 224 DEF_HELPER_3(float_ ## op ## _s, i32, env, i32, i32) \ 225 DEF_HELPER_3(float_ ## op ## _d, i64, env, i64, i64) \ 226 DEF_HELPER_3(float_ ## op ## _ps, i64, env, i64, i64) 227 FOP_PROTO(add) 228 FOP_PROTO(sub) 229 FOP_PROTO(mul) 230 FOP_PROTO(div) 231 FOP_PROTO(recip2) 232 FOP_PROTO(rsqrt2) 233 #undef FOP_PROTO 234 235 #define FOP_PROTO(op) \ 236 DEF_HELPER_4(float_ ## op ## _s, i32, env, i32, i32, i32) \ 237 DEF_HELPER_4(float_ ## op ## _d, i64, env, i64, i64, i64) \ 238 DEF_HELPER_4(float_ ## op ## _ps, i64, env, i64, i64, i64) 239 FOP_PROTO(muladd) 240 FOP_PROTO(mulsub) 241 FOP_PROTO(nmuladd) 242 FOP_PROTO(nmulsub) 243 #undef FOP_PROTO 244 245 #define FOP_PROTO(op) \ 246 DEF_HELPER_4(cmp_d_ ## op, void, env, i64, i64, int) \ 247 DEF_HELPER_4(cmpabs_d_ ## op, void, env, i64, i64, int) \ 248 DEF_HELPER_4(cmp_s_ ## op, void, env, i32, i32, int) \ 249 DEF_HELPER_4(cmpabs_s_ ## op, void, env, i32, i32, int) \ 250 DEF_HELPER_4(cmp_ps_ ## op, void, env, i64, i64, int) \ 251 DEF_HELPER_4(cmpabs_ps_ ## op, void, env, i64, i64, int) 252 FOP_PROTO(f) 253 FOP_PROTO(un) 254 FOP_PROTO(eq) 255 FOP_PROTO(ueq) 256 FOP_PROTO(olt) 257 FOP_PROTO(ult) 258 FOP_PROTO(ole) 259 FOP_PROTO(ule) 260 FOP_PROTO(sf) 261 FOP_PROTO(ngle) 262 FOP_PROTO(seq) 263 FOP_PROTO(ngl) 264 FOP_PROTO(lt) 265 FOP_PROTO(nge) 266 FOP_PROTO(le) 267 FOP_PROTO(ngt) 268 #undef FOP_PROTO 269 270 /* Special functions */ 271 #ifndef CONFIG_USER_ONLY 272 DEF_HELPER_1(tlbwi, void, env) 273 DEF_HELPER_1(tlbwr, void, env) 274 DEF_HELPER_1(tlbp, void, env) 275 DEF_HELPER_1(tlbr, void, env) 276 DEF_HELPER_1(di, tl, env) 277 DEF_HELPER_1(ei, tl, env) 278 DEF_HELPER_1(eret, void, env) 279 DEF_HELPER_1(deret, void, env) 280 #endif /* !CONFIG_USER_ONLY */ 281 DEF_HELPER_1(rdhwr_cpunum, tl, env) 282 DEF_HELPER_1(rdhwr_synci_step, tl, env) 283 DEF_HELPER_1(rdhwr_cc, tl, env) 284 DEF_HELPER_1(rdhwr_ccres, tl, env) 285 DEF_HELPER_2(pmon, void, env, int) 286 DEF_HELPER_1(wait, void, env) 287 288 #include "exec/def-helper.h" 289