Hello,
Le 2021-03-07 à 10 h 26, Niels Möller a écrit :
Hmm. Maybe better to define an optional swap operation. Like
Thanks a lot for that, I wouldn't be able to come up with it by myself...
> The reason it doesn't work is the type of R. R is now an unaligned
> uint8_t *. *(R + (i * 8)) (the
Maamoun TK writes:
> I considered to use m4 macros but it "mangles" parameter names, it becomes
> hard for reader to keep track on the macro body. However, I'm still up to
> change it to m4 macros if you like.
The below patch seems to work. It's a drawback that m4 doesn't have
named parameters,
Nicolas Mora writes:
> I've added 2 macros definitions: MSB_XOR_T_WRAP and MSB_XOR_T_UNWRAP,
> I couldn't find how to make just one macro for both cases because of
> the direction of the xor.
Hmm. Maybe better to define an optional swap operation. Like
#if WORDS_BIGENDIAN
#define bswap_if_le(x)
Nicolas Mora writes:
> memcpy (I.b + 8, R + (i * 8), 8); // This one works
> I.u64[1] = *(R + (i * 8)); // This one doesn't work
>
> Is there something I'm missing?
The reason it doesn't work is the type of R. R is now an unaligned
uint8_t *. *(R + (i * 8)) (the same as R[i*8]) is an uint8_t, no