qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] tcg/riscv: Use BEXTI for single-bit extractions


From: Richard Henderson
Subject: Re: [PATCH 2/2] tcg/riscv: Use BEXTI for single-bit extractions
Date: Tue, 7 Jan 2025 07:27:01 -0800
User-agent: Mozilla Thunderbird

On 1/7/25 02:29, Philippe Mathieu-Daudé wrote:
Hi Richard,

On 2/1/25 19:16, Richard Henderson wrote:
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  tcg/riscv/tcg-target-has.h |  8 +++++++-
  tcg/riscv/tcg-target.c.inc | 13 +++++++++++--
  2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h
index 10e61edc45..ea38ee5cbb 100644
--- a/tcg/riscv/tcg-target-has.h
+++ b/tcg/riscv/tcg-target-has.h
@@ -64,7 +64,13 @@ tcg_target_extract_valid(TCGType type, unsigned ofs, 
unsigned len)
          /* ofs > 0 uses SRLIW; ofs == 0 uses add.uw. */
          return ofs || (cpuinfo & CPUINFO_ZBA);
      }
-    return (cpuinfo & CPUINFO_ZBB) && ofs == 0 && len == 16;
+    switch (len) {
+    case 1:
+        return (cpuinfo & CPUINFO_ZBS) && ofs != 0;

Why can't we have ofs=0?

To prefer ANDI.


r~



reply via email to

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