[syslinux:wip.makefixes] __muldi3: gcc doesn't split a 64-bit argument between reg and mem

syslinux-bot for H. Peter Anvin (Intel) hpa at zytor.com
Wed Feb 27 17:18:06 PST 2019


Commit-ID:  fdb3840f1de8b57a17621c3299a75db7ddcbf977
Gitweb:     https://www.syslinux.org/commit/fdb3840f1de8b57a17621c3299a75db7ddcbf977
Author:     H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Wed, 27 Feb 2019 17:13:14 -0800
Committer:  H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Wed, 27 Feb 2019 17:14:36 -0800

__muldi3: gcc doesn't split a 64-bit argument between reg and mem

If a 64-bit value can't fit in the argument registers, it is passed
entirely on the stack. Thus we have one value in %edx:%eax and one
value in [8:4](%esp); we then save a single register so the stack
frame offset has to be adjusted by an additional 4 bytes.

Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>

---
 com32/lib/i386/libgcc/__muldi3.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/com32/lib/i386/libgcc/__muldi3.S b/com32/lib/i386/libgcc/__muldi3.S
index 5f0da638..80e31d43 100644
--- a/com32/lib/i386/libgcc/__muldi3.S
+++ b/com32/lib/i386/libgcc/__muldi3.S
@@ -11,10 +11,11 @@
 __muldi3:
 	/* i386 */
 	push  %esi
+	movl  8(%esp),%ecx
 	movl  %eax,%esi
 	push  %edx
 	mull  %ecx
-	imull 8(%esp),%esi
+	imull 12(%esp),%esi
 	addl  %esi,%edx
 	pop   %esi
 	imull %esi,%ecx


More information about the Syslinux-commits mailing list