https://llvm.org/bugs/show_bug.cgi?id=24052
Bug ID: 24052
Summary: x86 assembly could be improved for expression x+9*y
where x,y are int8_t
Product: new-bugs
Version: 3.6
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
The following C code:
int8_t foo(int8_t x, int8_t y)
{
return x + 9 * y;
}
generates this assembly with clang:
movb $9, %cl
movb %sil, %al
mulb %cl
addb %al, %dil
movsbl %dil, %eax
and generates this one with gcc:
leal (%rsi,%rsi,8), %esi
leal (%rsi,%rdi), %eax
For information it is ok when args are int32_t.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs