Selaa lähdekoodia

optimize i386 ___tls_get_addr asm

Rich Felker 10 vuotta sitten
vanhempi
sitoutus
880c479f0e
1 muutettua tiedostoa jossa 8 lisäystä ja 1 poistoa
  1. 8 1
      src/thread/i386/tls.s

+ 8 - 1
src/thread/i386/tls.s

@@ -2,7 +2,14 @@
 .global ___tls_get_addr
 .type ___tls_get_addr,@function
 ___tls_get_addr:
-	push %eax
+	mov %gs:4,%edx
+	mov (%eax),%ecx
+	cmp %ecx,(%edx)
+	jc 1f
+	mov 4(%eax),%eax
+	add (%edx,%ecx,4),%eax
+	ret
+1:	push %eax
 	call __tls_get_addr
 	pop %edx
 	ret