[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a3621a76457646b58a9deef3e861d362@AcuMS.aculab.com>
Date: Fri, 25 Feb 2022 21:50:50 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Michal Simek' <michal.simek@...inx.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"monstr@...str.eu" <monstr@...str.eu>,
"git@...inx.com" <git@...inx.com>
CC: Mahesh Bodapati <mbodapat@...inx.com>,
Randy Dunlap <rdunlap@...radead.org>
Subject: RE: [PATCH v2 2/3] microblaze: Do loop unrolling for optimized memset
implementation
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)
Powered by blists - more mailing lists