public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/110118] New: Miss CSE optimization for vptest after r14-1466-g3635e8c67e13e3da7e1e23a617dd9952218e93e0
Date: Mon, 05 Jun 2023 01:55:01 +0000	[thread overview]
Message-ID: <bug-110118-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 110118
           Summary: Miss CSE optimization for vptest after
                    r14-1466-g3635e8c67e13e3da7e1e23a617dd9952218e93e0
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---

#include <immintrin.h>

int do_stuff(__m256i Y0, __m256i Y1, __m128i X2) {
  __m256i And01 = _mm256_and_si256(Y0, Y1);
  int TestResult = _mm256_testc_si256(And01, And01);
  int t1 = _mm256_testz_si256(And01, And01);
  return TestResult + t1;
}


GCC 12.2 generates

do_stuff:
        vpand   %ymm1, %ymm0, %ymm0
        xorl    %eax, %eax
        vptest  %ymm0, %ymm0
        sete    %al
        adcl    $0, %eax
        ret

GCC trunk generates

do_stuff:
        vpand   %ymm1, %ymm0, %ymm0
        xorl    %eax, %eax
        vptest  %ymm0, %ymm0
        setc    %al
        xorl    %edx, %edx
        vptest  %ymm0, %ymm0
        sete    %dl
        addl    %edx, %eax
        ret

             reply	other threads:[~2023-06-05  1:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05  1:55 crazylht at gmail dot com [this message]
2023-06-05  1:58 ` [Bug target/110118] " crazylht at gmail dot com
2023-06-22  6:44 ` cvs-commit at gcc dot gnu.org

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=bug-110118-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).