mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Add a note about a missed cmov -> sbb opportunity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153741 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8fd3fcdba8
commit
2f1abe9a5f
@ -2060,3 +2060,21 @@ Instead we could generate:
|
||||
The trick is to match "fetch_and_add(X, -C) == C".
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
unsigned t(unsigned a, unsigned b) {
|
||||
return a <= b ? 5 : -5;
|
||||
}
|
||||
|
||||
We generate:
|
||||
movl $5, %ecx
|
||||
cmpl %esi, %edi
|
||||
movl $-5, %eax
|
||||
cmovbel %ecx, %eax
|
||||
|
||||
GCC:
|
||||
cmpl %edi, %esi
|
||||
sbbl %eax, %eax
|
||||
andl $-10, %eax
|
||||
addl $5, %eax
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user