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]

PATCH: Align labels and simplify unwind info in strcmp-sse4.S


Hi,

This patch aligns jump targets and simplifies unwind info in
strcmp-sse4.S.


H.J.
---
2010-02-16  H.J. Lu  <hongjiu.lu@intel.com>

	* sysdeps/i386/i686/multiarch/strcmp-sse4.S (RETURN): New.
	(eq): Use it.
	(neq_bigger): Likewise.
	(end): Aligned to 16byte.
	(more16byteseq): Likewise.
	(neq): Likewise.

diff --git a/sysdeps/i386/i686/multiarch/strcmp-sse4.S b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
index e26f434..f7e619c 100644
--- a/sysdeps/i386/i686/multiarch/strcmp-sse4.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
@@ -40,6 +40,7 @@
 # endif
 # define STR1		4
 # define STR2		STR1+4
+# define RETURN		ret
 #else
 # ifndef STRCMP
 #  define STRCMP	__strncmp_sse4_2
@@ -47,6 +48,7 @@
 # define STR1		8
 # define STR2		STR1+4
 # define CNT		STR2+4
+# define RETURN		POP (%ebp); ret; CFI_PUSH (%ebp)
 #endif
 
 	.section .text.sse4.2,"ax",@progbits
@@ -176,7 +178,6 @@ L(first4bytes):
 	PUSH	(%ebx)
 	PUSH	(%edi)
 	PUSH	(%esi)
-	cfi_remember_state
 	mov	%edx, %edi
 	mov	%eax, %esi
 	xorl	%eax, %eax
@@ -223,6 +224,7 @@ L(crosspage):
 	add	$16, %esi
 	jmp	L(check_offset)
 
+	.p2align 4
 L(end):
 	jnc	L(ret)
 #ifdef USE_AS_STRNCMP
@@ -242,8 +244,12 @@ L(ret):
 #endif
 	ret
 
-	cfi_restore_state
+	.p2align 4
 #ifdef USE_AS_STRNCMP
+	CFI_PUSH (%ebp)
+	CFI_PUSH (%ebx)
+	CFI_PUSH (%edi)
+	CFI_PUSH (%esi)
 L(more16byteseq):
 	POP	(%esi)
 	POP	(%edi)
@@ -251,27 +257,17 @@ L(more16byteseq):
 #endif
 L(eq):
 	xorl	%eax, %eax
-#ifdef USE_AS_STRNCMP
-	POP	(%ebp)
-#endif
-	ret
+	RETURN
 
-#ifdef USE_AS_STRNCMP
-	CFI_PUSH (%ebp)
-#endif
+	.p2align 4
 L(neq):
 	mov	$1, %eax
 	ja	L(neq_bigger)
 	neg	%eax
 L(neq_bigger):
-#ifdef USE_AS_STRNCMP
-	POP	(%ebp)
-#endif
-	ret
+	RETURN
+
 	.p2align 4
-#ifdef USE_AS_STRNCMP
-	CFI_PUSH (%ebp)
-#endif
 L(less16bytes):
 	add	$0xfefefeff, %ecx
 	jnc	L(less4bytes)


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