On 6/14/21 10:37 AM, Richard Henderson wrote:
> 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. Non-zero values are not yet
> supported by any backends.
>
> Signed-off-by: Richard Henderson <[email protected]>
> ---
> include/tcg/tcg-opc.h | 10 +++++-----
> include/tcg/tcg.h | 12 ++++++++++++
> tcg/tcg-op.c | 13 ++++++++-----
> tcg/README | 18 ++++++++++--------
> 4 files changed, 35 insertions(+), 18 deletions(-)
> +/*
> + * 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,
Matter of taste, I find "1 << x" bullet proof for flags.
Otherwise:
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>