From patchwork Tue Oct 31 16:02:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 832613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-86608-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="R5stfyKX"; 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 3yRGNB31tYz9sQl for ; Wed, 1 Nov 2017 03:03:06 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=coFtSU7BGnq8ZLdqFCN9df7ONKu81 NZJfKO7UTFj43YikqC9mKDkwFVnAZkWCrWFzyuzS+0s8sBhye1IQr0qri+cWGF+C pm9xFIgdyUiAF00gLYOXlPI0nXojF7mFeB5p+347BRv+3RfnxhpU8lKVgb1N1nzh A70rU8Gn4e/Xfs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=WL7JFuMyGEaY31JL3z3CHRDmFDM=; b=R5s tfyKXCmL2jyn0daPBBuKma0VxTriu5sofzqyIMwM85NxAf8VE/GRZRUv7e46FRX0 X1PZETS55u6dHRHFBA68+2d706Sz+RfH2pM0GQYaN+zqkktPaghBatSFwx6dz3kZ gflpuAUcUb6rafPOwmpD+XO14fJ5H5ed32D1RjKI= Received: (qmail 74466 invoked by alias); 31 Oct 2017 16:03:00 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 74446 invoked by uid 89); 31 Oct 2017 16:02:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 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, URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:1374 X-HELO: relay1.mentorg.com Date: Tue, 31 Oct 2017 16:02:46 +0000 From: Joseph Myers To: Subject: Adjust __MATH_EVAL_FMT2 definition to handle _Float16 better [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) Continuing the preparation for additional _FloatN / _FloatNx type support, this patch adds an additional case in the definition of __MATH_EVAL_FMT2, as used in defining iseqsig: when __FLT_EVAL_METHOD__ is 0 or 32, it adds 0.0f to the arguments, so that the correct function would be selected in the case of _Float16 arguments with excess precision (were glibc to support _Float16, which of course __MATH_TG and other facilities do not at present - and _Float16 support is not part of what this patch series is aiming for, but this particular fix is simple so is included anyway). Tested for x86_64. Committed. 2017-10-31 Joseph Myers * math/math.h [__FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 32] (__MATH_EVAL_FMT2): Define to add 0.0f. diff --git a/math/math.h b/math/math.h index 125d845..326fd8e 100644 --- a/math/math.h +++ b/math/math.h @@ -1144,6 +1144,8 @@ iszero (__T __val) # define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0L) # elif __FLT_EVAL_METHOD__ == 1 || __FLT_EVAL_METHOD__ > 32 # define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0) +# elif __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 32 +# define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0f) # else # define __MATH_EVAL_FMT2(x, y) ((x) + (y)) # endif