Re: How to efficiently unpack 8 bytes from a 64-bit integer?

2016-02-19 Thread Phil Ruffwind
> Can you please open a bugreport? Done: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69871

Re: How to efficiently unpack 8 bytes from a 64-bit integer?

2016-02-19 Thread Phil Ruffwind
I tried to look for a workaround for this. It seemed that using a union instead of memcpy was enough to convince GCC to optimize into a single "mov". struct alpha unpack(uint64_t x) { union { struct alpha r; uint64_t i; } u; u.i = x;

How to efficiently unpack 8 bytes from a 64-bit integer?

2016-02-18 Thread Phil Ruffwind
Hello all, I am trying to analyze the optimized results of following code. The intent is to unpack a 64-bit integer into a struct containing eight 8-bit integers. The optimized result was very promising at first, but I then discovered that whenever the unpacking function gets inlined into anothe