2 * RISC-V translation routines for the RISC-V Zawrs Extension.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2 or later, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along with
16 * this program. If not, see <http://www.gnu.org/licenses/>.
19 static bool trans_wrs(DisasContext *ctx)
21 if (!ctx->cfg_ptr->ext_zawrs) {
26 * The specification says:
27 * While stalled, an implementation is permitted to occasionally
28 * terminate the stall and complete execution for any reason.
30 * So let's just exit TB and return to the main loop.
33 /* Clear the load reservation (if any). */
34 tcg_gen_movi_tl(load_res, -1);
36 gen_set_pc_imm(ctx, ctx->pc_succ_insn);
37 tcg_gen_exit_tb(NULL, 0);
38 ctx->base.is_jmp = DISAS_NORETURN;
43 #define GEN_TRANS_WRS(insn) \
44 static bool trans_ ## insn(DisasContext *ctx, arg_ ## insn *a) \
47 return trans_wrs(ctx); \
50 GEN_TRANS_WRS(wrs_nto)
51 GEN_TRANS_WRS(wrs_sto)