This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86-64: Add sinf with FMA


On 12/04/2017 09:59 PM, Joseph Myers wrote:
On Mon, 4 Dec 2017, H.J. Lu wrote:

Is

(*__errno_location ()) = xxx
If anything I'd expect a direct TLS initial-exec access to errno to be
faster.

On x86-64, direct TLS access usually results in more machine code than calling __errno_location:

  Direct access:    7 bytes for the load of the TLS offset
                    7 bytes for storing a constant to the TLS variable
  __errno_location: 5 bytes for calling __errno_location
                    6 bytes for storing the constant

Since errno is typically accessed on error paths only, direct TLS access is not a win because it bloats the code.

Even if stack alignment is required, it is typically possible to d this with just a push/pop pair, adding two more bytes to the __errno_location approach, so it is still one byte shorter than direct access.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]