Lines Matching refs:ctx

21 #define REQUIRE_ZBA(ctx) do {                    \
22 if (!ctx->cfg_ptr->ext_zba) { \
27 #define REQUIRE_ZBB(ctx) do { \
28 if (!ctx->cfg_ptr->ext_zbb) { \
33 #define REQUIRE_ZBC(ctx) do { \
34 if (!ctx->cfg_ptr->ext_zbc) { \
39 #define REQUIRE_ZBS(ctx) do { \
40 if (!ctx->cfg_ptr->ext_zbs) { \
45 #define REQUIRE_ZBKB(ctx) do { \
46 if (!ctx->cfg_ptr->ext_zbkb) { \
51 #define REQUIRE_ZBKX(ctx) do { \
52 if (!ctx->cfg_ptr->ext_zbkx) { \
69 static bool trans_clz(DisasContext *ctx, arg_clz *a)
71 REQUIRE_ZBB(ctx);
72 return gen_unary_per_ol(ctx, a, EXT_NONE, gen_clz, gen_clzw);
85 static bool trans_ctz(DisasContext *ctx, arg_ctz *a)
87 REQUIRE_ZBB(ctx);
88 return gen_unary_per_ol(ctx, a, EXT_ZERO, gen_ctz, gen_ctzw);
91 static bool trans_cpop(DisasContext *ctx, arg_cpop *a)
93 REQUIRE_ZBB(ctx);
94 return gen_unary(ctx, a, EXT_ZERO, tcg_gen_ctpop_tl);
97 static bool trans_andn(DisasContext *ctx, arg_andn *a)
99 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
100 return gen_logic(ctx, a, tcg_gen_andc_tl);
103 static bool trans_orn(DisasContext *ctx, arg_orn *a)
105 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
106 return gen_logic(ctx, a, tcg_gen_orc_tl);
109 static bool trans_xnor(DisasContext *ctx, arg_xnor *a)
111 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
112 return gen_logic(ctx, a, tcg_gen_eqv_tl);
115 static bool trans_min(DisasContext *ctx, arg_min *a)
117 REQUIRE_ZBB(ctx);
118 return gen_arith(ctx, a, EXT_SIGN, tcg_gen_smin_tl, NULL);
121 static bool trans_max(DisasContext *ctx, arg_max *a)
123 REQUIRE_ZBB(ctx);
124 return gen_arith(ctx, a, EXT_SIGN, tcg_gen_smax_tl, NULL);
127 static bool trans_minu(DisasContext *ctx, arg_minu *a)
129 REQUIRE_ZBB(ctx);
130 return gen_arith(ctx, a, EXT_SIGN, tcg_gen_umin_tl, NULL);
133 static bool trans_maxu(DisasContext *ctx, arg_maxu *a)
135 REQUIRE_ZBB(ctx);
136 return gen_arith(ctx, a, EXT_SIGN, tcg_gen_umax_tl, NULL);
139 static bool trans_sext_b(DisasContext *ctx, arg_sext_b *a)
141 REQUIRE_ZBB(ctx);
142 return gen_unary(ctx, a, EXT_NONE, tcg_gen_ext8s_tl);
145 static bool trans_sext_h(DisasContext *ctx, arg_sext_h *a)
147 REQUIRE_ZBB(ctx);
148 return gen_unary(ctx, a, EXT_NONE, tcg_gen_ext16s_tl);
165 static bool trans_bset(DisasContext *ctx, arg_bset *a)
167 REQUIRE_ZBS(ctx);
168 return gen_shift(ctx, a, EXT_NONE, gen_bset, NULL);
171 static bool trans_bseti(DisasContext *ctx, arg_bseti *a)
173 REQUIRE_ZBS(ctx);
174 return gen_shift_imm_tl(ctx, a, EXT_NONE, gen_bset);
185 static bool trans_bclr(DisasContext *ctx, arg_bclr *a)
187 REQUIRE_ZBS(ctx);
188 return gen_shift(ctx, a, EXT_NONE, gen_bclr, NULL);
191 static bool trans_bclri(DisasContext *ctx, arg_bclri *a)
193 REQUIRE_ZBS(ctx);
194 return gen_shift_imm_tl(ctx, a, EXT_NONE, gen_bclr);
205 static bool trans_binv(DisasContext *ctx, arg_binv *a)
207 REQUIRE_ZBS(ctx);
208 return gen_shift(ctx, a, EXT_NONE, gen_binv, NULL);
211 static bool trans_binvi(DisasContext *ctx, arg_binvi *a)
213 REQUIRE_ZBS(ctx);
214 return gen_shift_imm_tl(ctx, a, EXT_NONE, gen_binv);
223 static bool trans_bext(DisasContext *ctx, arg_bext *a)
225 REQUIRE_ZBS(ctx);
226 return gen_shift(ctx, a, EXT_NONE, gen_bext, NULL);
229 static bool trans_bexti(DisasContext *ctx, arg_bexti *a)
231 REQUIRE_ZBS(ctx);
232 return gen_shift_imm_tl(ctx, a, EXT_NONE, gen_bext);
250 static bool trans_ror(DisasContext *ctx, arg_ror *a)
252 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
253 return gen_shift_per_ol(ctx, a, EXT_NONE, tcg_gen_rotr_tl, gen_rorw, NULL);
265 static bool trans_rori(DisasContext *ctx, arg_rori *a)
267 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
268 return gen_shift_imm_fn_per_ol(ctx, a, EXT_NONE,
287 static bool trans_rol(DisasContext *ctx, arg_rol *a)
289 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
290 return gen_shift_per_ol(ctx, a, EXT_NONE, tcg_gen_rotl_tl, gen_rolw, NULL);
298 static bool trans_rev8_32(DisasContext *ctx, arg_rev8_32 *a)
300 REQUIRE_32BIT(ctx);
301 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
302 return gen_unary(ctx, a, EXT_NONE, gen_rev8_32);
305 static bool trans_rev8_64(DisasContext *ctx, arg_rev8_64 *a)
307 REQUIRE_64BIT(ctx);
308 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
309 return gen_unary(ctx, a, EXT_NONE, tcg_gen_bswap_tl);
330 static bool trans_orc_b(DisasContext *ctx, arg_orc_b *a)
332 REQUIRE_ZBB(ctx);
333 return gen_unary(ctx, a, EXT_ZERO, gen_orc_b);
350 static bool trans_sh##SHAMT##add(DisasContext *ctx, arg_sh##SHAMT##add *a) \
352 REQUIRE_ZBA(ctx); \
353 return gen_arith(ctx, a, EXT_NONE, gen_sh##SHAMT##add, NULL); \
360 static bool trans_zext_h_32(DisasContext *ctx, arg_zext_h_32 *a)
362 REQUIRE_32BIT(ctx);
363 REQUIRE_ZBB(ctx);
364 return gen_unary(ctx, a, EXT_NONE, tcg_gen_ext16u_tl);
367 static bool trans_zext_h_64(DisasContext *ctx, arg_zext_h_64 *a)
369 REQUIRE_64BIT(ctx);
370 REQUIRE_ZBB(ctx);
371 return gen_unary(ctx, a, EXT_NONE, tcg_gen_ext16u_tl);
374 static bool trans_clzw(DisasContext *ctx, arg_clzw *a)
376 REQUIRE_64BIT(ctx);
377 REQUIRE_ZBB(ctx);
378 return gen_unary(ctx, a, EXT_NONE, gen_clzw);
381 static bool trans_ctzw(DisasContext *ctx, arg_ctzw *a)
383 REQUIRE_64BIT(ctx);
384 REQUIRE_ZBB(ctx);
385 ctx->ol = MXL_RV32;
386 return gen_unary(ctx, a, EXT_ZERO, gen_ctzw);
389 static bool trans_cpopw(DisasContext *ctx, arg_cpopw *a)
391 REQUIRE_64BIT(ctx);
392 REQUIRE_ZBB(ctx);
393 ctx->ol = MXL_RV32;
394 return gen_unary(ctx, a, EXT_ZERO, tcg_gen_ctpop_tl);
397 static bool trans_rorw(DisasContext *ctx, arg_rorw *a)
399 REQUIRE_64BIT(ctx);
400 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
401 ctx->ol = MXL_RV32;
402 return gen_shift(ctx, a, EXT_NONE, gen_rorw, NULL);
405 static bool trans_roriw(DisasContext *ctx, arg_roriw *a)
407 REQUIRE_64BIT(ctx);
408 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
409 ctx->ol = MXL_RV32;
410 return gen_shift_imm_fn(ctx, a, EXT_NONE, gen_roriw, NULL);
413 static bool trans_rolw(DisasContext *ctx, arg_rolw *a)
415 REQUIRE_64BIT(ctx);
416 REQUIRE_EITHER_EXT(ctx, zbb, zbkb);
417 ctx->ol = MXL_RV32;
418 return gen_shift(ctx, a, EXT_NONE, gen_rolw, NULL);
437 static bool trans_sh##SHAMT##add_uw(DisasContext *ctx, \
440 REQUIRE_64BIT(ctx); \
441 REQUIRE_ZBA(ctx); \
442 return gen_arith(ctx, a, EXT_NONE, gen_sh##SHAMT##add_uw, NULL); \
456 static bool trans_add_uw(DisasContext *ctx, arg_add_uw *a)
458 REQUIRE_64BIT(ctx);
459 REQUIRE_ZBA(ctx);
460 return gen_arith(ctx, a, EXT_NONE, gen_add_uw, NULL);
468 static bool trans_slli_uw(DisasContext *ctx, arg_slli_uw *a)
470 REQUIRE_64BIT(ctx);
471 REQUIRE_ZBA(ctx);
472 return gen_shift_imm_fn(ctx, a, EXT_NONE, gen_slli_uw, NULL);
475 static bool trans_clmul(DisasContext *ctx, arg_clmul *a)
477 REQUIRE_EITHER_EXT(ctx, zbc, zbkc);
478 return gen_arith(ctx, a, EXT_NONE, gen_helper_clmul, NULL);
487 static bool trans_clmulh(DisasContext *ctx, arg_clmulr *a)
489 REQUIRE_EITHER_EXT(ctx, zbc, zbkc);
490 return gen_arith(ctx, a, EXT_NONE, gen_clmulh, NULL);
493 static bool trans_clmulr(DisasContext *ctx, arg_clmulh *a)
495 REQUIRE_ZBC(ctx);
496 return gen_arith(ctx, a, EXT_NONE, gen_helper_clmulr, NULL);
522 static bool trans_brev8(DisasContext *ctx, arg_brev8 *a)
524 REQUIRE_ZBKB(ctx);
525 return gen_unary(ctx, a, EXT_NONE, gen_helper_brev8);
528 static bool trans_pack(DisasContext *ctx, arg_pack *a)
530 REQUIRE_ZBKB(ctx);
531 return gen_arith(ctx, a, EXT_NONE, gen_pack, NULL);
534 static bool trans_packh(DisasContext *ctx, arg_packh *a)
536 REQUIRE_ZBKB(ctx);
537 return gen_arith(ctx, a, EXT_NONE, gen_packh, NULL);
540 static bool trans_packw(DisasContext *ctx, arg_packw *a)
542 REQUIRE_64BIT(ctx);
543 REQUIRE_ZBKB(ctx);
544 return gen_arith(ctx, a, EXT_NONE, gen_packw, NULL);
547 static bool trans_unzip(DisasContext *ctx, arg_unzip *a)
549 REQUIRE_32BIT(ctx);
550 REQUIRE_ZBKB(ctx);
551 return gen_unary(ctx, a, EXT_NONE, gen_helper_unzip);
554 static bool trans_zip(DisasContext *ctx, arg_zip *a)
556 REQUIRE_32BIT(ctx);
557 REQUIRE_ZBKB(ctx);
558 return gen_unary(ctx, a, EXT_NONE, gen_helper_zip);
561 static bool trans_xperm4(DisasContext *ctx, arg_xperm4 *a)
563 REQUIRE_ZBKX(ctx);
564 return gen_arith(ctx, a, EXT_NONE, gen_helper_xperm4, NULL);
567 static bool trans_xperm8(DisasContext *ctx, arg_xperm8 *a)
569 REQUIRE_ZBKX(ctx);
570 return gen_arith(ctx, a, EXT_NONE, gen_helper_xperm8, NULL);