[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 42/48] tcg/tcg-op: Document bswap32_i64() byte pattern
From: |
Richard Henderson |
Subject: |
[PULL 42/48] tcg/tcg-op: Document bswap32_i64() byte pattern |
Date: |
Wed, 23 Aug 2023 13:23:20 -0700 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230823145542.79633-5-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tcg-op.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index ed0ab218a1..b56ae748b8 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -1822,6 +1822,14 @@ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg, int
flags)
}
}
+/*
+ * bswap32_i64: 32-bit byte swap on the low bits of a 64-bit value.
+ *
+ * Byte pattern: xxxxabcd -> yyyydcba
+ *
+ * With TCG_BSWAP_IZ, x == zero, else undefined.
+ * With TCG_BSWAP_OZ, y == zero, with TCG_BSWAP_OS y == sign, else undefined.
+ */
void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags)
{
/* Only one extension flag may be present. */
@@ -1855,7 +1863,8 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int
flags)
} else {
tcg_gen_shri_i64(t1, t1, 32); /* t1 = ....dc.. */
}
- tcg_gen_or_i64(ret, t0, t1); /* ret = ssssdcba */
+ tcg_gen_or_i64(ret, t0, t1); /* ret = ssssdcba (OS) */
+ /* ....dcba (else) */
tcg_temp_free_i64(t0);
tcg_temp_free_i64(t1);
--
2.34.1
- [PULL 15/48] tcg: Unify TCG_TARGET_HAS_extr[lh]_i64_i32, (continued)
- [PULL 15/48] tcg: Unify TCG_TARGET_HAS_extr[lh]_i64_i32, Richard Henderson, 2023/08/23
- [PULL 23/48] target/sparc: Use tcg_gen_movcond_i64 in gen_edge, Richard Henderson, 2023/08/23
- [PULL 26/48] tcg/ppc: Use the Set Boolean Extension, Richard Henderson, 2023/08/23
- [PULL 28/48] tcg/arm: Implement negsetcond_i32, Richard Henderson, 2023/08/23
- [PULL 22/48] target/ppc: Use tcg_gen_negsetcond_*, Richard Henderson, 2023/08/23
- [PULL 38/48] tcg/i386: Implement negsetcond_*, Richard Henderson, 2023/08/23
- [PULL 40/48] tcg/tcg-op: Document bswap16_i64() byte pattern, Richard Henderson, 2023/08/23
- [PULL 41/48] tcg/tcg-op: Document bswap32_i32() byte pattern, Richard Henderson, 2023/08/23
- [PULL 44/48] tcg/tcg-op: Document hswap_i32/64() byte pattern, Richard Henderson, 2023/08/23
- [PULL 45/48] tcg/tcg-op: Document wswap_i64() byte pattern, Richard Henderson, 2023/08/23
- [PULL 42/48] tcg/tcg-op: Document bswap32_i64() byte pattern,
Richard Henderson <=
- [PULL 43/48] tcg/tcg-op: Document bswap64_i64() byte pattern, Richard Henderson, 2023/08/23
- [PULL 47/48] docs/devel/tcg-ops: fix missing newlines in "Host vector operations", Richard Henderson, 2023/08/23
- [PULL 48/48] tcg: spelling fixes, Richard Henderson, 2023/08/23
- [PULL 46/48] target/cris: Fix a typo in gen_swapr(), Richard Henderson, 2023/08/23
- Re: [PULL 00/48] tcg patch queue, Stefan Hajnoczi, 2023/08/24