Re: Inefficient use of 64-bit addresses in Clang

2019-08-13 Thread Agner Fog
It's a difference in memory model. clang 6.0.0 under ubuntu with --target=x86_64-pc-cygwin gives relative addresses, unless you specify -mcmodel=large. Cygwin clang with -mcmodel=small does the right thing: use relative addresses. The -mcmodel=small option appears to work differently for

Re: Inefficient use of 64-bit addresses in Clang

2019-08-12 Thread falk . tannhauser
References: <578eb489-9391-9009-82ad-676eeb4c1...@agner.org> In-Reply-To: <578eb489-9391-9009-82ad-676eeb4c1...@agner.org> Could the different behaviour between Cygwin and Linux simply be due to different Clang versions? The current version under Cygwin is 5.0.1, while the latest version

Re: Inefficient use of 64-bit addresses in Clang

2019-08-12 Thread Mark Geisert
Agner Fog wrote: Clang is using 64-bit absolute addresses when accessing static data in 64-bit mode. This is inefficient because it requires an extra 10-bytes long instruction for loading an address into a register every time it needs to access static data. All other compilers use relative

Inefficient use of 64-bit addresses in Clang

2019-08-06 Thread Agner Fog
Clang is using 64-bit absolute addresses when accessing static data in 64-bit mode. This is inefficient because it requires an extra 10-bytes long instruction for loading an address into a register every time it needs to access static data. All other compilers use relative addresses. Example: