https://bugs.llvm.org/show_bug.cgi?id=50126
Bug ID: 50126
Summary: Codegen regression with sign extensions
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: ARM
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
struct s {
short x, y;
};
struct s rot90(struct s p)
{
return (struct s) { -p.y, p.x };
}
struct s rot270(struct s p)
{
return (struct s) { p.y, -p.x };
}
Trunk:
rot90: // @rot90
neg w8, w0, lsr #16
lsl w0, w0, #16
bfxil x0, x8, #0, #16
ret
rot270: // @rot270
neg w8, w0, lsl #16
bfxil x8, x0, #16, #16
mov x0, x8
ret
rot90: // @rot90
neg w8, w0, lsr #16
bfi w8, w0, #16, #16
mov x0, x8
ret
rot270: // @rot270
ubfx x8, x0, #16, #16
sub w0, w8, w0, lsl #16
ret
Maybe ideal codegen?:
rot90:
mov w1, w0
neg w0, w1, asr 16
bfi w0, w1, 16, 16
ret
rot270:
neg w1, w0
extr w0, w1, w0, 16
ret
See it live:
https://gcc.godbolt.org/z/4c4ds58v6
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs