public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: pengsheng.chen@gmail.com
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: Re: When does GCC need to use the functions decode_ieee_single()/decode_ieee_double() ?
Date: Thu, 22 Sep 2022 11:04:37 +0800	[thread overview]
Message-ID: <CANY1fJQVZZ6W1qQK_mrTzQajxEMxK=dyxa2_i-bUmewc9G3L4w@mail.gmail.com> (raw)
In-Reply-To: <Yyhwdqv1YULmq/Xm@tucnak>

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

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 <jakub@redhat.com> 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 <float> (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
>
>

      reply	other threads:[~2022-09-22  3:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 13:22 pengsheng.chen
2022-09-19 13:36 ` Jakub Jelinek
2022-09-22  3:04   ` pengsheng.chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANY1fJQVZZ6W1qQK_mrTzQajxEMxK=dyxa2_i-bUmewc9G3L4w@mail.gmail.com' \
    --to=pengsheng.chen@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).