From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>,
GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Richard Sandiford <Richard.Sandiford@arm.com>,
Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: [PATCH] AArch64: Cleanup memset expansion
Date: Fri, 10 Nov 2023 11:30:52 +0000 [thread overview]
Message-ID: <372b9689-24b5-41f4-a990-5aee0226e15f@foss.arm.com> (raw)
In-Reply-To: <PAWPR08MB898208A63C705C93E1DF86DF83AEA@PAWPR08MB8982.eurprd08.prod.outlook.com>
On 10/11/2023 10:17, Wilco Dijkstra wrote:
> Hi Kyrill,
>
>> + /* Reduce the maximum size with -Os. */
>> + if (optimize_function_for_size_p (cfun))
>> + max_set_size = 96;
>> +
>
>> .... This is a new "magic" number in this code. It looks sensible, but how did you arrive at it?
>
> We need 1 instruction to create the value to store (DUP or MOVI) and 1 STP
> for every 32 bytes, so the 96 means 4 instructions for typical sizes
> (sizes not
> a multiple of 16 can add one extra instruction).
>
> I checked codesize on SPECINT2017, and 96 had practically identical size.
> Using 128 would also be a reasonable Os value with a very slight size
> increase,
> and 384 looks good for O2 - however I didn't want to tune these values
> as this
> is a cleanup patch.
>
> Cheers,
> Wilco
Shouldn't this be a param then? Also, manifest constants in the middle
of code are a potential nightmare, please move it to a #define (even if
that's then used as the default value for the param).
next prev parent reply other threads:[~2023-11-10 11:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 12:51 Wilco Dijkstra
2023-11-06 12:11 ` Wilco Dijkstra
2023-11-10 9:50 ` Kyrylo Tkachov
2023-11-10 10:17 ` Wilco Dijkstra
2023-11-10 11:30 ` Richard Earnshaw [this message]
2023-11-10 14:46 ` Kyrylo Tkachov
2023-11-10 15:13 ` Richard Earnshaw
2023-11-14 16:23 ` [PATCH v2] " Wilco Dijkstra
2023-11-14 16:36 ` Richard Earnshaw
2023-11-14 16:56 ` Wilco Dijkstra
2023-12-22 14:25 ` [PATCH v3] " Wilco Dijkstra
2024-01-05 10:53 ` Richard Sandiford
2024-01-09 20:51 ` [PATCH v4] " Wilco Dijkstra
2024-01-10 18:13 ` Richard Sandiford
2024-01-30 15:51 ` Wilco Dijkstra
2024-02-01 17:32 ` Richard Sandiford
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=372b9689-24b5-41f4-a990-5aee0226e15f@foss.arm.com \
--to=richard.earnshaw@foss.arm.com \
--cc=Kyrylo.Tkachov@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=Richard.Sandiford@arm.com \
--cc=Wilco.Dijkstra@arm.com \
--cc=gcc-patches@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).