PERFORCE change 30096 for review

David E. O'Brien obrien at FreeBSD.org
Wed Apr 30 09:36:29 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=30096

Change 30096 by obrien at obrien_trang on 2003/04/30 09:35:47

	Convert to x86-64 ISA using NetBSD as a reference.

Affected files ...

.. //depot/projects/hammer/lib/libc/amd64/gen/alloca.S#4 edit

Differences ...

==== //depot/projects/hammer/lib/libc/amd64/gen/alloca.S#4 (text+ko) ====

@@ -45,15 +45,12 @@
 /* like alloc, but automatic automatic free in return */
 
 ENTRY(alloca)
-	popl	%edx		/*  pop return addr */
-	popl	%eax		/*  pop amount to allocate */
-	movl	%esp,%ecx
-	addl	$3,%eax		/*  round up to next word */
-	andl	$0xfffffffc,%eax
-	subl	%eax,%esp
-	movl	%esp,%eax	/* base of newly allocated space */
-	pushl	8(%ecx)		/* copy possible saved registers */
-	pushl	4(%ecx)
-	pushl	0(%ecx)
-	pushl	%eax		/* dummy to pop at callsite */
-	jmp	*%edx		/* "return" */
+	popq	%rdx		/*  pop return addr */
+	movl	%rsp,%rcx
+	addq	$15,%rdi	/*  round up to 16 bytes */
+	andq	$~15,%rdi
+	subq	%rdi,%rsp
+	movq	%rsp,%rax	/* base of newly allocated space */
+	jmp	*%rdx		/* "return" */
+
+


More information about the p4-projects mailing list