From patchwork Fri Sep 30 17:02:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Greenhalgh X-Patchwork-Id: 677149 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3slySJ6YLyz9ryr for ; Sat, 1 Oct 2016 03:03:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Gk8kB6AA; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=XDNSgVSMLkeQiwSO bBvG/JtWR6sVGX67Oa1xKBVHO/7oyQk6I3KXXBicgDiO3MxxTRCT6SsKGuBeyDhm 4VVOMS+34cwTfDNRg5p7ZZAs/yPEp3WYLh2hkJHJn2aWeE3I39ATiNU82PDeK0l+ immuRA1nvTxt/f2bmOiprNuVhcA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=zu/1y3TarOCvyDOgafaEHE 7Vm/E=; b=Gk8kB6AAEBNOX0fta7eULpFRfn0+kloPF/sP7FrGiSwoh8MbgQAUqw A8n8CPeFFF06YNYH5Z1Kb9t/HkWOB0eQBT/Q460GAPi6/lRG4+FrOyzsfb/2L7e3 p/PK0haSGdQ55ivrt3PTyq9eQZyldG8jLbJtErg+CVcxsIqTInPZ0= Received: (qmail 96583 invoked by alias); 30 Sep 2016 17:03:02 -0000 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 Received: (qmail 96518 invoked by uid 89); 30 Sep 2016 17:03:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL, BAYES_50, SPF_PASS autolearn=ham version=3.3.2 spammy=kid, trunctfhf2.c, floattihfc, fixunshftic X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Sep 2016 17:02:51 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02lp0150.outbound.protection.outlook.com [213.199.180.150]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-19-c0ghq3P8NPmxfo6ie0MPSQ-1; Fri, 30 Sep 2016 18:02:47 +0100 Received: from VI1PR0801CA0008.eurprd08.prod.outlook.com (10.167.193.146) by HE1PR0801MB1882.eurprd08.prod.outlook.com (10.168.94.13) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.639.5; Fri, 30 Sep 2016 17:02:46 +0000 Received: from DB3FFO11FD026.protection.gbl (2a01:111:f400:7e04::188) by VI1PR0801CA0008.outlook.office365.com (2603:10a6:800:32::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.619.10 via Frontend Transport; Fri, 30 Sep 2016 17:02:46 +0000 Received: from nebula.arm.com (217.140.96.140) by DB3FFO11FD026.mail.protection.outlook.com (10.47.217.57) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.5 via Frontend Transport; Fri, 30 Sep 2016 17:02:45 +0000 Received: from e107456-lin.cambridge.arm.com (10.1.2.79) by mail.arm.com (10.1.106.66) with Microsoft SMTP Server id 14.3.294.0; Fri, 30 Sep 2016 18:02:42 +0100 From: James Greenhalgh To: CC: , Subject: [Patch libgcc 9/11] Update soft-fp from glibc Date: Fri, 30 Sep 2016 18:02:38 +0100 Message-ID: <1475254958-11136-1-git-send-email-james.greenhalgh@arm.com> In-Reply-To: <1475254617-10825-1-git-send-email-james.greenhalgh@arm.com> References: <1475254617-10825-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(377424004)(199003)(189002)(11100500001)(33646002)(92566002)(626004)(6666003)(2351001)(87936001)(8936002)(36756003)(104016004)(189998001)(2906002)(229853001)(86362001)(110136003)(4326007)(106466001)(84326002)(8676002)(77096005)(50226002)(2476003)(512874002)(586003)(5890100001)(26826002)(568964002)(5660300001)(4610100001)(7846002)(2950100002)(50986999)(305945005)(19580395003)(6916009)(246002)(356003)(76176999)(19580405001)(15650500001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0801MB1882; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD026; 1:iQLRbzAGUy2CPvI204htCHlnyV34cLkN94FmJooCM8qdqAdLNO8A5Y0pgIgoLLhA7h6pTyijY5fQ50QKOZSKsWLoKprunYktnfrARkCDAFzNPECoXz/FuyD5jOg1/2H754sh/oy93nk3+fgaL27jO/4Id3pjMt92Kaj37ZcpZyOkRYWOrEttWgYcEogmCbf0MqZVqFzq34Uw8l4BmUyB1LlXSrMGQUmn/v3CxVobucDs59NYeoq3ZicKR0bvy8wbQlGGZ57LY5ltm9lsy91oldt5csuAxduM0erTb0CFmTaRsQpw+ix7FYP/mngstLmpiEHcJwaSTI3JMJlynAXQCfBLk/geei1NyUdta5FusSJ27qh62eZq66poJTTLme5n0XSULl1/UeWCn0qPqFlhAr66h++IQP/68V0a6LDlSXPVE3OAA0ZHWFctuuoY08y6z7oD3+fEIJiT0Nfn0qk1A7oqb4Pd+fNuuWfIYJ/RW5Kbzp8CgOioahNGV2ZtZcf8Rje0IR/dbNfyvTXjLbEOP2n/AdEVa0sm+Mm/cYSRVROQRyt6x2N/IZuTDsvlDRM4uS8hLjivsCK93+z5s9SJOMfIw8pcwXOiE7j8skb96KU= X-MS-Office365-Filtering-Correlation-Id: 38a54967-809b-4642-a12c-08d3e95399af X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1882; 2:S6LBbJzqSRuJCIQQsp4t/12t9euneOZfJS3jHxPE1UyFnbamVfVtbf169z9X0GgZDUhzQ0cteRzpgpbE0xYQfP7AdUnoScUi6Ei/zKOxKtRV/vDdQliuoghBBaUXNU4V3Ee1UZ4EruWSNQ7OGN4GyK3uHC+3x2L626TjBXd0Cln62rQg1s0C7J9WqTejcNef; 3:2ScB+vMReBf2k9UNfUJclMEwTj5z760ZbMh65U0wkQebaUQnB8ud0kh5D4jAoN/MwIffuPb8XqSHArfhoVStCAHxDkPj54V7ipiPE6SYBxJhiBTMyVx4Tt0GJ9HXRKGbd0FvU8tYI3zUjPNJcUdV20NFhdqE+8DB+FBkUnagponWgS3tZ/o2kyvjtj3Aln+HsreP5PytGl0alPSzl/SpNIuqTUddseI4NilDMoOQo6x4v0biodjJA41XaA/DyF48KARLr3V6zBbBrjY3in0bLQ== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:HE1PR0801MB1882; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1882; 25:eqlU8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ILombF+NwZ8GlY96X4sP2sFZoReVrhiBxHVDIWWmZYRSGkFtBD52jecVbAMWLG/61VwGpiA3mTR3gXsCOhWzRSQIatPe5HeZpa49itDitkngth8jG9lUWhRnfc52YWBL0qgbZ/Mco5Nle6R+8dI87IiW6m9EA5DE; 20:PBkb3cUeaE8LIBbdw4qhkKiUxPkGTQarY2CHBR+CIXbLrYeKhqdWKqA9wabOAjmKA9HTChj/l2qsw4SZTtodsk/BMvf8+pWLUi4iwXkqNATiWAF7hq6nIQUGmA6Z+2Il4GHLyPgsMI4L/gz8wxh5TZMOqTYc9ESLXfAyGtXgpMg2CdZhbtiiBNT6mXdrh+6AFMkU85PdshhmRF4ob6oEFuVf6vpk1jvlvX91oTJScpEhl20YjQs9VHpCdssm4FV1 NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415321)(6040176)(601004)(2401047)(8121501046)(13020025)(13024025)(13013025)(13023025)(5005006)(3002001)(10201501046)(6055026); SRVR:HE1PR0801MB1882; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1882; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1882; 4:opEPkmJoJImNHzz9ZKwYPaRh8BdRqDXmTvBmS3+aPaEPGig4BSyFUGI19M+p0+r4ECEjP42iqk7u7viMtF4Y0ldRTxFvg0ZirfUKAdoScXfBfKP+gKffZFkpCS9pr3iGEZJAJIMnH23eJrAJEljvJed9cFaI1WbimuBf9w9qCwOq1y11rBz8oN6pO4dr9pSddjv+w0b12f8rNY+nDTkcv3VscG+HgS2dbnGflppWBwrE6VE8XHc/P38074fuqlcwCUXlfVqyEueQfWpV5dowLjo3E04EVJN1gDgTZzYt+OmQfN/7LxK/39zw3KMkxt/hsYVtBcobqCtFFDeCDihhYxj+E9lJ+xBRSq4cjm5vAP+B4kjX4YBFwfwsMm8F3gK0ubAmpfJAooySoRoJONDDPNt8uI7/3Oipp3th5p6/LkYIVYvSXSvoyTX0JR5BDvIv2AkNsCMW1YF2xInmUGGnVCkTa+RtyJYR8bbjWB4gMYakq7Pzp/kBD1luNyOFK2kCq+4BjtMRcNHp9+kGJTg0liuZig8R0TmpQ6MylmhnIgo= X-Forefront-PRVS: 008184426E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1882; 23:P5GWn1pPt4Wl3XPSeqGNb91mfueRIVutmmLZjai?= =?us-ascii?Q?TpcCmv0FyI1XV43pUi4ztZAOma5vgqXTAnHDZuxRvS4T0TN87q+RSnhqoeuE?= =?us-ascii?Q?opFl5fBQXvknnFoJt72xE2l9Q30PIeQx2yqLI9Me2lLqjQB0COFlScvHEPac?= =?us-ascii?Q?7EhWHKvmWsvVSCDgiWtlylZqRqreXy60/5pjLKBBKRKYJ20hmktft+tGQ0N3?= =?us-ascii?Q?4nsiRDOo4Kmi/0QdOaoYq9DgUUkOr0WQ1Y/YwOllhncVymeSelkSp02FhD0t?= =?us-ascii?Q?0XfJLDBImE7L2KoreJLKcfTFafPEr1Cm3IYBWBwAz8oP2SyTYtYMiOUCYDdw?= =?us-ascii?Q?BpeJ9O5QwADLt66Ub4L8HRZ90URjvL+xYlTBdfcijEjYgOrMqwqsAt2d/h2q?= =?us-ascii?Q?HoJ7HUrsc5J6M4Fs4tXttP09bHpUuquTO5iU4AjFPHMmQoTq1fqPSORTDiQS?= =?us-ascii?Q?I+KpdsJps+4va9fQewq8SxwuOwCgxMAmJbqXuiSKPMrzwfw5yn++LjmM+Ry2?= =?us-ascii?Q?QkfPdRDX4o3ouxS3qwTL5xJAhh2NdQ/yDMRD4fSaPxv42lKtMrK/pNms3Wab?= =?us-ascii?Q?phm/HPROEJfHcnuQraVVC9I8m6JM0/oG73st6dXLYEyj+hW4c5O68U43jSAY?= =?us-ascii?Q?nbWS+QGOwtnJUjX/LFNYRDENrflVmJhohglU5HWhbq6qUegTyrZ3xU6Kn8Lr?= =?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qljPfOuprprNibCSzwZRmCe2hKEmCkb0MNj5aZujhLGNwEHJ5X/EUnBBujKKRGssLauqWsVIfuEBNg==; 24:sXK0W5Uo50/5fIxclr6e4joHeBHBqeVgbO5nQA3+YEyJeRahttFLJj7Q+8U4MvuenrrA+fDIoFsHCFKvQOo62WGXM0GKLgd3q99Sbl/0XC0=; 7:Ur/4/LGZ1ol900xKrsdfqWXXiH1HKr0O9SX/LsB1FXepdb4jYbwVnCk7zGCOMO9jDFn6nfx0k9dA6iomc0u7hutk7uaq9e8SnAp43QHMPSB8KY4vxkbVipt9Qzso3k3x2Q7K30DQxlFmF2OWq1JCx5OoUEAV3O84Y5+ARsEtSZhm77jJg1zzm7wBRyx6FSJAJYvh/43SXgdUGdbH1SgX/y8COsFiHCvj8AA6Z524Vw1XBphwK94W/KjrStpvnW9pksQrDfbkkBWOSR6dSML8Lc6s3HtUZ2WhPv8t4R0QiNHH8PPgme9Gy0MRhIDlnY8t SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1882; 20:AM27VwMzdiT/iVSVsk0G9zGaZV1T2GlgKriRLnbFBL5MnHpyjyY7BtsK8YqqaVc2eepGicF3AWu4Bs6uyXqDTTri7vxQcTue0Y5TlgRNYMInbcL0Dd7cXPfvOUgVw8cJ/0RwJe1q/HcgfviuQtGOtAFIFX1xR5UNmLxLcbutC2U= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 17:02:45.6857 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1882 X-MC-Unique: c0ghq3P8NPmxfo6ie0MPSQ-1 X-IsSubscribed: yes Hi, This patch merges in the support added to glibc for HFmode conversions in this patch: commit 87ab10d6524fe4faabd7eb3eac5868165ecfb323 Author: James Greenhalgh Date: Wed Sep 21 21:02:54 2016 +0000 [soft-fp] Add support for various half-precision conversion routines. This patch adds conversion routines required for _Float16 support in AArch64. These are one-step conversions to and from TImode and TFmode. We need these on AArch64 regardless of presence of the ARMv8.2-A 16-bit floating-point extensions. In the patch, soft-fp/half.h is derived from soft-fp/single.h . The conversion routines are derivatives of their respective SFmode variants. * soft-fp/extendhftf2.c: New. * soft-fp/fixhfti.c: Likewise. * soft-fp/fixunshfti.c: Likewise. * soft-fp/floattihf.c: Likewise. * soft-fp/floatuntihf.c: Likewise. * soft-fp/half.h: Likewise. * soft-fp/trunctfhf2.c: Likewise. Any patch merging from upstream is preapproved acording to our commit policies, but I'll hold off on committing it until the others in this series have been approved. Thanks, James --- libgcc/ 2016-09-30 James Greenhalgh * soft-fp/extendhftf2.c: New. * soft-fp/fixhfti.c: Likewise. * soft-fp/fixunshfti.c: Likewise. * soft-fp/floattihf.c: Likewise. * soft-fp/floatuntihf.c: Likewise. * soft-fp/half.h: Likewise. * soft-fp/trunctfhf2.c: Likewise. diff --git a/libgcc/soft-fp/extendhftf2.c b/libgcc/soft-fp/extendhftf2.c new file mode 100644 index 0000000..6ff6438 --- /dev/null +++ b/libgcc/soft-fp/extendhftf2.c @@ -0,0 +1,53 @@ +/* Software floating-point emulation. + Return an IEEE half converted to IEEE quad + Copyright (C) 1997-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define FP_NO_EXACT_UNDERFLOW +#include "soft-fp.h" +#include "half.h" +#include "quad.h" + +TFtype +__extendhftf2 (HFtype a) +{ + FP_DECL_EX; + FP_DECL_H (A); + FP_DECL_Q (R); + TFtype r; + + FP_INIT_EXCEPTIONS; + FP_UNPACK_RAW_H (A, a); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_EXTEND (Q, H, 4, 1, R, A); +#else + FP_EXTEND (Q, H, 2, 1, R, A); +#endif + FP_PACK_RAW_Q (r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/libgcc/soft-fp/fixhfti.c b/libgcc/soft-fp/fixhfti.c new file mode 100644 index 0000000..3610f4c --- /dev/null +++ b/libgcc/soft-fp/fixhfti.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Convert IEEE half to 128bit signed integer + Copyright (C) 2007-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "soft-fp.h" +#include "half.h" + +TItype +__fixhfti (HFtype a) +{ + FP_DECL_EX; + FP_DECL_H (A); + UTItype r; + + FP_INIT_EXCEPTIONS; + FP_UNPACK_RAW_H (A, a); + FP_TO_INT_H (r, A, TI_BITS, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/libgcc/soft-fp/fixunshfti.c b/libgcc/soft-fp/fixunshfti.c new file mode 100644 index 0000000..30edbfe --- /dev/null +++ b/libgcc/soft-fp/fixunshfti.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Convert IEEE half to 128bit unsigned integer + Copyright (C) 2007-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "soft-fp.h" +#include "half.h" + +UTItype +__fixunshfti (HFtype a) +{ + FP_DECL_EX; + FP_DECL_H (A); + UTItype r; + + FP_INIT_EXCEPTIONS; + FP_UNPACK_RAW_H (A, a); + FP_TO_INT_H (r, A, TI_BITS, 0); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/libgcc/soft-fp/floattihf.c b/libgcc/soft-fp/floattihf.c new file mode 100644 index 0000000..74ac83a --- /dev/null +++ b/libgcc/soft-fp/floattihf.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Convert a 128bit signed integer to IEEE half + Copyright (C) 2007-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "soft-fp.h" +#include "half.h" + +HFtype +__floattihf (TItype i) +{ + FP_DECL_EX; + FP_DECL_H (A); + HFtype a; + + FP_INIT_ROUNDMODE; + FP_FROM_INT_H (A, i, TI_BITS, UTItype); + FP_PACK_RAW_H (a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/libgcc/soft-fp/floatuntihf.c b/libgcc/soft-fp/floatuntihf.c new file mode 100644 index 0000000..90e77c2 --- /dev/null +++ b/libgcc/soft-fp/floatuntihf.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Convert a 128bit unsigned integer to IEEE half. + Copyright (C) 2007-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "soft-fp.h" +#include "half.h" + +HFtype +__floatuntihf (UTItype i) +{ + FP_DECL_EX; + FP_DECL_H (A); + HFtype a; + + FP_INIT_ROUNDMODE; + FP_FROM_INT_H (A, i, TI_BITS, UTItype); + FP_PACK_RAW_H (a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/libgcc/soft-fp/half.h b/libgcc/soft-fp/half.h new file mode 100644 index 0000000..ba75297 --- /dev/null +++ b/libgcc/soft-fp/half.h @@ -0,0 +1,170 @@ +/* Software floating-point emulation. + Definitions for IEEE Half Precision. + Copyright (C) 1997-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef SOFT_FP_HALF_H +#define SOFT_FP_HALF_H 1 + +#if _FP_W_TYPE_SIZE < 32 +# error "Here's a nickel kid. Go buy yourself a real computer." +#endif + +#define _FP_FRACTBITS_H (_FP_W_TYPE_SIZE) + +#define _FP_FRACTBITS_DW_H (_FP_W_TYPE_SIZE) + +#define _FP_FRACBITS_H 11 +#define _FP_FRACXBITS_H (_FP_FRACTBITS_H - _FP_FRACBITS_H) +#define _FP_WFRACBITS_H (_FP_WORKBITS + _FP_FRACBITS_H) +#define _FP_WFRACXBITS_H (_FP_FRACTBITS_H - _FP_WFRACBITS_H) +#define _FP_EXPBITS_H 5 +#define _FP_EXPBIAS_H 15 +#define _FP_EXPMAX_H 31 + +#define _FP_QNANBIT_H ((_FP_W_TYPE) 1 << (_FP_FRACBITS_H-2)) +#define _FP_QNANBIT_SH_H ((_FP_W_TYPE) 1 << (_FP_FRACBITS_H-2+_FP_WORKBITS)) +#define _FP_IMPLBIT_H ((_FP_W_TYPE) 1 << (_FP_FRACBITS_H-1)) +#define _FP_IMPLBIT_SH_H ((_FP_W_TYPE) 1 << (_FP_FRACBITS_H-1+_FP_WORKBITS)) +#define _FP_OVERFLOW_H ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_H)) + +#define _FP_WFRACBITS_DW_H (2 * _FP_WFRACBITS_H) +#define _FP_WFRACXBITS_DW_H (_FP_FRACTBITS_DW_H - _FP_WFRACBITS_DW_H) +#define _FP_HIGHBIT_DW_H \ + ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_H - 1) % _FP_W_TYPE_SIZE) + +/* The implementation of _FP_MUL_MEAT_H and _FP_DIV_MEAT_H should be + chosen by the target machine. */ + +typedef float HFtype __attribute__ ((mode (HF))); + +union _FP_UNION_H +{ + HFtype flt; + struct _FP_STRUCT_LAYOUT + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_H; + unsigned frac : _FP_FRACBITS_H - (_FP_IMPLBIT_H != 0); +#else + unsigned frac : _FP_FRACBITS_H - (_FP_IMPLBIT_H != 0); + unsigned exp : _FP_EXPBITS_H; + unsigned sign : 1; +#endif + } bits __attribute__ ((packed)); +}; + +#define FP_DECL_H(X) _FP_DECL (1, X) +#define FP_UNPACK_RAW_H(X, val) _FP_UNPACK_RAW_1 (H, X, (val)) +#define FP_UNPACK_RAW_HP(X, val) _FP_UNPACK_RAW_1_P (H, X, (val)) +#define FP_PACK_RAW_H(val, X) _FP_PACK_RAW_1 (H, (val), X) +#define FP_PACK_RAW_HP(val, X) \ + do \ + { \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P (H, (val), X); \ + } \ + while (0) + +#define FP_UNPACK_H(X, val) \ + do \ + { \ + _FP_UNPACK_RAW_1 (H, X, (val)); \ + _FP_UNPACK_CANONICAL (H, 1, X); \ + } \ + while (0) + +#define FP_UNPACK_HP(X, val) \ + do \ + { \ + _FP_UNPACK_RAW_1_P (H, X, (val)); \ + _FP_UNPACK_CANONICAL (H, 1, X); \ + } \ + while (0) + +#define FP_UNPACK_SEMIRAW_H(X, val) \ + do \ + { \ + _FP_UNPACK_RAW_1 (H, X, (val)); \ + _FP_UNPACK_SEMIRAW (H, 1, X); \ + } \ + while (0) + +#define FP_UNPACK_SEMIRAW_HP(X, val) \ + do \ + { \ + _FP_UNPACK_RAW_1_P (H, X, (val)); \ + _FP_UNPACK_SEMIRAW (H, 1, X); \ + } \ + while (0) + +#define FP_PACK_H(val, X) \ + do \ + { \ + _FP_PACK_CANONICAL (H, 1, X); \ + _FP_PACK_RAW_1 (H, (val), X); \ + } \ + while (0) + +#define FP_PACK_HP(val, X) \ + do \ + { \ + _FP_PACK_CANONICAL (H, 1, X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P (H, (val), X); \ + } \ + while (0) + +#define FP_PACK_SEMIRAW_H(val, X) \ + do \ + { \ + _FP_PACK_SEMIRAW (H, 1, X); \ + _FP_PACK_RAW_1 (H, (val), X); \ + } \ + while (0) + +#define FP_PACK_SEMIRAW_HP(val, X) \ + do \ + { \ + _FP_PACK_SEMIRAW (H, 1, X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P (H, (val), X); \ + } \ + while (0) + +#define FP_TO_INT_H(r, X, rsz, rsg) _FP_TO_INT (H, 1, (r), X, (rsz), (rsg)) +#define FP_TO_INT_ROUND_H(r, X, rsz, rsg) \ + _FP_TO_INT_ROUND (H, 1, (r), X, (rsz), (rsg)) +#define FP_FROM_INT_H(X, r, rs, rt) _FP_FROM_INT (H, 1, X, (r), (rs), rt) + +/* HFmode arithmetic is not implemented. */ + +#define _FP_FRAC_HIGH_H(X) _FP_FRAC_HIGH_1 (X) +#define _FP_FRAC_HIGH_RAW_H(X) _FP_FRAC_HIGH_1 (X) +#define _FP_FRAC_HIGH_DW_H(X) _FP_FRAC_HIGH_1 (X) + +#endif /* !SOFT_FP_HALF_H */ diff --git a/libgcc/soft-fp/trunctfhf2.c b/libgcc/soft-fp/trunctfhf2.c new file mode 100644 index 0000000..0500b14 --- /dev/null +++ b/libgcc/soft-fp/trunctfhf2.c @@ -0,0 +1,52 @@ +/* Software floating-point emulation. + Truncate IEEE quad into IEEE half. + Copyright (C) 1997-2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "soft-fp.h" +#include "half.h" +#include "quad.h" + +HFtype +__trunctfhf2 (TFtype a) +{ + FP_DECL_EX; + FP_DECL_Q (A); + FP_DECL_H (R); + HFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_Q (A, a); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_TRUNC (H, Q, 1, 4, R, A); +#else + FP_TRUNC (H, Q, 1, 2, R, A); +#endif + FP_PACK_SEMIRAW_H (r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +}