diff options
author | 2010-10-18 16:18:48 +0000 | |
---|---|---|
committer | 2010-10-18 16:18:48 +0000 | |
commit | 6c737afc7574107d351d5344e1372e3116fc48eb (patch) | |
tree | 9b9514fb1ac6bc9d4e588be6c6d5a0c33531c14f /lib/libssl/src | |
parent | remove v2.0 initialization values for the Osprey. (diff) | |
download | wireguard-openbsd-6c737afc7574107d351d5344e1372e3116fc48eb.tar.xz wireguard-openbsd-6c737afc7574107d351d5344e1372e3116fc48eb.zip |
Add __attribute__((aligned(4))) to __packed Tx/Rx descriptors.
This makes gcc generate much more efficient code on architectures
with strong alignment constraints (like sparc64).
We use __packed to tell the compiler to not insert padding between
fields but the start of the descriptors is always 32-bit aligned.
When __packed is used, gcc assumes worst case scenario and generates
complicated code to prevent unaligned accesses.
Inspired by a similar change to ath9k.
Tested on sparc64.
For the record, example to set a field to 1 on a sparc64:
without __attribute__((aligned(4))):
ldub [%g2], %g1
and %g1, 0, %g1
stb %g1, [%g2]
ldub [%g2+1], %g1
and %g1, 0, %g1
stb %g1, [%g2+1]
ldub [%g2+2], %g1
and %g1, 0, %g1
stb %g1, [%g2+2]
ldub [%g2+3], %g1
and %g1, 0, %g1
or %g1, 1, %g1
stb %g1, [%g2+3]
with __attribute__((aligned(4))):
mov 1, %g1
st %g1, [%g2]
Diffstat (limited to 'lib/libssl/src')
0 files changed, 0 insertions, 0 deletions