From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id 81BF23858C52 for ; Thu, 22 Sep 2022 03:04:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 81BF23858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1032.google.com with SMTP id i15-20020a17090a4b8f00b0020073b4ac27so755887pjh.3 for ; Wed, 21 Sep 2022 20:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Yo7aVtP9W19sH0D4p/x9uaZjwgmsPh0sfhlnTEgb41A=; b=YF7Q4fwY9jS+Cd2i1KC4/O91q8wY8mII4giiOcqh/0Zv3duh61PftLgUmYsOxfI0XF Qu/wiT7ZeZdU3IfMSPzuLzs4us3EGzxcQlD13sO2q4ijzDC4+hJa7pJxUqCkJuikDRqu vSkeGSp0YKvtRZW7x5prkJwuS2UJnZC3lIz1vdtitF7hUj2jxOHMAtI08wYEGqjFq/Hw VfUqHMx/b8dSFkv5BNcX1VimEwvbjDS9N45dArtaZIv2IibKmMWyZC/Q4njbwoPn9nF5 znmC9pd3I7VKnHpnZ7p/zltqNcdjdgY9I1WzYrw5pY+d8+DvDEsYbVBqPZFv9Mt2tZ8I qr0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Yo7aVtP9W19sH0D4p/x9uaZjwgmsPh0sfhlnTEgb41A=; b=7kJNlJeZUHnDgwoxdf2GygILEn24D76cK/ZNFQmjSYfDUU9Xp0wMR03lsN2leAZsV3 2FHrfb9onkD9Bm/gpMuZIsTjNW3DSj/TjqFW2voVJ2qFwbsTrfcf4GYTEl6HnsCm6yG/ a0VPrP9YqdiSjiiJwiO1RJV+IuAAhFRgwJnBy2bBp+E0R0UiF3AIwAfktiAXe+kFY4oO 8560IXuLeAWB2eywYGXD+sIVL/OvHTBwl68V2Rx33LkO4XbHbHrLGMBNMyqi8hYZ3SCk eXkkggG9OHqP/FOPn++G7N5BL8g5S1b8WNRMjxz/4+KDGhodk4AH2InHFAjLnuBafnli UDjQ== X-Gm-Message-State: ACrzQf2EpRrZwNfEtPiEXrDKnPoOn7mFy3ng/HftTSuqNu/Wio/ynflt VDS1mKivvO906heeppkw1kRcHmmYs36fXt23Ftw= X-Google-Smtp-Source: AMsMyM5sqHZXXNV7thB62fdjtBfnAeIwKSGSL53YGl7frw4hRKXx9oWJXEmmzC8SGqtG1MwxhNNTXIfIwl+Gnpqp9lE= X-Received: by 2002:a17:902:cccc:b0:178:a9b3:43e6 with SMTP id z12-20020a170902cccc00b00178a9b343e6mr1319403ple.92.1663815890436; Wed, 21 Sep 2022 20:04:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: pengsheng.chen@gmail.com Date: Thu, 22 Sep 2022 11:04:37 +0800 Message-ID: Subject: Re: When does GCC need to use the functions decode_ieee_single()/decode_ieee_double() ? To: Jakub Jelinek Cc: gcc@gcc.gnu.org Content-Type: multipart/alternative; boundary="0000000000001f086805e93b5350" X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: --0000000000001f086805e93b5350 Content-Type: text/plain; charset="UTF-8" Dear Jakub, Thank you for your reply promptly. I have tried many test cases, but I still cannot trigger the functions: decode_ieee_xxx(). Can you give me some cases for studying? Thank you. Peng-Sheng On Mon, Sep 19, 2022 at 9:36 PM Jakub Jelinek wrote: > 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 > > --0000000000001f086805e93b5350--