qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 44/81] tcg/sparc64: Use SRA, SRL for {s}extract_i64


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 44/81] tcg/sparc64: Use SRA, SRL for {s}extract_i64
Date: Fri, 10 Jan 2025 00:45:41 +0100
User-agent: Mozilla Thunderbird

On 10/1/25 00:44, Philippe Mathieu-Daudé wrote:
On 10/1/25 00:00, Philippe Mathieu-Daudé wrote:
On 7/1/25 09:00, Richard Henderson wrote:
Extracts which abut bit 32 may use 32-bit shifts.

(Fix typos?)


Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  tcg/sparc64/tcg-target-has.h |  9 +++++++--
  tcg/sparc64/tcg-target.c.inc | 11 +++++++++++
  2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/tcg/sparc64/tcg-target-has.h b/tcg/sparc64/tcg-target-has.h
index d9ca14cc3d..2db461efed 100644
--- a/tcg/sparc64/tcg-target-has.h
+++ b/tcg/sparc64/tcg-target-has.h

Missing:

-- >8 --
@@ -33,8 +33,8 @@ extern bool use_vis3_instructions;
  #define TCG_TARGET_HAS_ctz_i32          0
  #define TCG_TARGET_HAS_ctpop_i32        0
  #define TCG_TARGET_HAS_deposit_i32      0
-#define TCG_TARGET_HAS_extract_i32      0
-#define TCG_TARGET_HAS_sextract_i32     0
+#define TCG_TARGET_HAS_extract_i32      1
+#define TCG_TARGET_HAS_sextract_i32     1
  #define TCG_TARGET_HAS_extract2_i32     0
  #define TCG_TARGET_HAS_negsetcond_i32   1
  #define TCG_TARGET_HAS_add2_i32         1
---

Otherwise patch LGTM, so with that squashed:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


@@ -68,8 +68,8 @@ extern bool use_vis3_instructions;
  #define TCG_TARGET_HAS_ctz_i64          0
  #define TCG_TARGET_HAS_ctpop_i64        0
  #define TCG_TARGET_HAS_deposit_i64      0
-#define TCG_TARGET_HAS_extract_i64      0
-#define TCG_TARGET_HAS_sextract_i64     0
+#define TCG_TARGET_HAS_extract_i64      1
+#define TCG_TARGET_HAS_sextract_i64     1
  #define TCG_TARGET_HAS_extract2_i64     0
  #define TCG_TARGET_HAS_negsetcond_i64   1
  #define TCG_TARGET_HAS_add2_i64         1
@@ -83,4 +83,9 @@ extern bool use_vis3_instructions;
  #define TCG_TARGET_HAS_tst              1
+#define TCG_TARGET_extract_valid(type, ofs, len) \
+    ((type) == TCG_TYPE_I64 && (ofs) + (len) == 32)
+
+#define TCG_TARGET_sextract_valid  TCG_TARGET_extract_valid
+
  #endif






reply via email to

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