On Wed, 11 Mar 2020 at 06:44, Richard Henderson
<richard.hender...@linaro.org> wrote:
>
> Use the "normal" memory access functions, rather than the
> softmmu internal helper functions directly.
>
> Since fb901c905dc3, cpu_mem_index is now a simple extract
> from env->hflags and not a large computation.  Which means
> that it's now more work to pass around this value than it
> is to recompute it.
>
> This only adjusts the primitives, and does not clean up
> all of the uses within sve_helper.c.
>
> Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
> ---
>  target/arm/sve_helper.c | 241 ++++++++++++++++++----------------------
>  1 file changed, 107 insertions(+), 134 deletions(-)

> +#ifdef TARGET_WORDS_BIGENDIAN
> +# define be_bswap16(x)  ((uint16_t)(x))
> +# define be_bswap32(x)  ((uint32_t)(x))
> +# define be_bswap64(x)  ((uint64_t)(x))
> +# define le_bswap16(x)  bswap16(x)
> +# define le_bswap32(x)  bswap32(x)
> +# define le_bswap64(x)  bswap64(x)
> +#else
> +# define be_bswap16(x)  bswap16(x)
> +# define be_bswap32(x)  bswap32(x)
> +# define be_bswap64(x)  bswap64(x)
> +# define le_bswap16(x)  ((uint16_t)(x))
> +# define le_bswap32(x)  ((uint32_t)(x))
> +# define le_bswap64(x)  ((uint64_t)(x))
> +#endif

Am I confused, or are these just reimplementing
cpu_to_be16()/cpu_to_le16()/le16_to_cpu()/be16_to_cpu() etc from bswap.h ?

(It seems a pity to have to lose the memory subsystem handling
endianness for us.)

thanks
-- PMM

Reply via email to