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: Update unwind info in memcmp-ssse3.S


Hi,

This patch implements unwind info in memcmp-ssse3.S directly with
CFI_POP and CFI_PUSH. It fixes the unwind info.  Before the fix, I got

Breakpoint 1, __memcmp_ssse3 ()
    at ../sysdeps/i386/i686/multiarch/memcmp-ssse3.S:69
69		ja	L(1bytesend)
(gdb) bt
#0  __memcmp_ssse3 () at ../sysdeps/i386/i686/multiarch/memcmp-ssse3.S:69
#1  0xf7ffbffd in ?? ()
#2  0xf7ff8ffd in ?? ()
#3  0x00000001 in ?? ()
#4  0x000353a3 in ?? ()
#5  0x0000002f in ?? ()
#6  0x0000000d in ?? ()
#7  0x0000000a in ?? ()
#8  0xffffd338 in ?? ()
#9  0x0807966d in _IO_new_do_write (fp=0x80d6890, 
    data=0xf7ffbffd "\001\001\245", to_do=4160720893) at fileops.c:495
#10 0x0804cb43 in do_test (align1=1, align2=1, len=1, exp_result=1)
    at test-memcmp.c:203
#11 0x0804d583 in main () at test-memcmp.c:448
(gdb) 


After my patch, I got

(gdb) bt
#0  __memcmp_ssse3 () at ../sysdeps/i386/i686/multiarch/memcmp-ssse3.S:69
#1  0x0804c547 in do_one_test (impl=0x80d6890, s1=0xf7ffbffd
"\001\001\245", 
    s2=0xf7ff8ffd "\001\001Z", len=1, exp_result=0) at test-memcmp.c:57
#2  0x0804cb43 in do_test (align1=1, align2=1, len=1, exp_result=0)
    at test-memcmp.c:203
#3  0x0804d55f in main () at test-memcmp.c:447



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

	* sysdeps/i386/i686/multiarch/memcmp-ssse3.S (RETURN): Use
	CFI_PUSH directly.
	(less1bytes): Add CFI_POP.
	Update unwind info with CFI_PUSH directly.

diff --git a/sysdeps/i386/i686/multiarch/memcmp-ssse3.S b/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
index 869f37a..968218f 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
@@ -43,7 +43,8 @@
 #define BLK2		BLK1+4
 #define LEN		BLK2+4
 #define RETURN_END	POP (%edi); POP (%esi); POP (%ebx); ret
-#define RETURN		RETURN_END; cfi_restore_state; cfi_remember_state
+#define RETURN		RETURN_END; CFI_PUSH (%ebx); CFI_PUSH (%edi); \
+			CFI_PUSH (%esi)
 
 	.section .text.ssse3,"ax",@progbits
 ENTRY (MEMCMP)
@@ -59,6 +60,7 @@ ENTRY (MEMCMP)
 	add	%ecx, %eax
 	jmp	L(less48bytes)
 
+	CFI_POP (%ebx)
 	ALIGN (4)
 L(less1bytes):
 	jb	L(zero)
@@ -81,7 +83,6 @@ L(48bytesormore):
 	PUSH (%ebx)
 	PUSH (%esi)
 	PUSH (%edi)
-	cfi_remember_state
 	movdqu    (%eax), %xmm3
 	movdqu    (%edx), %xmm0
 	movl	%eax, %edi
@@ -156,15 +157,14 @@ L(shr_0):
 	sub	$0xffff, %edx
 	jnz	L(exit)
 
-
 	lea	(%ecx, %edi,1), %eax
 	lea	(%ecx, %esi,1), %edx
 	POP (%edi)
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_0_gobble):
 	lea	-48(%ecx), %ecx
@@ -209,8 +209,8 @@ L(shr_0_gobble_loop_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_1):
 	cmp	$80, %ecx
@@ -239,8 +239,8 @@ L(shr_1):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_1_gobble):
 	sub	$32, %ecx
@@ -291,9 +291,8 @@ L(shr_1_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_2):
 	cmp	$80, %ecx
@@ -322,8 +321,8 @@ L(shr_2):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_2_gobble):
 	sub	$32, %ecx
