From patchwork Mon Aug 2 06:31:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liuhongt X-Patchwork-Id: 1512278 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=nlq0BtEe; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GdSvB526bz9sRK for ; Mon, 2 Aug 2021 16:36:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 08F38383581A for ; Mon, 2 Aug 2021 06:36:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08F38383581A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1627886164; bh=yP2bYh9Dz25pMkooyId0pQpGk0ZppiaZy4FA1exf5Iw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=nlq0BtEe5pxRRst2E+4ktZuayvVyGCgHHTdXseWglUUc1NOoZYOEv6THE5E/PwOv/ Vgnm/SfzQhkVbL4SkPqs5X5OD68ftDagwULbPGyfi3k8NR7mrtu3yJuiX1BkjiWWEK z6tWUfvCCYmSozjbzNbfcsB+AJUmfs36xKJHsjhk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by sourceware.org (Postfix) with ESMTPS id 90BD43836028 for ; Mon, 2 Aug 2021 06:31:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 90BD43836028 X-IronPort-AV: E=McAfee;i="6200,9189,10063"; a="235322746" X-IronPort-AV: E=Sophos;i="5.84,288,1620716400"; d="scan'208";a="235322746" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2021 23:31:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,288,1620716400"; d="scan'208";a="466188169" Received: from scymds01.sc.intel.com ([10.148.94.138]) by orsmga008.jf.intel.com with ESMTP; 01 Aug 2021 23:31:24 -0700 Received: from shliclel219.sh.intel.com (shliclel219.sh.intel.com [10.239.236.219]) by scymds01.sc.intel.com with ESMTP id 1726VH1O022130; Sun, 1 Aug 2021 23:31:23 -0700 To: gcc-patches@gcc.gnu.org Subject: [PATCH 3/6] [i386] libgcc: Enable hfmode soft-sf/df/xf/tf extensions and truncations. Date: Mon, 2 Aug 2021 14:31:13 +0800 Message-Id: <20210802063116.999830-4-hongtao.liu@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210802063116.999830-1-hongtao.liu@intel.com> References: <20210802063116.999830-1-hongtao.liu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: liuhongt via Gcc-patches From: liuhongt Reply-To: liuhongt Cc: joseph@codesourcery.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" libgcc/ChangeLog: * config/i386/32/sfp-machine.h (_FP_NANFRAC_H): New macro. * config/i386/64/sfp-machine.h (_FP_NANFRAC_H): Ditto. * config/i386/sfp-machine.h (_FP_NANSIGN_H): Ditto. * config/i386/t-softfp: Add hf soft-fp. * config.host: Add i386/64/t-softfp. * config/i386/64/t-softfp: New file. --- libgcc/config.host | 5 +---- libgcc/config/i386/32/sfp-machine.h | 1 + libgcc/config/i386/32/t-softfp | 1 + libgcc/config/i386/64/sfp-machine.h | 1 + libgcc/config/i386/64/t-softfp | 1 + libgcc/config/i386/sfp-machine.h | 1 + libgcc/config/i386/t-softfp | 5 +++++ 7 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 libgcc/config/i386/64/t-softfp diff --git a/libgcc/config.host b/libgcc/config.host index 50f00062232..96da9ef1cce 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1540,10 +1540,7 @@ i[34567]86-*-elfiamcu | i[34567]86-*-rtems*) ;; i[34567]86-*-* | x86_64-*-*) tmake_file="${tmake_file} t-softfp-tf" - if test "${host_address}" = 32; then - tmake_file="${tmake_file} i386/${host_address}/t-softfp" - fi - tmake_file="${tmake_file} i386/t-softfp t-softfp" + tmake_file="${tmake_file} i386/${host_address}/t-softfp i386/t-softfp t-softfp" ;; esac diff --git a/libgcc/config/i386/32/sfp-machine.h b/libgcc/config/i386/32/sfp-machine.h index 1fa282d7afe..e24cbc8d180 100644 --- a/libgcc/config/i386/32/sfp-machine.h +++ b/libgcc/config/i386/32/sfp-machine.h @@ -86,6 +86,7 @@ #define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y) #define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y) +#define _FP_NANFRAC_H _FP_QNANBIT_H #define _FP_NANFRAC_S _FP_QNANBIT_S #define _FP_NANFRAC_D _FP_QNANBIT_D, 0 /* Even if XFmode is 12byte, we have to pad it to diff --git a/libgcc/config/i386/32/t-softfp b/libgcc/config/i386/32/t-softfp index a48a5b3b116..86478cf5f20 100644 --- a/libgcc/config/i386/32/t-softfp +++ b/libgcc/config/i386/32/t-softfp @@ -3,3 +3,4 @@ softfp_int_modes := si di # Provide fallbacks for __builtin_copysignq and __builtin_fabsq. LIB2ADD += $(srcdir)/config/i386/32/tf-signs.c + diff --git a/libgcc/config/i386/64/sfp-machine.h b/libgcc/config/i386/64/sfp-machine.h index 1ff94c23ea4..e1c616699bb 100644 --- a/libgcc/config/i386/64/sfp-machine.h +++ b/libgcc/config/i386/64/sfp-machine.h @@ -13,6 +13,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); #define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y) +#define _FP_NANFRAC_H _FP_QNANBIT_H #define _FP_NANFRAC_S _FP_QNANBIT_S #define _FP_NANFRAC_D _FP_QNANBIT_D #define _FP_NANFRAC_E _FP_QNANBIT_E, 0 diff --git a/libgcc/config/i386/64/t-softfp b/libgcc/config/i386/64/t-softfp new file mode 100644 index 00000000000..f9d8b3a945c --- /dev/null +++ b/libgcc/config/i386/64/t-softfp @@ -0,0 +1 @@ +softfp_extras := fixhfti fixunshfti floattihf floatuntihf diff --git a/libgcc/config/i386/sfp-machine.h b/libgcc/config/i386/sfp-machine.h index 8319f0550bc..f15d29d3755 100644 --- a/libgcc/config/i386/sfp-machine.h +++ b/libgcc/config/i386/sfp-machine.h @@ -17,6 +17,7 @@ typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); #define _FP_KEEPNANFRACP 1 #define _FP_QNANNEGATEDP 0 +#define _FP_NANSIGN_H 1 #define _FP_NANSIGN_S 1 #define _FP_NANSIGN_D 1 #define _FP_NANSIGN_E 1 diff --git a/libgcc/config/i386/t-softfp b/libgcc/config/i386/t-softfp index 685d9cf8502..4ac214eb0ce 100644 --- a/libgcc/config/i386/t-softfp +++ b/libgcc/config/i386/t-softfp @@ -1 +1,6 @@ LIB2ADD += $(srcdir)/config/i386/sfp-exceptions.c + +softfp_extensions := hfsf hfdf hftf hfxf sfdf sftf dftf xftf +softfp_truncations := tfhf xfhf dfhf sfhf tfsf dfsf tfdf tfxf + +softfp_extras += eqhf2 \ No newline at end of file