From patchwork Fri Nov 2 14:16:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 196565 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 3E3A22C0085 for ; Sat, 3 Nov 2012 01:16:51 +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=1352470612; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=DlIBW9b hQT+XKXusmckHLtKMSDA=; b=R0O0JXn7iWS9eEkELpdGYthBensqi75vntxZRIh m9VpoAeS3LDTlwzcrBSzvMTI491KqRYn/oxTzLRNbpPkaZu7BdS0agbiLwv0gZK5 45O1efeshhFwa/Lpr3MSFEkWSNO0rxWgUhbOQrCVT00sVeWISP7NOsC3y61mtPeI kx6A= 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:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=EBwxQYs9rbaP2LDtDNbKmPJrGZ0oDHW7RcUbOb8C6Jl+M1k65l4EbwDqlFXfDL tAdKzfcJmbO7vBrywRTl7tXrhFDaWla1JYlMGigHW6hXzqnv7VE/sqjUY1DVRsFh GxXzU9WUuSo7rzoLwtSJ27ICg8FoFWemt/Er4Sjs/tg2I=; Received: (qmail 12349 invoked by alias); 2 Nov 2012 14:16:44 -0000 Received: (qmail 12340 invoked by uid 22791); 2 Nov 2012 14:16:43 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Nov 2012 14:16:35 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa11so2401036pad.20 for ; Fri, 02 Nov 2012 07:16:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.86.102 with SMTP id o6mr5816041paz.11.1351865794687; Fri, 02 Nov 2012 07:16:34 -0700 (PDT) Received: by 10.66.246.232 with HTTP; Fri, 2 Nov 2012 07:16:34 -0700 (PDT) Date: Fri, 2 Nov 2012 15:16:34 +0100 Message-ID: Subject: [PATCH, i386]: Fix PR55175, i386/sfp-exceptions.c:52:7: error: impossible constraint in 'asm' From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! Attached patch disable exceptions and rounding mode handling code in soft-fp when _SOFT_FLOAT is enabled. We need real hardware (x87 or SSE) to generate exceptions and real control register to know current rounding mode. RTEMS defines _SOFT_FLOAT, when -msoft-float is in effetct and this macro is what patch uses to disable relevant code. 2012-11-02 Uros Bizjak PR target/55175 * config/i386/sfp-exceptions.c: Guard with _SOFT_FLOAT. * config/i386/sfp-machine.h: Guard exception handling code with _SOFT_FLOAT. * config/i386/32/sfp-machine.h: Guard rounding handling code with _SOFT_FLOAT. * config/i386/64/sfp-machine.h: Ditto. Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu, also bootstrapped on RTEMS by Joel. Patch was committed to mainline SVN. Uros. Index: config/i386/32/sfp-machine.h =================================================================== --- config/i386/32/sfp-machine.h (revision 193091) +++ config/i386/32/sfp-machine.h (working copy) @@ -77,6 +77,7 @@ #define _FP_NANFRAC_E _FP_QNANBIT_E, 0, 0, 0 #define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0, 0, 0 +#ifndef _SOFT_FLOAT #define FP_RND_NEAREST 0 #define FP_RND_ZERO 0xc00 #define FP_RND_PINF 0x800 @@ -91,3 +92,4 @@ do { \ __asm__ __volatile__ ("fnstcw\t%0" : "=m" (_fcw)); \ } while (0) +#endif Index: config/i386/64/sfp-machine.h =================================================================== --- config/i386/64/sfp-machine.h (revision 193091) +++ config/i386/64/sfp-machine.h (working copy) @@ -18,6 +18,7 @@ #define _FP_NANFRAC_E _FP_QNANBIT_E, 0 #define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0 +#ifndef _SOFT_FLOAT #define FP_RND_NEAREST 0 #define FP_RND_ZERO 0x6000 #define FP_RND_PINF 0x4000 @@ -32,3 +33,4 @@ do { \ __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ } while (0) +#endif Index: config/i386/sfp-exceptions.c =================================================================== --- config/i386/sfp-exceptions.c (revision 193091) +++ config/i386/sfp-exceptions.c (working copy) @@ -21,6 +21,7 @@ * . */ +#ifndef _SOFT_FLOAT #include "sfp-machine.h" struct fenv @@ -88,3 +89,4 @@ asm volatile ("fwait"); } }; +#endif Index: config/i386/sfp-machine.h =================================================================== --- config/i386/sfp-machine.h (revision 193091) +++ config/i386/sfp-machine.h (working copy) @@ -40,6 +40,7 @@ R##_c = FP_CLS_NAN; \ } while (0) +#ifndef _SOFT_FLOAT #define FP_EX_INVALID 0x01 #define FP_EX_DENORM 0x02 #define FP_EX_DIVZERO 0x04 @@ -56,6 +57,7 @@ } while (0); #define FP_ROUNDMODE (_fcw & FP_RND_MASK) +#endif #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321