[PATCH, libitm]: GTM_longjmp: Jump indirect from memory address

Uros Bizjak ubizjak@gmail.com
Mon Feb 13 22:57:00 GMT 2012


Hello!

We can jump indirect from memory address, sparing a couple of cycles.

2012-02-14  Uros Bizjak  <ubizjak@gmail.com>

	* config/x86/target.h (GTM_longjmp): Jump indirect from memory address.

Tested on x86_64-pc-linux-gnu {,-m32}.

OK for mainline?

Uros.
-------------- next part --------------
Index: config/x86/sjlj.S
===================================================================
--- config/x86/sjlj.S	(revision 184177)
+++ config/x86/sjlj.S	(working copy)
@@ -119,23 +119,19 @@ SYM(GTM_longjmp):
 	movq	32(%rsi), %r13
 	movq	40(%rsi), %r14
 	movq	48(%rsi), %r15
-	movq	56(%rsi), %rdx
 	movl	%edi, %eax
 	cfi_def_cfa(%rcx, 0)
-	cfi_register(%rip, %rdx)
 	movq	%rcx, %rsp
-	jmp	*%rdx
+	jmp	*56(%rsi)
 #else
 	movl	(%edx), %ecx
 	movl	4(%edx), %ebx
 	movl	8(%edx), %esi
 	movl	12(%edx), %edi
 	movl	16(%edx), %ebp
-	movl	20(%edx), %edx
 	cfi_def_cfa(%ecx, 0)
-	cfi_register(%eip, %edx)
 	movl	%ecx, %esp
-	jmp	*%edx
+	jmp	*20(%edx)
 #endif
 	cfi_endproc
 


More information about the Gcc-patches mailing list