public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/105669] New: DFP to HF (_Float16) conversions use incorrect rounding
@ 2022-05-20  7:45 clyon at gcc dot gnu.org
  2022-05-20 20:22 ` [Bug libgcc/105669] " jsm28 at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: clyon at gcc dot gnu.org @ 2022-05-20  7:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105669

            Bug ID: 105669
           Summary: DFP to HF (_Float16) conversions use incorrect
                    rounding
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: clyon at gcc dot gnu.org
  Target Milestone: ---

Support for conversions between DFP and _Float16 have been introduced with
r13-687-g308a0af4f91324.

For simplicity it uses intermediate conversions with SFmode, leading to double
rounding which probably produces incorrectly rounded results.

See also PR97635

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libgcc/105669] DFP to HF (_Float16) conversions use incorrect rounding
  2022-05-20  7:45 [Bug libgcc/105669] New: DFP to HF (_Float16) conversions use incorrect rounding clyon at gcc dot gnu.org
@ 2022-05-20 20:22 ` jsm28 at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2022-05-20 20:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105669

Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-05-20
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Joseph S. Myers <jsm28 at gcc dot gnu.org> ---
Example test illustrating this bug, at least on x86_64 (the DFP input is very
close to half way between two consecutive _Float16 values):

extern void exit (int);
extern void abort (void);
#define DCONST 7.340312e-5DF
static const _Float16 f1 = DCONST;
volatile _Decimal32 d = DCONST;
int
main (void)
{
  volatile _Float16 f2;
  f2 = d;
  if (f1 == f2)
    exit (0);
  else
    abort ();
}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-20 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20  7:45 [Bug libgcc/105669] New: DFP to HF (_Float16) conversions use incorrect rounding clyon at gcc dot gnu.org
2022-05-20 20:22 ` [Bug libgcc/105669] " jsm28 at gcc dot gnu.org

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).