[Vm-dev] [commit][3668] Provide macros for conditionnally
byte-swapping depending on VM endianness
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Tue Apr 5 18:42:47 UTC 2016
Oops, sorry for the missing endif, I messed up with file merging.
2016-04-05 20:11 GMT+02:00 <commits at squeakvm.org>:
>
> Revision: 3668
> Author: nice
> Date: 2016-04-05 11:11:36 -0700 (Tue, 05 Apr 2016)
> Log Message:
> -----------
> Provide macros for conditionnally byte-swapping depending on VM endianness
>
> Modified Paths:
> --------------
> branches/Cog/platforms/Cross/vm/sqMemoryAccess.h
>
> Modified: branches/Cog/platforms/Cross/vm/sqMemoryAccess.h
> ===================================================================
> --- branches/Cog/platforms/Cross/vm/sqMemoryAccess.h 2016-04-02
> 21:58:22 UTC (rev 3667)
> +++ branches/Cog/platforms/Cross/vm/sqMemoryAccess.h 2016-04-05
> 18:11:36 UTC (rev 3668)
> @@ -233,7 +233,16 @@
> ( (unsigned long long)(x) >> 56))
> #endif
>
> +/* Since Large Integers are Bytes Oops allways stored as little endian,
> + the following macros are handy to retrieve 4 or 8 byte limbs */
> +#if VMBIGENDIAN
> +# define SQ_SWAP_4_BYTES_IF_BIGENDIAN(x) SQ_SWAP_4_BYTES(x)
> +# define SQ_SWAP_8_BYTES_IF_BIGENDIAN(x) SQ_SWAP_8_BYTES(x)
> +#else
> +# define SQ_SWAP_4_BYTES_IF_BIGENDIAN(x) (x)
> +# define SQ_SWAP_8_BYTES_IF_BIGENDIAN(x) (x)
>
> +
> /* This doesn't belong here, but neither do 'self flag: ...'s belong in
> the
> image. We use a macro, not an inline function; we need no trace of
> flag.
> */
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160405/ff2f800e/attachment.htm
More information about the Vm-dev
mailing list