public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: "Sven C. Dack" <sdack@gmx.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: L1/L2 cache characteristics and -mtune=znver2 versus run-time detection
Date: Wed, 16 Dec 2020 11:33:43 -0600	[thread overview]
Message-ID: <20201216173343.GK2672@gate.crashing.org> (raw)
In-Reply-To: <c6e0f4e3-18f9-4a2b-c502-a250383d97ed@gmx.com>

On Wed, Dec 16, 2020 at 04:30:00PM +0000, Sven C. Dack via Gcc-help wrote:
> Could some of the GCC experts please share their knowledge on this issue?

> >I've come across an unexpected behaviour of gcc and wanted to ask for
> >help. I've noticed that when I specify '-march=znver2' does gcc use the
> >incorrect values for the L1/L2 cache. Only when '-march=native' was used
> >and gcc detected the CPU at run-time does it use the correct values. For
> >example on a Ryzen 7 3800X (a Zen 2 CPU):

-march=native uses cpuid to get the cache info (or in general, looks at
the system it is running on).  -march=znver2 does not.  I do not know if
-march=znver2 should use better defaults.

> >Why does GCC not use the correct L1/L2 cache values when '-march=znver2'
> >or '-mtune=znver2' is specified?

Please open a PR?  https://gcc.gnu.org/bugs.html .  Thanks!


Segher

  reply	other threads:[~2020-12-16 17:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05 17:46 Sven C. Dack
2020-12-16 16:30 ` Sven C. Dack
2020-12-16 17:33   ` Segher Boessenkool [this message]
     [not found]     ` <3f4c127e-3cdd-5a4e-ef56-d5d62a88e30a@gmx.com>
     [not found]       ` <20201218101512.GQ2672@gate.crashing.org>
     [not found]         ` <20201218101912.GR2672@gate.crashing.org>
2020-12-18 13:32           ` Sven C. Dack

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=20201216173343.GK2672@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-help@gcc.gnu.org \
    --cc=sdack@gmx.com \
    /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).