optimize i386 ___tls_get_addr asm
[musl] / src / thread / i386 / tls.s
1 .text
2 .global ___tls_get_addr
3 .type ___tls_get_addr,@function
4 ___tls_get_addr:
5         mov %gs:4,%edx
6         mov (%eax),%ecx
7         cmp %ecx,(%edx)
8         jc 1f
9         mov 4(%eax),%eax
10         add (%edx,%ecx,4),%eax
11         ret
12 1:      push %eax
13         call __tls_get_addr
14         pop %edx
15         ret