summaryrefslogtreecommitdiffstats
path: root/include/tcg/tcg.h
diff options
context:
space:
mode:
authorRichard Henderson2021-06-13 06:32:27 +0200
committerRichard Henderson2021-06-29 19:04:57 +0200
commit587195bd5905deefe90242bbd210b9bba76ca093 (patch)
treeca7d75039083a054dd3cb1ad99a61a96499131ff /include/tcg/tcg.h
parenttcg: Use correct trap number for page faults on *BSD systems (diff)
downloadqemu-587195bd5905deefe90242bbd210b9bba76ca093.tar.gz
qemu-587195bd5905deefe90242bbd210b9bba76ca093.tar.xz
qemu-587195bd5905deefe90242bbd210b9bba76ca093.zip
tcg: Add flags argument to bswap opcodes
This will eventually simplify front-end usage, and will allow backends to unset TCG_TARGET_HAS_MEMORY_BSWAP without loss of optimization. The argument is added during expansion, not currently exposed to the front end translators. The backends currently only support a flags value of either TCG_BSWAP_IZ, or (TCG_BSWAP_IZ | TCG_BSWAP_OZ), since they all require zero top bytes and leave them that way. At the existing call sites we pass in (TCG_BSWAP_IZ | TCG_BSWAP_OZ), except for the flags-ignored cases of a 32-bit swap of a 32-bit value and or a 64-bit swap of a 64-bit value, where we pass 0. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/tcg/tcg.h')
-rw-r--r--include/tcg/tcg.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 2dad364240..899493701c 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -408,6 +408,18 @@ typedef TCGv_ptr TCGv_env;
/* Used to align parameters. See the comment before tcgv_i32_temp. */
#define TCG_CALL_DUMMY_ARG ((TCGArg)0)
+/*
+ * Flags for the bswap opcodes.
+ * If IZ, the input is zero-extended, otherwise unknown.
+ * If OZ or OS, the output is zero- or sign-extended respectively,
+ * otherwise the high bits are undefined.
+ */
+enum {
+ TCG_BSWAP_IZ = 1,
+ TCG_BSWAP_OZ = 2,
+ TCG_BSWAP_OS = 4,
+};
+
typedef enum TCGTempVal {
TEMP_VAL_DEAD,
TEMP_VAL_REG,