From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5CF4D38582B2 for ; Thu, 22 Sep 2022 15:22:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5CF4D38582B2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663860135; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=LtDk9A625v6OAT85Vtn8cV85J+mBYqKYIU4IAaL1tac=; b=f0myilOVFVH9IiXettUsT2fXJ5w9VerPzmzoZy9oVzB1WM2aekvcIxNRguLdnnUlehl0JR yANRqtUdI3FSnkAxVhBKWOh4vCUb3XJPTBUVkjf/4oDhNXZhzgWjDv8k9dk4RC/SgESdYV /zdi0/yF5PmRZuBP1A5tOMPTmTEZgNE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-606-AI1igmapMlSwk-uQLpbKAg-1; Thu, 22 Sep 2022 11:22:13 -0400 X-MC-Unique: AI1igmapMlSwk-uQLpbKAg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 04D44293248B; Thu, 22 Sep 2022 15:22:09 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3DD4140EBF4; Thu, 22 Sep 2022 15:22:08 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 28MFM63K2554699 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 22 Sep 2022 17:22:06 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28MFM53D2554698; Thu, 22 Sep 2022 17:22:05 +0200 Date: Thu, 22 Sep 2022 17:22:04 +0200 From: Jakub Jelinek To: Aldy Hernandez Cc: Richard Biener , gcc-patches , "MacLeod, Andrew" Subject: Re: TYPE_{MIN/MAX}_VALUE for floats? Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Sep 22, 2022 at 05:02:19PM +0200, Aldy Hernandez wrote: > It has always irritated me that we don't have TYPE_MIN_VALUE and > TYPE_MAX_VALUE for floats (and for pointers for that matter). This > means, we have to recalculate it ad-nauseum in vrp_val_min and > vrp_val_max. > > I know we have dconstinf and dconstninf for floats, which we can just > wrap around a TREE_REAL_CST, but it still seems like we should be more > consistent here. If we know the endpoint for a type, we should cache > it in it. This looks problematic. While for !MODE_HAS_INFINITIES there are clear values, otherwise the flag_finite_math_only flag has Optimization keyword, so it can change between different functions, while a type is a global entity that can be used by both __attribute__((optimize ("Ofast"))) and standard floating point functions. In some sense it is similar to TYPE_MODE which for vectors needs to be actually a function call that decides based on the current function. But then, having it in TYPE_*_VALUE doesn't have the benefits you want from it... Jakub