[Bug other/60145] [AVR] Suboptimal code for byte order shuffling using shift and or
matthijs at stdin dot nl
gcc-bugzilla@gcc.gnu.org
Mon Nov 28 12:33:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60145
--- Comment #3 from Matthijs Kooijman <matthijs at stdin dot nl> ---
Thanks for digging into this :-D
I suppose you meant
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=242907 instead of the
commit you linked (which is also nice btw, I noticed that extra sbiw in some
places as well).
Looking at the generated assembly, the optimizations look like fairly simple
(composable) translations, but I assume that the optimization needs to happen
before/while the assembly is generated, not afterwards. And then I can see that
the patterns would indeed become complex.
My goal was indeed to compose values. Using a union is endian-dependent, which
is a downside.
If I understand your vector-example correctly, vectors are always stored as big
endian, so using this approach would be portable? I couldn't find anything
about this in the documentation, though.
More information about the Gcc-bugs
mailing list