From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11906 invoked by alias); 5 Jun 2009 13:03:16 -0000 Received: (qmail 11648 invoked by uid 22791); 5 Jun 2009 13:03:10 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Jun 2009 13:03:04 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n55D33qF023118; Fri, 5 Jun 2009 09:03:03 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n55D32Lv024913; Fri, 5 Jun 2009 09:03:02 -0400 Received: from zebedee.pink (vpn-12-117.rdu.redhat.com [10.11.12.117]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n55D2xNr030380; Fri, 5 Jun 2009 09:03:00 -0400 Message-ID: <4A291783.2030602@redhat.com> Date: Fri, 05 Jun 2009 13:03:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20081009) MIME-Version: 1.0 To: Dave Korn CC: Anthony Green , Anthony Green , libffi-discuss@sourceware.org, gcc-patches , Java Patch List Subject: Re: libffi merge References: <4A255CF4.7030203@redhat.com> <4A265860.2050207@redhat.com> <4A26646A.80300@moxielogic.com> <4A26D4AC.8080507@redhat.com> <4A26DC78.6010508@redhat.com> <4A27A347.7070009@redhat.com> <4A27A508.2000409@redhat.com> <4A27A87F.2000405@redhat.com> <4A27C08D.9070801@moxielogic.com> <4A27C2B9.9050105@redhat.com> <4A27D82F.1030507@gmail.com> <4A27E2E4.2090902@redhat.com> <4A27EB15.9090804@redhat.com> <4A27F07F.4030608@redhat.com> <4A27F4BB.2070902@gmail.com> <4A27FE69.8020109@redhat.com> <4A290E5D.4020004@gmail.com> <4A291543.4030105@redhat.com> In-Reply-To: <4A291543.4030105@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2009-q2/txt/msg00130.txt.bz2 x86 changes, patch the second: gcc -> libffi Andrew. 2009-06-05 Andrew Haley * src/x86/win32.S (_ffi_closure_STDCALL): Import from gcc. Index: src/x86/win32.S =================================================================== RCS file: /cvs/libffi/libffi/src/x86/win32.S,v retrieving revision 1.7 diff -u -w -r1.7 win32.S --- src/x86/win32.S 4 Jun 2009 14:43:40 -0000 1.7 +++ src/x86/win32.S 5 Jun 2009 13:01:52 -0000 @@ -264,22 +264,6 @@ .ffi_call_STDCALL_end: .LFE2: - .globl _ffi_closure_STDCALL -_ffi_closure_STDCALL: - pushl %ebp - movl %esp, %ebp - subl $40, %esp - leal -24(%ebp), %edx - movl %edx, -12(%ebp) /* resp */ - leal 12(%ebp), %edx /* account for stub return address on stack */ - movl %edx, 4(%esp) /* args */ - leal -12(%ebp), %edx - movl %edx, (%esp) /* &resp */ - call _ffi_closure_SYSV_inner - movl -12(%ebp), %ecx - jmp .Lcls_return_result -.ffi_closure_STDCALL_end: - # This assumes we are using gas. .balign 16 .globl _ffi_closure_SYSV @@ -299,7 +283,6 @@ movl %edx, (%esp) /* &resp */ call _ffi_closure_SYSV_inner movl -12(%ebp), %ecx -.Lcls_return_result: cmpl $FFI_TYPE_INT, %eax je .Lcls_retint cmpl $FFI_TYPE_FLOAT, %eax @@ -409,6 +392,70 @@ #endif /* !FFI_NO_RAW_API */ + # This assumes we are using gas. + .balign 16 + .globl _ffi_closure_STDCALL + .def _ffi_closure_STDCALL; .scl 2; .type 32; .endef +_ffi_closure_STDCALL: +.LFB5: + pushl %ebp +.LCFI9: + movl %esp, %ebp +.LCFI10: + subl $40, %esp + leal -24(%ebp), %edx + movl %edx, -12(%ebp) /* resp */ + leal 12(%ebp), %edx /* account for stub return address on stack */ + movl %edx, 4(%esp) /* args */ + leal -12(%ebp), %edx + movl %edx, (%esp) /* &resp */ + call _ffi_closure_SYSV_inner + movl -12(%ebp), %ecx + /* It would be nice to just share this code with the + duplicate sequence in _ffi_closure_SYSV, if only + there were some way to represent that in the EH info. */ + cmpl $FFI_TYPE_INT, %eax + je .Lscls_retint + cmpl $FFI_TYPE_FLOAT, %eax + je .Lscls_retfloat + cmpl $FFI_TYPE_DOUBLE, %eax + je .Lscls_retdouble + cmpl $FFI_TYPE_LONGDOUBLE, %eax + je .Lscls_retldouble + cmpl $FFI_TYPE_SINT64, %eax + je .Lscls_retllong + cmpl $FFI_TYPE_SINT8, %eax /* 1-byte struct */ + je .Lscls_retstruct1 + cmpl $FFI_TYPE_SINT16, %eax /* 2-bytes struct */ + je .Lscls_retstruct2 +.Lscls_epilogue: + movl %ebp, %esp + popl %ebp + ret +.Lscls_retint: + movl (%ecx), %eax + jmp .Lscls_epilogue +.Lscls_retfloat: + flds (%ecx) + jmp .Lscls_epilogue +.Lscls_retdouble: + fldl (%ecx) + jmp .Lscls_epilogue +.Lscls_retldouble: + fldt (%ecx) + jmp .Lscls_epilogue +.Lscls_retllong: + movl (%ecx), %eax + movl 4(%ecx), %edx + jmp .Lscls_epilogue +.Lscls_retstruct1: + movsbl (%ecx), %eax + jmp .Lscls_epilogue +.Lscls_retstruct2: + movswl (%ecx), %eax + jmp .Lscls_epilogue +.ffi_closure_STDCALL_end: +.LFE5: .section .eh_frame,"w" .Lframe1: @@ -571,3 +618,34 @@ .LEFDE4: #endif /* !FFI_NO_RAW_API */ + +.LSFDE5: + .long .LEFDE5-.LASFDE5 /* FDE Length */ +.LASFDE5: + .long .LASFDE5-.Lframe1 /* FDE CIE offset */ +#if defined __PIC__ && defined HAVE_AS_X86_PCREL + .long .LFB5-. /* FDE initial location */ +#else + .long .LFB5 +#endif + .long .LFE5-.LFB5 /* FDE address range */ +#ifdef __PIC__ + .byte 0x0 /* .uleb128 0x0; Augmentation size */ +#endif + /* DW_CFA_xxx CFI instructions go here. */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI9-.LFB5 + .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */ + .byte 0x8 /* .uleb128 0x8 */ + .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */ + .byte 0x2 /* .uleb128 0x2 */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI10-.LCFI9 + .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */ + .byte 0x5 /* .uleb128 0x5 */ + + /* End of DW_CFA_xxx CFI instructions. */ + .align 4 +.LEFDE5: