Skip to contentSkip to conversation

Fix pointer masking functionality for RISC-V

PATCH Applied Alexey Baturo 2 participants 4 messages Jul 17, 2022 – Jul 19, 2022 RISC-V

lore
Share & tools
lore
#0 lore raw

cover Fix pointer masking functionality for RISC-V

From: Alexey Baturo <[email protected]>

Hi,

This patch fixes a typo which leads to broken pointer masking functionality for RISC-V. Thanks.

Alexey Baturo (1):
target/riscv: Fix typo and restore Pointer Masking functionality for
RISC-V

 target/riscv/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/1 target/riscv: Fix typo and restore Pointer Masking functionality for RISC-V

From: Alexey Baturo <[email protected]>

---
 target/riscv/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/translate.c +1 -1
index 63b04e8a94..86c19ea74e 100644
@@ -544,7 +544,7 @@ static TCGv get_address(DisasContext *ctx, int rs1, int imm)
 
     tcg_gen_addi_tl(addr, src1, imm);
     if (ctx->pm_mask_enabled) {
-        tcg_gen_and_tl(addr, addr, pm_mask);
+        tcg_gen_andc_tl(addr, addr, pm_mask);
     } else if (get_xl(ctx) == MXL_RV32) {
         tcg_gen_ext32u_tl(addr, addr);
     }
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] target/riscv: Fix typo and restore Pointer Masking functionality for RISC-V

Quoted 4 lines · Alexey Baturo

From: Alexey Baturo <[email protected]>

Fixes 4302bef9e178 ("target/riscv: Calculate address according to XLEN")

Alistair

Quoted 21 lines
---
 target/riscv/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/translate.c +1 -2
index 63b04e8a94..86c19ea74e 100644
@@ -544,7 +544,7 @@ static TCGv get_address(DisasContext *ctx, int rs1, int imm)
 
     tcg_gen_addi_tl(addr, src1, imm);
     if (ctx->pm_mask_enabled) {
-        tcg_gen_and_tl(addr, addr, pm_mask);
+        tcg_gen_andc_tl(addr, addr, pm_mask);
     } else if (get_xl(ctx) == MXL_RV32) {
         tcg_gen_ext32u_tl(addr, addr);
     }
--

2.30.2

#3 lore raw

Re: [PATCH 1/1] target/riscv: Fix typo and restore Pointer Masking functionality for RISC-V

In reply to Alexey Baturo
Quoted 4 lines · Alexey Baturo

From: Alexey Baturo <[email protected]>

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 21 lines
---
 target/riscv/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/translate.c +1 -2
index 63b04e8a94..86c19ea74e 100644
@@ -544,7 +544,7 @@ static TCGv get_address(DisasContext *ctx, int rs1, int imm)
 
     tcg_gen_addi_tl(addr, src1, imm);
     if (ctx->pm_mask_enabled) {
-        tcg_gen_and_tl(addr, addr, pm_mask);
+        tcg_gen_andc_tl(addr, addr, pm_mask);
     } else if (get_xl(ctx) == MXL_RV32) {
         tcg_gen_ext32u_tl(addr, addr);
     }
--

2.30.2