|
From: | Richard Henderson |
Subject: | Re: [PATCH 01/28] tcg: Add flags argument to bswap opcodes |
Date: | Mon, 14 Jun 2021 07:43:16 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
On 6/14/21 4:49 AM, Alex Bennée wrote:
+/* + * 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, +}; +So is a TCG_BSWAP_IZ only really for cases where we have loaded up a narrower width value into the "natural" TCG sized register? We seem to assume this is always the case even though the TCG bswap op doesn't have visibility of how the arg value was loaded.
All of these flags are for narrower width bswap. When you get to patch 17, you'll see that tcg_gen_bswap32_i32 and bswap64_i64 do not present this argument to the target/ front ends at all.
IZ is for when we know that we've used a zero-extending load feeding into the operation. I've also added code to the optimizer to *set* this bit when it can prove that the value feeding the bswap is zero-extended.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |