summary refs log tree commit diff stats
path: root/tcg/tcg-has.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-12-25 18:55:45 -0800
committerRichard Henderson <richard.henderson@linaro.org>2025-01-16 20:57:17 -0800
commit4bce752c1a4aad3bfba9b6447dd200fade242aed (patch)
tree04984830830ed89a659324eeb96fd37149af0bda /tcg/tcg-has.h
parentad76017e51731ef84e98bd25b922fe14e656dd8d (diff)
downloadfocaccia-qemu-4bce752c1a4aad3bfba9b6447dd200fade242aed.tar.gz
focaccia-qemu-4bce752c1a4aad3bfba9b6447dd200fade242aed.zip
tcg/i386: Fold the ext{8,16,32}[us] cases into {s}extract
Accept byte and word extensions with the extract opcodes.
This is preparatory to removing the specialized extracts.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg-has.h')
-rw-r--r--tcg/tcg-has.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/tcg/tcg-has.h b/tcg/tcg-has.h
index 65b6a0b0cf..8ed35be8c3 100644
--- a/tcg/tcg-has.h
+++ b/tcg/tcg-has.h
@@ -56,11 +56,15 @@
 #ifndef TCG_TARGET_deposit_i64_valid
 #define TCG_TARGET_deposit_i64_valid(ofs, len) 1
 #endif
-#ifndef TCG_TARGET_extract_i32_valid
-#define TCG_TARGET_extract_i32_valid(ofs, len) 1
+#ifndef TCG_TARGET_extract_valid
+#define TCG_TARGET_extract_valid(type, ofs, len) \
+    ((type) == TCG_TYPE_I32 ? TCG_TARGET_HAS_extract_i32 \
+     : TCG_TARGET_HAS_extract_i64)
 #endif
-#ifndef TCG_TARGET_extract_i64_valid
-#define TCG_TARGET_extract_i64_valid(ofs, len) 1
+#ifndef TCG_TARGET_sextract_valid
+#define TCG_TARGET_sextract_valid(type, ofs, len) \
+    ((type) == TCG_TYPE_I32 ? TCG_TARGET_HAS_sextract_i32 \
+     : TCG_TARGET_HAS_sextract_i64)
 #endif
 
 /* Only one of DIV or DIV2 should be defined.  */