From patchwork Fri Nov 1 20:35:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Wilson X-Patchwork-Id: 1188181 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512236-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="E3u993R2"; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.b="a5AFTrEz"; dkim-atps=neutral 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 474Yqp2m0Xz9sNx for ; Sat, 2 Nov 2019 07:36:04 +1100 (AEDT) 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; q=dns; s=default; b=tSH2ve6h5OfF lYnhW0u1dPoA3/B0NcBNnKY0jCCHMEvhpU18lqOLQmuXpTljMqkox/GYXBF8xawK YWxYh2iztHSW9hYJs6P1zSlV+Q/bPZ8UqfkV/4OLlMFpDjgwA7YkKKI3cAerTORK 2slQre39iw7Z7wIZI8egKhe3HQArNcU= 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; s=default; bh=bj7FnfcnK3YIgTIwRM LgomRsjfw=; b=E3u993R2xTz8tQEItEqgm/G2jqWdZe5cbFdOE1QvpM4GkZloam J2dc5eJofoVF8Cdvt/CtLsKuUIY5G7hytmOagWgKYm6m8pA5masNWwN2fkl3+O0I AWFRA7fflRqd4ZMXuN65WZgDiCCgqM8tKjuQ9l7WUT3SvFvO2YbAinSaU= Received: (qmail 87536 invoked by alias); 1 Nov 2019 20:35:57 -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 87528 invoked by uid 89); 1 Nov 2019 20:35:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=designing, 2420 X-HELO: mail-pl1-f195.google.com Received: from mail-pl1-f195.google.com (HELO mail-pl1-f195.google.com) (209.85.214.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Nov 2019 20:35:56 +0000 Received: by mail-pl1-f195.google.com with SMTP id p13so4852722pll.4 for ; Fri, 01 Nov 2019 13:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=zsPhaIAW/O88jvW4MzR1MJLel4ECzIsn7kUPwunOrnY=; b=a5AFTrEzHdVISAgIMWBFZYTvOVciVnIQo99hXj5tOXuR38RaTtsiZ28lOPq+468C/6 +e9vJCcPZ04YzGlFmD1GwtltV8Jib5ygV1FDPIMvwZRJ4pIcNSwm+z+lg/SlygzP4uJz k6qqY1RmJNpPdiVBP7KmHvjjapLv3ZI+iMV82btQv8svf8p/1zbiI9Bvkw7Hn5TgXiHC UL7JiFinsI85VJ9G8zbDTc+7/HdMiGwoAmB4ZPk+n6pvqaNx7eL6vu8UmQSvXt0Y2lxy T1gFbI8py7ST2xGERgMvybGF05+o6PsdM/deGy4R5a3Rq8kpZRbrQcIYJJZpjIlobS77 R2Rg== Received: from rohan.sifive.com ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id b5sm8115888pfp.149.2019.11.01.13.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 13:35:53 -0700 (PDT) From: Jim Wilson To: gcc-patches@gcc.gnu.org Cc: Jim Wilson Subject: [PATCH] RISC-V: Build soft-float divide routines for -mno-fdiv. Date: Fri, 1 Nov 2019 13:35:49 -0700 Message-Id: <20191101203549.21397-1-jimw@sifive.com> X-IsSubscribed: yes Using -mno-fdiv gives linker errors unless we build the missing divide routines in libgcc always. There is at least one university project designing RISC-V parts without FP divide that wants to use the option. Tested by hand with single-float and double-float builds to verify that the -mno-fdiv option works with the patch. Also tested with rv32-newlib and rv64-linux cross builds and make check, with no regressions. Committed. Jim libgcc/ * config/riscv/t-softfp32 (softfp_extra): Add FP divide routines --- libgcc/config/riscv/t-softfp32 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libgcc/config/riscv/t-softfp32 b/libgcc/config/riscv/t-softfp32 index 1bd51e803d1..59be1df827e 100644 --- a/libgcc/config/riscv/t-softfp32 +++ b/libgcc/config/riscv/t-softfp32 @@ -12,7 +12,11 @@ softfp_float_modes := tf softfp_extensions := sftf dftf softfp_truncations := tfsf tfdf +# Enable divide routines to make -mno-fdiv work. +softfp_extras := divsf3 divdf3 + else +# !ABI_DOUBLE softfp_float_modes := df tf softfp_extensions := sfdf sftf dftf @@ -20,7 +24,20 @@ softfp_truncations := dfsf tfsf tfdf ifndef ABI_SINGLE softfp_float_modes += sf +else +# ABI_SINGLE + +# Enable divide routines to make -mno-fdiv work. +softfp_extras := divsf3 + endif endif + +else +# ABI_QUAD + +# Enable divide routines to make -mno-fdiv work. +softfp_extras := divsf3 divdf3 divtf3 + endif