public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marcus.kool at urlfilterdb dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/66369] gcc 4.8.3/5.1.0 miss optimisation with vpmovmskb
Date: Thu, 04 Jun 2015 17:50:00 -0000	[thread overview]
Message-ID: <bug-66369-4-UZc1heLnnx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66369-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Marcus Kool <marcus.kool at urlfilterdb dot com> ---
(In reply to Uroš Bizjak from comment #5)
> Created attachment 35693 [details]
> Patch to add zero-extended MOVMSK patterns
> 
> This patch adds zero-extended MOVMSK patterns.
> 
> However, one more cast from (int) to (unsigned int) is needed in the source,
> due to the definition of the intrinsic:
> 
>    long v;
> 
>    regchx256 = _mm256_set1_epi8( ch );
>    regset256 = _mm256_loadu_si256( (__m256i const *) set );
>    v = (unsigned int) _mm256_movemask_epi8
>                        ( _mm256_cmpeq_epi8(regchx256,regset256) );
Can you confirm that the code has
     return __builtin_ctzl(v);

Thanks for the patch, but the required cast to unsigned int is
counter-intuitive and it is likely that nobody will use this cast in their code
and hence miss the optimisation.  Isn't there a more elegant solution?
>From gcc-bugs-return-488114-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jun 04 17:59:17 2015
Return-Path: <gcc-bugs-return-488114-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6067 invoked by alias); 4 Jun 2015 17:59:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5297 invoked by uid 48); 4 Jun 2015 17:59:13 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/66369] gcc 4.8.3/5.1.0 miss optimisation with vpmovmskb
Date: Thu, 04 Jun 2015 17:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.3
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: minor
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ubizjak at gmail dot com
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66369-4-8X2VHueJUZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66369-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66369-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg00446.txt.bz2
Content-length: 851

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

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Marcus Kool from comment #8)

> Can you confirm that the code has
>      return __builtin_ctzl(v);

__inline__ long find_pos32( unsigned char ch, mycharset32 set )
{
   __m256i regchx256;
   __m256i regset256;
   long v;

   regchx256 = _mm256_set1_epi8( ch );
   regset256 = _mm256_loadu_si256( (__m256i const *) set );
   v = (unsigned int) _mm256_movemask_epi8(
_mm256_cmpeq_epi8(regchx256,regset256) );
   if (v != 0L)
      return (long) __builtin_ctzl( v );
   return -1;
}

> Thanks for the patch, but the required cast to unsigned int is
> counter-intuitive and it is likely that nobody will use this cast in their
> code and hence miss the optimisation.  Isn't there a more elegant solution?

No.
>From gcc-bugs-return-488115-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jun 04 18:13:26 2015
Return-Path: <gcc-bugs-return-488115-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 35887 invoked by alias); 4 Jun 2015 18:13:26 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 35842 invoked by uid 48); 4 Jun 2015 18:13:22 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/58749] PACK(ADJUSTL([" a"," b"]), [.TRUE.,.FALSE.]) causes an internal compiler error
Date: Thu, 04 Jun 2015 18:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc assigned_to
Message-ID: <bug-58749-4-5cIJ20PNT8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58749-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58749-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg00447.txt.bz2
Content-length: 600

https://gcc.gnu.org/bugzilla/show_bug.cgi?idX749

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2013-10-16 00:00:00         |2015-6-4
                 CC|                            |tkoenig at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |tkoenig at gcc dot gnu.org

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
A missing charlen.


      parent reply	other threads:[~2015-06-04 17:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 21:53 [Bug c/66369] New: " marcus.kool at urlfilterdb dot com
2015-06-01 21:57 ` [Bug c/66369] " marcus.kool at urlfilterdb dot com
2015-06-02  9:05 ` [Bug target/66369] " rguenth at gcc dot gnu.org
2015-06-02 10:21 ` ubizjak at gmail dot com
2015-06-02 11:21 ` marcus.kool at urlfilterdb dot com
2015-06-02 14:51 ` marcus.kool at urlfilterdb dot com
2015-06-03 18:00 ` ubizjak at gmail dot com
2015-06-04 10:06 ` uros at gcc dot gnu.org
2015-06-04 10:11 ` ubizjak at gmail dot com
2015-06-04 17:50 ` marcus.kool at urlfilterdb dot com [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=bug-66369-4-UZc1heLnnx@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).