|
| From: | Philipp Tomsich |
| Subject: | Re: [PATCH v5 07/14] target/riscv: Add instructions of the Zbc-extension |
| Date: | Wed, 25 Aug 2021 19:01:23 +0200 |
On 8/23/21 11:42 AM, Philipp Tomsich wrote:
> +static bool trans_clmul(DisasContext *ctx, arg_clmul *a)
> +{
> + REQUIRE_ZBC(ctx);
> + return gen_arith(ctx, a, gen_helper_clmul);
> +}
> +
> +
> +static bool trans_clmulh(DisasContext *ctx, arg_clmulr *a)
> +{
> + REQUIRE_ZBC(ctx);
> + return gen_arith(ctx, a, gen_clmulh);
> +}
> +
> +static bool trans_clmulr(DisasContext *ctx, arg_clmulh *a)
> +{
> + REQUIRE_ZBC(ctx);
> + return gen_arith(ctx, a, gen_helper_clmulr);
> +}
> diff --git a/target/riscv/translate.c b/target/riscv/translate.c
> index fc22ae82d0..32a067dcd2 100644
> --- a/target/riscv/translate.c
> +++ b/target/riscv/translate.c
> @@ -739,6 +739,12 @@ static void gen_add_uw(TCGv ret, TCGv arg1, TCGv arg2)
> tcg_gen_add_tl(ret, arg1, arg2);
> }
>
> +static void gen_clmulh(TCGv dst, TCGv src1, TCGv src2)
> +{
> + gen_helper_clmulr(dst, src1, src2);
> + tcg_gen_shri_tl(dst, dst, 1);
> +}
> +
Put this immediately before its use in trans_rvb.c.inc. I have patches to clean up the
rest of the instances that still remain in translate.c.
With that,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |