public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/108945] New: [13.0] d: vector float comparison doesn't result in 0 or -1
@ 2023-02-27 11:43 ibuclaw at gcc dot gnu.org
  2023-03-03  0:26 ` [Bug d/108945] " cvs-commit at gcc dot gnu.org
  2023-03-03  0:27 ` ibuclaw at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2023-02-27 11:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108945
           Summary: [13.0] d: vector float comparison doesn't result in 0
                    or -1
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gcc dot gnu.org
  Target Milestone: ---

This is because we're using VEC_COND_EXPR using a float vector in both the true
and false branches, this then reinterprets `-1.0f' as an integer.

Only affects mainline, as vector comparison is a new addition to the D
implementation.

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

* [Bug d/108945] [13.0] d: vector float comparison doesn't result in 0 or -1
  2023-02-27 11:43 [Bug d/108945] New: [13.0] d: vector float comparison doesn't result in 0 or -1 ibuclaw at gcc dot gnu.org
@ 2023-03-03  0:26 ` cvs-commit at gcc dot gnu.org
  2023-03-03  0:27 ` ibuclaw at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-03  0:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:51af8a6401eea726d3498e6b2aba456b6af246d6

commit r13-6430-g51af8a6401eea726d3498e6b2aba456b6af246d6
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Mon Feb 27 16:02:21 2023 +0100

    d: vector float comparison doesn't result in 0 or -1 [PR108945]

    When comparing two vectors, the type of vector was used as the result of
    the condition result.  This meant that for floating point comparisons,
    each value would either be `0.0' or `-1.0' reinterpreted as an integer,
    not the expected integral bitmask values `0' and `-1'.

    Instead, use the comparison type determined by truth_type_for as the
    result of the comparison.  If a reinterpret is later required by the
    final conversion for generating CmpExp, it is still only going to
    reinterpret one integer kind as another.

            PR d/108945

    gcc/d/ChangeLog:

            * d-codegen.cc (build_boolop): Evaluate vector comparison as
            the truth_type_for vector type.

    gcc/testsuite/ChangeLog:

            * gdc.dg/pr108945.d: New test.

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

* [Bug d/108945] [13.0] d: vector float comparison doesn't result in 0 or -1
  2023-02-27 11:43 [Bug d/108945] New: [13.0] d: vector float comparison doesn't result in 0 or -1 ibuclaw at gcc dot gnu.org
  2023-03-03  0:26 ` [Bug d/108945] " cvs-commit at gcc dot gnu.org
@ 2023-03-03  0:27 ` ibuclaw at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2023-03-03  0:27 UTC (permalink / raw)
  To: gcc-bugs

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

ibuclaw at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from ibuclaw at gcc dot gnu.org ---
Fix committed.

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

end of thread, other threads:[~2023-03-03  0:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 11:43 [Bug d/108945] New: [13.0] d: vector float comparison doesn't result in 0 or -1 ibuclaw at gcc dot gnu.org
2023-03-03  0:26 ` [Bug d/108945] " cvs-commit at gcc dot gnu.org
2023-03-03  0:27 ` ibuclaw 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).