qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 07/14] target/riscv: Add instructions of the Zbc-extension


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

Resent as a v6 with this change and a bug-fix for orc.b.
This now again passes all of SPEC 2017 w/ a compiler that makes good use of the Zb[abcs] instructions, including orc.b for string-functions.

On Wed, 25 Aug 2021 at 15:40, Richard Henderson <richard.henderson@linaro.org> wrote:
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~

reply via email to

[Prev in Thread] Current Thread [Next in Thread]