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 A90393858D28 for ; Mon, 19 Sep 2022 13:37:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A90393858D28 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=1663594621; 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=m6ZDwD32EzAV8u//rcTrcCJ6zz/snsgX2xWGH3/F8UI=; b=QeEQv74zsIYPJ7cV15lW+9xxEKOUw3ik0HVaKFcDXgMzduF0SsNYGj7EicJNSf+bGkQ7dW 8OrDxuI4iSe6El8iWqWepvifo8ETam6k8N1Ak+hMmd7k0xSSOV+RCYTw5hZsdZDMFkSMwa Q1ZA/vdJy5aIg86lwPVMRvHktq0QTMk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-beFHpNgaNDusJFf6NzcnZA-1; Mon, 19 Sep 2022 09:36:58 -0400 X-MC-Unique: beFHpNgaNDusJFf6NzcnZA-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 0E26E100F7F2; Mon, 19 Sep 2022 13:36:58 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF5CE140EBF3; Mon, 19 Sep 2022 13:36:57 +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 28JDatDq651017 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 19 Sep 2022 15:36:55 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28JDasqD651016; Mon, 19 Sep 2022 15:36:54 +0200 Date: Mon, 19 Sep 2022 15:36:54 +0200 From: Jakub Jelinek To: pengsheng.chen@gmail.com Cc: gcc@gcc.gnu.org Subject: Re: When does GCC need to use the functions decode_ieee_single()/decode_ieee_double() ? 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.0 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 Mon, Sep 19, 2022 at 09:22:55PM +0800, pengsheng.chen--- via Gcc wrote: > The functions encode_ieee_single()/encode_ieee_double() encode the GCC > internal representation (i.e., REAL_VALUE_TYPE) to the corresponding IEEE > single precision/double precision formats. The constant values in a program > (i.e., float a = 3.14;) will be parsed and then transferred to GCC > REAL_VALUE_TYPE. Later, the REAL_VALUE_TYPE is encoded to IEEE > single/double formats. However, I do not know why we need > decode_ieee_single()/decode_ieee_double()? Which situations or C code > fragments are these decode_ieee_xxx functions used in? Anywhere where real_from_target is called. That is usually when you say have a union of one of the floating point types and corresponding integral type, you store the integer into the union and read back the floating point, so e.g. when folding in the IL VIEW_CONVERT_EXPR (some_int_value) etc. Or e.g. when folding RTL NOT of a constant, that inverts all the bits, so you need real_to_target, invert the bits and real_from_target back. Jakub