1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 3 * Copyright (c) 2021 Loongson Technology Corporation Limited 4 */ 5 6 DEF_HELPER_2(raise_exception, noreturn, env, i32) 7 8 DEF_HELPER_FLAGS_1(bitrev_w, TCG_CALL_NO_RWG_SE, tl, tl) 9 DEF_HELPER_FLAGS_1(bitrev_d, TCG_CALL_NO_RWG_SE, tl, tl) 10 DEF_HELPER_FLAGS_1(bitswap, TCG_CALL_NO_RWG_SE, tl, tl) 11 12 DEF_HELPER_FLAGS_3(asrtle_d, TCG_CALL_NO_WG, void, env, tl, tl) 13 DEF_HELPER_FLAGS_3(asrtgt_d, TCG_CALL_NO_WG, void, env, tl, tl) 14 15 DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, tl, tl, tl, tl) 16 DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, tl, tl, tl, tl) 17 DEF_HELPER_FLAGS_2(cpucfg, TCG_CALL_NO_RWG_SE, tl, env, tl) 18 19 /* Floating-point helper */ 20 DEF_HELPER_FLAGS_3(fadd_s, TCG_CALL_NO_WG, i64, env, i64, i64) 21 DEF_HELPER_FLAGS_3(fadd_d, TCG_CALL_NO_WG, i64, env, i64, i64) 22 DEF_HELPER_FLAGS_3(fsub_s, TCG_CALL_NO_WG, i64, env, i64, i64) 23 DEF_HELPER_FLAGS_3(fsub_d, TCG_CALL_NO_WG, i64, env, i64, i64) 24 DEF_HELPER_FLAGS_3(fmul_s, TCG_CALL_NO_WG, i64, env, i64, i64) 25 DEF_HELPER_FLAGS_3(fmul_d, TCG_CALL_NO_WG, i64, env, i64, i64) 26 DEF_HELPER_FLAGS_3(fdiv_s, TCG_CALL_NO_WG, i64, env, i64, i64) 27 DEF_HELPER_FLAGS_3(fdiv_d, TCG_CALL_NO_WG, i64, env, i64, i64) 28 DEF_HELPER_FLAGS_3(fmax_s, TCG_CALL_NO_WG, i64, env, i64, i64) 29 DEF_HELPER_FLAGS_3(fmax_d, TCG_CALL_NO_WG, i64, env, i64, i64) 30 DEF_HELPER_FLAGS_3(fmin_s, TCG_CALL_NO_WG, i64, env, i64, i64) 31 DEF_HELPER_FLAGS_3(fmin_d, TCG_CALL_NO_WG, i64, env, i64, i64) 32 DEF_HELPER_FLAGS_3(fmaxa_s, TCG_CALL_NO_WG, i64, env, i64, i64) 33 DEF_HELPER_FLAGS_3(fmaxa_d, TCG_CALL_NO_WG, i64, env, i64, i64) 34 DEF_HELPER_FLAGS_3(fmina_s, TCG_CALL_NO_WG, i64, env, i64, i64) 35 DEF_HELPER_FLAGS_3(fmina_d, TCG_CALL_NO_WG, i64, env, i64, i64) 36 37 DEF_HELPER_FLAGS_5(fmuladd_s, TCG_CALL_NO_WG, i64, env, i64, i64, i64, i32) 38 DEF_HELPER_FLAGS_5(fmuladd_d, TCG_CALL_NO_WG, i64, env, i64, i64, i64, i32) 39 40 DEF_HELPER_FLAGS_3(fscaleb_s, TCG_CALL_NO_WG, i64, env, i64, i64) 41 DEF_HELPER_FLAGS_3(fscaleb_d, TCG_CALL_NO_WG, i64, env, i64, i64) 42 43 DEF_HELPER_FLAGS_2(flogb_s, TCG_CALL_NO_WG, i64, env, i64) 44 DEF_HELPER_FLAGS_2(flogb_d, TCG_CALL_NO_WG, i64, env, i64) 45 46 DEF_HELPER_FLAGS_2(fsqrt_s, TCG_CALL_NO_WG, i64, env, i64) 47 DEF_HELPER_FLAGS_2(fsqrt_d, TCG_CALL_NO_WG, i64, env, i64) 48 DEF_HELPER_FLAGS_2(frsqrt_s, TCG_CALL_NO_WG, i64, env, i64) 49 DEF_HELPER_FLAGS_2(frsqrt_d, TCG_CALL_NO_WG, i64, env, i64) 50 DEF_HELPER_FLAGS_2(frecip_s, TCG_CALL_NO_WG, i64, env, i64) 51 DEF_HELPER_FLAGS_2(frecip_d, TCG_CALL_NO_WG, i64, env, i64) 52 53 DEF_HELPER_FLAGS_2(fclass_s, TCG_CALL_NO_RWG_SE, i64, env, i64) 54 DEF_HELPER_FLAGS_2(fclass_d, TCG_CALL_NO_RWG_SE, i64, env, i64) 55 56 /* fcmp.cXXX.s */ 57 DEF_HELPER_4(fcmp_c_s, i64, env, i64, i64, i32) 58 /* fcmp.sXXX.s */ 59 DEF_HELPER_4(fcmp_s_s, i64, env, i64, i64, i32) 60 /* fcmp.cXXX.d */ 61 DEF_HELPER_4(fcmp_c_d, i64, env, i64, i64, i32) 62 /* fcmp.sXXX.d */ 63 DEF_HELPER_4(fcmp_s_d, i64, env, i64, i64, i32) 64 65 DEF_HELPER_2(fcvt_d_s, i64, env, i64) 66 DEF_HELPER_2(fcvt_s_d, i64, env, i64) 67 DEF_HELPER_2(ffint_d_w, i64, env, i64) 68 DEF_HELPER_2(ffint_d_l, i64, env, i64) 69 DEF_HELPER_2(ffint_s_w, i64, env, i64) 70 DEF_HELPER_2(ffint_s_l, i64, env, i64) 71 DEF_HELPER_2(ftintrm_l_s, i64, env, i64) 72 DEF_HELPER_2(ftintrm_l_d, i64, env, i64) 73 DEF_HELPER_2(ftintrm_w_s, i64, env, i64) 74 DEF_HELPER_2(ftintrm_w_d, i64, env, i64) 75 DEF_HELPER_2(ftintrp_l_s, i64, env, i64) 76 DEF_HELPER_2(ftintrp_l_d, i64, env, i64) 77 DEF_HELPER_2(ftintrp_w_s, i64, env, i64) 78 DEF_HELPER_2(ftintrp_w_d, i64, env, i64) 79 DEF_HELPER_2(ftintrz_l_s, i64, env, i64) 80 DEF_HELPER_2(ftintrz_l_d, i64, env, i64) 81 DEF_HELPER_2(ftintrz_w_s, i64, env, i64) 82 DEF_HELPER_2(ftintrz_w_d, i64, env, i64) 83 DEF_HELPER_2(ftintrne_l_s, i64, env, i64) 84 DEF_HELPER_2(ftintrne_l_d, i64, env, i64) 85 DEF_HELPER_2(ftintrne_w_s, i64, env, i64) 86 DEF_HELPER_2(ftintrne_w_d, i64, env, i64) 87 DEF_HELPER_2(ftint_l_s, i64, env, i64) 88 DEF_HELPER_2(ftint_l_d, i64, env, i64) 89 DEF_HELPER_2(ftint_w_s, i64, env, i64) 90 DEF_HELPER_2(ftint_w_d, i64, env, i64) 91 DEF_HELPER_2(frint_s, i64, env, i64) 92 DEF_HELPER_2(frint_d, i64, env, i64) 93 94 DEF_HELPER_FLAGS_2(set_rounding_mode, TCG_CALL_NO_RWG, void, env, i32) 95 96 DEF_HELPER_1(rdtime_d, i64, env) 97 98 #ifndef CONFIG_USER_ONLY 99 /* CSRs helper */ 100 DEF_HELPER_1(csrrd_pgd, i64, env) 101 DEF_HELPER_1(csrrd_tval, i64, env) 102 DEF_HELPER_2(csrwr_estat, i64, env, tl) 103 DEF_HELPER_2(csrwr_asid, i64, env, tl) 104 DEF_HELPER_2(csrwr_tcfg, i64, env, tl) 105 DEF_HELPER_2(csrwr_ticlr, i64, env, tl) 106 DEF_HELPER_2(iocsrrd_b, i64, env, tl) 107 DEF_HELPER_2(iocsrrd_h, i64, env, tl) 108 DEF_HELPER_2(iocsrrd_w, i64, env, tl) 109 DEF_HELPER_2(iocsrrd_d, i64, env, tl) 110 DEF_HELPER_3(iocsrwr_b, void, env, tl, tl) 111 DEF_HELPER_3(iocsrwr_h, void, env, tl, tl) 112 DEF_HELPER_3(iocsrwr_w, void, env, tl, tl) 113 DEF_HELPER_3(iocsrwr_d, void, env, tl, tl) 114 115 /* TLB helper */ 116 DEF_HELPER_1(tlbwr, void, env) 117 DEF_HELPER_1(tlbfill, void, env) 118 DEF_HELPER_1(tlbsrch, void, env) 119 DEF_HELPER_1(tlbrd, void, env) 120 DEF_HELPER_1(tlbclr, void, env) 121 DEF_HELPER_1(tlbflush, void, env) 122 DEF_HELPER_1(invtlb_all, void, env) 123 DEF_HELPER_2(invtlb_all_g, void, env, i32) 124 DEF_HELPER_2(invtlb_all_asid, void, env, tl) 125 DEF_HELPER_3(invtlb_page_asid, void, env, tl, tl) 126 DEF_HELPER_3(invtlb_page_asid_or_g, void, env, tl, tl) 127 128 DEF_HELPER_4(lddir, tl, env, tl, tl, i32) 129 DEF_HELPER_4(ldpte, void, env, tl, tl, i32) 130 DEF_HELPER_1(ertn, void, env) 131 DEF_HELPER_1(idle, void, env) 132 #endif 133