https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100056
Bug ID: 100056
Summary: [9/10/11 Regression]
Product: gcc
Version: 9.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: luc.vanoostenryck at gmail dot com
Target Milestone: ---
Target: aarch64
Created attachment 50573
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50573&action=edit
or-shift vs. [us]bfiz
On arm64, the following code:
unsigned or_shift(unsigned char i)
{
return i | (i << 11);
}
translate to the following assembly:
or_shift:
and w1, w0, 255
ubfiz w0, w0, 11, 8
orr w0, w0, w1
ret
where the ubfiz instruction is a bit weird since the code
matches directly what was generated in gcc 8.x and before:
or_shift:
and w0, w0, 255
orr w0, w0, w0, lsl 11
ret
Same with a signed argument (see https://gcc.godbolt.org/z/af4zffMYa ).