From patchwork Sat Jan 14 20:42:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 136112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8219CB6F9F for ; Sun, 15 Jan 2012 07:42:20 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1327178541; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=SDn06bk 2HyPqeFUQvmceP5ecBXY=; b=a7R01O/bsVB+nnFDL8lABoloS0df+nbSesunNnc DKaC6yeWqNAgwvR3n1COPZu2Jq3momMtyCCztsB9CbTd65XmlTnq+9I2JKg6SupD UYCiAXIPfM15drYc9txDwJLW3yXn7jAQseesjPYurR0axisFbCuvdcsBM9hpCvcA Jn3A= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Auth-Info:Received:Received:From:To:Subject:X-Yow:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=T/zpozrf3wHZiStugrg3OUnn54kYPnd6aiKIsgcyqqv988jB7tBNqdznWkaCvo UwN/P+io+sBjJeNesbs/8wq8yNvmML5mqPY7oa0AJRYUY7Vd/YtFwCKHl3ewPdD/ CnweBc5Rcsev8bQQVwXK+hFMerWnz8d/bmmD/J6lh1a2g=; Received: (qmail 22123 invoked by alias); 14 Jan 2012 20:42:17 -0000 Received: (qmail 22114 invoked by uid 22791); 14 Jan 2012 20:42:16 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_BF X-Spam-Check-By: sourceware.org Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Jan 2012 20:42:04 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 2C7911C0C155 for ; Sat, 14 Jan 2012 21:42:02 +0100 (CET) X-Auth-Info: /Ebia3HwGd3f2Tn5a9jx6sfc/jVsHJommDPu7q2CekE= Received: from igel.home (ppp-88-217-118-21.dynamic.mnet-online.de [88.217.118.21]) by mail.mnet-online.de (Postfix) with ESMTPA id BADA71C00067 for ; Sat, 14 Jan 2012 21:42:02 +0100 (CET) Received: by igel.home (Postfix, from userid 501) id 71A34CA29A; Sat, 14 Jan 2012 21:42:02 +0100 (CET) From: Andreas Schwab To: gcc-patches@gcc.gnu.org Subject: [PATCH] libffi fixes for m68k X-Yow: The LOGARITHM of an ISOSCELES TRIANGLE is TUESDAY WELD!! Date: Sat, 14 Jan 2012 21:42:02 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The only way to detect compiling for a plain 68000 is the absense of other defines since __mc68000__ is always defined. Also, gcc defines __HAVE_68881__, not __MC68881__. The latter fixes failures of all tests involving floating point return values. Tested on m68k-linux. Andreas. 2012-01-14 Andreas Schwab * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain mc68000. Test for __HAVE_68881__ in addition to __MC68881__. --- libffi/src/m68k/sysv.S | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libffi/src/m68k/sysv.S b/libffi/src/m68k/sysv.S index c782f51..dfdd864 100644 --- a/libffi/src/m68k/sysv.S +++ b/libffi/src/m68k/sysv.S @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1998 Andreas Schwab + sysv.S - Copyright (c) 1998, 2012 Andreas Schwab Copyright (c) 2008 Red Hat, Inc. m68k Foreign Function Interface @@ -87,7 +87,7 @@ ffi_call_SYSV: | If the return value pointer is NULL, assume no return value. | NOTE: On the mc68000, tst on an address register is not supported. -#if defined(__mc68000__) && !defined(__mcoldfire__) +#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__) cmp.w #0, %a1 #else tst.l %a1 @@ -109,7 +109,7 @@ retlongint: retfloat: btst #2,%d2 jbeq retdouble -#if defined(__MC68881__) +#if defined(__MC68881__) || defined(__HAVE_68881__) fmove.s %fp0,(%a1) #else move.l %d0,(%a1) @@ -119,7 +119,7 @@ retfloat: retdouble: btst #3,%d2 jbeq retlongdouble -#if defined(__MC68881__) +#if defined(__MC68881__) || defined(__HAVE_68881__) fmove.d %fp0,(%a1) #else move.l %d0,(%a1)+ @@ -130,7 +130,7 @@ retdouble: retlongdouble: btst #4,%d2 jbeq retpointer -#if defined(__MC68881__) +#if defined(__MC68881__) || defined(__HAVE_68881__) fmove.x %fp0,(%a1) #else move.l %d0,(%a1)+ @@ -199,7 +199,7 @@ ffi_closure_SYSV: move.l (%a0),%d1 jra .Lcls_epilogue .Lcls_ret_float: -#if defined(__MC68881__) +#if defined(__MC68881__) || defined(__HAVE_68881__) fmove.s (%a0),%fp0 #else move.l (%a0),%d0 @@ -209,7 +209,7 @@ ffi_closure_SYSV: lsr.l #2,%d0 jne 1f jcs .Lcls_ret_ldouble -#if defined(__MC68881__) +#if defined(__MC68881__) || defined(__HAVE_68881__) fmove.d (%a0),%fp0 #else move.l (%a0)+,%d0 @@ -217,7 +217,7 @@ ffi_closure_SYSV: #endif jra .Lcls_epilogue .Lcls_ret_ldouble: -#if defined(__MC68881__) +#if defined(__MC68881__) || defined(__HAVE_68881__) fmove.x (%a0),%fp0 #else move.l (%a0)+,%d0