public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/106113] New: wrong codegen for _mm_[u]comineq_{ss,sd} and need to return PF result.
@ 2022-06-28 10:05 lingling.kong7 at gmail dot com
  2022-06-28 13:32 ` [Bug target/106113] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: lingling.kong7 at gmail dot com @ 2022-06-28 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106113
           Summary: wrong codegen for _mm_[u]comineq_{ss,sd} and need to
                    return PF result.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lingling.kong7 at gmail dot com
  Target Milestone: ---

https://gcc.godbolt.org/z/svoqvKs55

for _mm_ucomineq_ss,
according to the instruction description,

Operation
(V)UCOMISS (all versions)
RESULT := UnorderedCompare(DEST[31:0] <> SRC[31:0]) {
(* Set EFLAGS *) CASE (RESULT) OF
UNORDERED: ZF,PF,CF := 111;
GREATER_THAN: ZF,PF,CF := 000;
LESS_THAN: ZF,PF,CF := 001;
EQUAL: ZF,PF,CF := 100;
ESAC;
OF, AF, SF := 0; }

result need to set PF = 1, 

but now generate code for `_mm_ucomineq_ss` is
# gcc -O3 -mavx512f
        xorl    %eax, %eax
        vucomiss        %xmm1, %xmm0
        setne   %al
        ret
it ignore PF result, the codegen in llvm for this is correct.

We also could refer to the codegen in gcc for '_mm_comi_round_ss(__A, __B, 4,
_MM_FROUND_NO_EXC); '

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

end of thread, other threads:[~2022-10-22  2:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 10:05 [Bug target/106113] New: wrong codegen for _mm_[u]comineq_{ss,sd} and need to return PF result lingling.kong7 at gmail dot com
2022-06-28 13:32 ` [Bug target/106113] " jakub at gcc dot gnu.org
2022-06-28 13:33 ` jakub at gcc dot gnu.org
2022-06-30  2:16 ` hjl.tools at gmail dot com
2022-06-30  2:26 ` lingling.kong7 at gmail dot com
2022-07-15  2:31 ` cvs-commit at gcc dot gnu.org
2022-07-26  6:00 ` lingling.kong7 at gmail dot com
2022-07-26  6:01 ` lingling.kong7 at gmail dot com
2022-10-22  2:21 ` pinskia 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).