From: David Laight <David.Laight@ACULAB.COM>
To: 'Michal Simek' <michal.simek@xilinx.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"monstr@monstr.eu" <monstr@monstr.eu>,
"git@xilinx.com" <git@xilinx.com>
Cc: Mahesh Bodapati <mbodapat@xilinx.com>,
Randy Dunlap <rdunlap@infradead.org>
Subject: RE: [PATCH v2 2/3] microblaze: Do loop unrolling for optimized memset implementation
Date: Fri, 25 Feb 2022 21:50:50 +0000 [thread overview]
Message-ID: <a3621a76457646b58a9deef3e861d362@AcuMS.aculab.com> (raw)
In-Reply-To: <10a432e269a6d3349cf458e4f5792522779cba0d.1645797329.git.michal.simek@xilinx.com>
From: Michal Simek
> Sent: 25 February 2022 13:56
>
> Align implementation with memcpy and memmove where also remaining bytes are
> copied via final switch case instead of using simple implementations which
> loop. But this alignment has much stronger reason and definitely aligning
> implementation is not the key point here. It is just good to have in mind
> that the same technique is used already there.
>
> In GCC 10, now -ftree-loop-distribute-patterns optimization is on at O2.
> This optimization causes GCC to convert the while loop in memset.c into a
> call to memset.
Gah...
That is nearly as brain dead as another compiler that would convert
any byte copy loop (on x86) into 'rep movsb'.
If I want to call memcpy() I'll call memcpy.
If I'm copying a few bytes I might write the loop to avoid
the cost of the call and all the conditional tests for
buffer length and alignment.
Don't the compiler writers have better things to do?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2022-02-25 21:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 13:55 [PATCH v2 0/3] microblaze: Fix issues with freestanding Michal Simek
2022-02-25 13:55 ` [PATCH v2 1/3] microblaze: Use simple memset implementation from lib/string.c Michal Simek
2022-02-25 13:55 ` [PATCH v2 2/3] microblaze: Do loop unrolling for optimized memset implementation Michal Simek
2022-02-25 21:50 ` David Laight [this message]
2022-02-28 6:38 ` Michal Simek
2022-02-25 13:55 ` [PATCH v2 3/3] microblaze: Use simple memmove/memcpy implementation from lib/string.c Michal Simek
2022-04-21 8:56 ` [PATCH v2 0/3] microblaze: Fix issues with freestanding Michal Simek
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=a3621a76457646b58a9deef3e861d362@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=git@xilinx.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbodapat@xilinx.com \
--cc=michal.simek@xilinx.com \
--cc=monstr@monstr.eu \
--cc=rdunlap@infradead.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
all inboxes | Powered by JetHome®