diff mbox series

[v2,2/2] target/riscv: Use dup_const_tl in orc.b to legalise truncation of constant

Message ID 20211003214243.3813425-2-philipp.tomsich@vrull.eu
State New
Headers show
Series [v2,1/2] tcg: add dup_const_tl wrapper | expand

Commit Message

Philipp Tomsich Oct. 3, 2021, 9:42 p.m. UTC
We need to use the newly introduced dup_const_tl in orc.b to legalise
the truncation (to target_long) of the constant generated with dup_const.

Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---

(no changes since v1)

 target/riscv/insn_trans/trans_rvb.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Oct. 4, 2021, 7:43 a.m. UTC | #1
On 10/3/21 23:42, Philipp Tomsich wrote:
> We need to use the newly introduced dup_const_tl in orc.b to legalise
> the truncation (to target_long) of the constant generated with dup_const.
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> 
> (no changes since v1)
> 
>  target/riscv/insn_trans/trans_rvb.c.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Alistair Francis Oct. 6, 2021, 10:26 p.m. UTC | #2
On Mon, Oct 4, 2021 at 7:44 AM Philipp Tomsich <philipp.tomsich@vrull.eu> wrote:
>
> We need to use the newly introduced dup_const_tl in orc.b to legalise
> the truncation (to target_long) of the constant generated with dup_const.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>
> (no changes since v1)
>
>  target/riscv/insn_trans/trans_rvb.c.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/insn_trans/trans_rvb.c.inc b/target/riscv/insn_trans/trans_rvb.c.inc
> index 2927353d9b..185c3e9a60 100644
> --- a/target/riscv/insn_trans/trans_rvb.c.inc
> +++ b/target/riscv/insn_trans/trans_rvb.c.inc
> @@ -249,7 +249,7 @@ static bool trans_rev8_64(DisasContext *ctx, arg_rev8_64 *a)
>  static void gen_orc_b(TCGv ret, TCGv source1)
>  {
>      TCGv  tmp = tcg_temp_new();
> -    TCGv  ones = tcg_constant_tl(dup_const(MO_8, 0x01));
> +    TCGv  ones = tcg_constant_tl(dup_const_tl(MO_8, 0x01));
>
>      /* Set lsb in each byte if the byte was zero. */
>      tcg_gen_sub_tl(tmp, source1, ones);
> --
> 2.25.1
>
>
Alistair Francis Oct. 6, 2021, 10:42 p.m. UTC | #3
On Mon, Oct 4, 2021 at 7:44 AM Philipp Tomsich <philipp.tomsich@vrull.eu> wrote:
>
> We need to use the newly introduced dup_const_tl in orc.b to legalise
> the truncation (to target_long) of the constant generated with dup_const.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Thanks, I have applied this.

I squashed it into the original commit to ensure there are no build regressions.

Alistair
diff mbox series

Patch

diff --git a/target/riscv/insn_trans/trans_rvb.c.inc b/target/riscv/insn_trans/trans_rvb.c.inc
index 2927353d9b..185c3e9a60 100644
--- a/target/riscv/insn_trans/trans_rvb.c.inc
+++ b/target/riscv/insn_trans/trans_rvb.c.inc
@@ -249,7 +249,7 @@  static bool trans_rev8_64(DisasContext *ctx, arg_rev8_64 *a)
 static void gen_orc_b(TCGv ret, TCGv source1)
 {
     TCGv  tmp = tcg_temp_new();
-    TCGv  ones = tcg_constant_tl(dup_const(MO_8, 0x01));
+    TCGv  ones = tcg_constant_tl(dup_const_tl(MO_8, 0x01));
 
     /* Set lsb in each byte if the byte was zero. */
     tcg_gen_sub_tl(tmp, source1, ones);