[patch] Use unaligned access on x86_64
Rafael Espíndola
rafael.espindola@gmail.com
Tue Jun 2 15:08:00 GMT 2015
> P.S.: I just tried it on gcc-112 (powerpc64le) and it looks like
> unaligned is also a win there
>
> from
>
> 2.354317085 seconds time elapsed
> ( +- 1.35% )
>
> to
>
> 2.246461651 seconds time elapsed
> ( +- 0.18% )
This got me thinking that it might be better to just use valid
unaligned access everywhere.
To make sure I didn't break architectures with strict alignment, I
started by building gold with -fsanitize=alignment.
This found that even current master doesn't always align correctly.
The backtrace of the first bug is attached.
The attached patch is a basic work in progress of what the final
version would look like. It is enough to build clang with no invalid
unaligned reads (relocation processing still has unaligned writes).
The net result is
* Architectures with fast unaligned access get faster.
* Architectures with strict alignment now at least work.
* Architectures with slow unaligned access might get slower, but not
sure if there is any.
Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bt
Type: application/octet-stream
Size: 3681 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150602/6ff2c54c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 40424 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150602/6ff2c54c/attachment.bin>
More information about the Binutils
mailing list