public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: "marxin.liska at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/24965] [dwz] Faster hashing using native insns
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <bug-24965-11298-N9BK7Ff8iv@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24965-11298@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=24965

--- Comment #5 from Martin Liška <marxin.liska at gmail dot com> ---
(In reply to Jakub Jelinek from comment #4)
> This looks wrong to me.  It will fail to compile on non-x86, fail to run on
> x86 on older hw, and it is unclear why an option is needed.

Sure, it should be conditional for x86_64.
>  It needs to be
> guarded with preprocessor autoconf macros on whether the insns are available
> (assembler handles them) and runtime check whether it can be used or not.
> Formatting glitches too (missing space before ( ).

And the detection should be run-time, so we can use target_clone attribute:
__attribute__((target_clones ("default", "sse42"))) or set guard at the start
up:


#include <config/i386/cpuinfo.h>
...
guard =  ((__cpu_model.__cpu_features[0] & (1 << FEATURE_AVX4_2))

which would be faster as we'll not use indirect calls.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2019-09-05 11:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  0:00 [Bug default/24965] New: " vries at gcc dot gnu.org
2019-01-01  0:00 ` [Bug default/24965] " marxin.liska at gmail dot com
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` marxin.liska at gmail dot com
2019-01-01  0:00 ` jakub at redhat dot com
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` jakub at redhat dot com
2019-01-01  0:00 ` jakub at redhat dot com
2019-01-01  0:00 ` marxin.liska at gmail 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-24965-11298-N9BK7Ff8iv@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=dwz@sourceware.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).