From patchwork Sun Jun 9 19:18:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 250086 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 7347D2C02B2 for ; Mon, 10 Jun 2013 05:18:54 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=xSxV5mu+Wy2s6sh0I4ULmdzavBnUobgYTi3B6Na/RR5xju8d0MLTM ZR7fi56JKF0RLGlmLfxSMlbRYjVDxtdA6K9IMxgftUShkYIBlpAeCKiQbOUKH4b+ tipmDwKyItVv8plheRmLWhU6l57LgjstCTVNCYHPeIrHpbaNM2gsBE= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=PzLtbxa7FCeQJ1BA7joo9Oa7n6c=; b=Ot+wfwarpKBdD7ffvYel 4Pv3r4WT3VHBVXj63+wsAfBxkYJn7wihpAf6tP8vf4RkuyXa/WYwKBa0q+nGcrWQ 1x8ikOXz1BZGotMrnASxIz2gVXHFde0fYHcrDZj/SyQoncZEH34y/GxYTnJkrrj9 ACcn+E5pVWnxHB6Hh8TiYBo= Received: (qmail 8348 invoked by alias); 9 Jun 2013 19:18:48 -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 8336 invoked by uid 89); 9 Jun 2013 19:18:48 -0000 X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mail2-relais-roc.national.inria.fr (HELO mail2-relais-roc.national.inria.fr) (192.134.164.83) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 09 Jun 2013 19:18:47 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 09 Jun 2013 21:18:44 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1Ull8W-000619-Fm for gcc-patches@gcc.gnu.org; Sun, 09 Jun 2013 21:18:44 +0200 Date: Sun, 9 Jun 2013 21:18:44 +0200 (CEST) From: Marc Glisse To: gcc-patches@gcc.gnu.org Subject: Document __builtin_isinf_sign more precisely Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-Virus-Found: No Hello, this patch documents that __builtin_isinf_sign returns +-1 for +-Inf. This builtin was created so it could be used by a libc that has a stronger guarantee than the standard, and for glibc that means returning +-1, which is what the code already does. 2013-06-10 Marc Glisse PR middle-end/57219 * doc/extend.texi (__builtin_isinf_sign): Restrict the return values to -1, 0 and 1. Index: doc/extend.texi =================================================================== --- doc/extend.texi (revision 199867) +++ doc/extend.texi (working copy) @@ -8603,22 +8603,23 @@ Similar to @code{__builtin_inf}, except Similar to @code{__builtin_inf}, except the return type is @code{float}. This function is suitable for implementing the ISO C99 macro @code{INFINITY}. @end deftypefn @deftypefn {Built-in Function} {long double} __builtin_infl (void) Similar to @code{__builtin_inf}, except the return type is @code{long double}. @end deftypefn @deftypefn {Built-in Function} int __builtin_isinf_sign (...) -Similar to @code{isinf}, except the return value is negative for -an argument of @code{-Inf}. Note while the parameter list is an +Similar to @code{isinf}, except the return value is -1 for +an argument of @code{-Inf} and 1 for an argument of @code{+Inf}. +Note while the parameter list is an ellipsis, this function only accepts exactly one floating-point argument. GCC treats this parameter as type-generic, which means it does not do default promotion from float to double. @end deftypefn @deftypefn {Built-in Function} double __builtin_nan (const char *str) This is an implementation of the ISO C99 function @code{nan}. Since ISO C99 defines this function in terms of @code{strtod}, which we do not implement, a description of the parsing is in order. The string