@@ -374,8 +373,8 @@ L(shr_2_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_3):
 	cmp	$80, %ecx
@@ -404,8 +403,8 @@ L(shr_3):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_3_gobble):
 	sub	$32, %ecx
@@ -456,8 +455,8 @@ L(shr_3_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_4):
 	cmp	$80, %ecx
@@ -486,8 +485,8 @@ L(shr_4):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_4_gobble):
 	sub	$32, %ecx
@@ -538,8 +537,8 @@ L(shr_4_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_5):
 	cmp	$80, %ecx
@@ -568,8 +567,8 @@ L(shr_5):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_5_gobble):
 	sub	$32, %ecx
@@ -620,8 +619,8 @@ L(shr_5_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_6):
 	cmp	$80, %ecx
@@ -650,8 +649,8 @@ L(shr_6):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_6_gobble):
 	sub	$32, %ecx
@@ -702,8 +701,8 @@ L(shr_6_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_7):
 	cmp	$80, %ecx
@@ -732,8 +731,8 @@ L(shr_7):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_7_gobble):
 	sub	$32, %ecx
@@ -784,8 +783,8 @@ L(shr_7_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_8):
 	cmp	$80, %ecx
@@ -814,8 +813,8 @@ L(shr_8):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_8_gobble):
 	sub	$32, %ecx
@@ -866,8 +865,8 @@ L(shr_8_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_9):
 	cmp	$80, %ecx
@@ -896,8 +895,8 @@ L(shr_9):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_9_gobble):
 	sub	$32, %ecx
@@ -948,8 +947,8 @@ L(shr_9_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_10):
 	cmp	$80, %ecx
@@ -978,8 +977,8 @@ L(shr_10):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_10_gobble):
 	sub	$32, %ecx
@@ -1030,8 +1029,8 @@ L(shr_10_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_11):
 	cmp	$80, %ecx
@@ -1060,8 +1059,8 @@ L(shr_11):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_11_gobble):
 	sub	$32, %ecx
@@ -1112,8 +1111,8 @@ L(shr_11_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_12):
 	cmp	$80, %ecx
@@ -1142,8 +1141,8 @@ L(shr_12):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_12_gobble):
 	sub	$32, %ecx
@@ -1194,8 +1193,8 @@ L(shr_12_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_13):
 	cmp	$80, %ecx
@@ -1224,8 +1223,8 @@ L(shr_13):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_13_gobble):
 	sub	$32, %ecx
@@ -1276,8 +1275,8 @@ L(shr_13_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_14):
 	cmp	$80, %ecx
@@ -1306,8 +1305,8 @@ L(shr_14):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_14_gobble):
 	sub	$32, %ecx
@@ -1358,8 +1357,8 @@ L(shr_14_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_15):
 	cmp	$80, %ecx
@@ -1388,8 +1387,8 @@ L(shr_15):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(shr_15_gobble):
 	sub	$32, %ecx
@@ -1440,8 +1439,8 @@ L(shr_15_gobble_next):
 	POP (%esi)
 	jmp	L(less48bytes)
 
-	cfi_restore_state
-	cfi_remember_state
+	CFI_PUSH (%esi)
+	CFI_PUSH (%edi)
 	ALIGN (4)
 L(exit):
 	pmovmskb %xmm1, %ebx
@@ -1562,8 +1561,8 @@ L(Byte31):
 	movzbl	 -9(%esi), %edx
 	sub	%edx, %eax
 	RETURN_END
-
 	CFI_PUSH (%ebx)
+
 	ALIGN (4)
 L(more8bytes):
 	cmp	$16, %ecx
@@ -1662,7 +1661,6 @@ L(more40bytes):
 	je	L(46bytes)
 	jmp	L(47bytes)
 
-
 	ALIGN (4)
 L(less48bytes):
 	cmp	$8, %ecx
@@ -1680,8 +1678,6 @@ L(less48bytes):
 	jmp	L(7bytes)
 
 
-
-
 	ALIGN (4)
 L(44bytes):
 	mov	-44(%eax), %ecx


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