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