From: "Sven C. Dack" <sdack@gmx.com>
To: gcc-help@gcc.gnu.org
Subject: Re: L1/L2 cache characteristics and -mtune=znver2 versus run-time detection
Date: Wed, 16 Dec 2020 16:30:00 +0000 [thread overview]
Message-ID: <c6e0f4e3-18f9-4a2b-c502-a250383d97ed@gmx.com> (raw)
In-Reply-To: <f752f540-2cf5-76a5-b5ec-f4894c0550de@gmx.com>
Could some of the GCC experts please share their knowledge on this issue?
On 05/12/2020 17:46, Sven C. Dack wrote:
> Hello,
>
> 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):
>
> $ gcc -march=znver2 --help=params -Q|fgrep cache
> --param=l1-cache-line-size= 32
> --param=l1-cache-size= 64
> --param=l2-cache-size= 512
>
> versus:
>
> $ gcc -march=native --help=params -Q|fgrep cache
> --param=l1-cache-line-size= 64
> --param=l1-cache-size= 32
> --param=l2-cache-size= 512
>
> GCC does detect the CPU as 'znver2':
>
> $ gcc -march=native --help=target -Q|fgrep march
> -march= znver2
>
> I've also verified this behaviour with '-mtune=znver2', and again does
> GCC only use the correct values when it uses auto-detection.
>
> Why does GCC not use the correct L1/L2 cache values when '-march=znver2'
> or '-mtune=znver2' is specified?
>
> Sven
>
next prev parent reply other threads:[~2020-12-16 16:30 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 [this message]
2020-12-16 17:33 ` Segher Boessenkool
[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=c6e0f4e3-18f9-4a2b-c502-a250383d97ed@gmx.com \
--to=sdack@gmx.com \
--cc=gcc-help@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).