mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42607 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f228360ec
commit
87b77b9079
@ -1362,3 +1362,43 @@ _foo:
|
|||||||
|
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
We compile this:
|
||||||
|
|
||||||
|
void compare (long long foo) {
|
||||||
|
if (foo < 4294967297LL)
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
to:
|
||||||
|
|
||||||
|
_compare:
|
||||||
|
subl $12, %esp
|
||||||
|
cmpl $0, 16(%esp)
|
||||||
|
setne %al
|
||||||
|
movzbw %al, %ax
|
||||||
|
cmpl $1, 20(%esp)
|
||||||
|
setg %cl
|
||||||
|
movzbw %cl, %cx
|
||||||
|
cmove %ax, %cx
|
||||||
|
movw %cx, %ax
|
||||||
|
testb $1, %al
|
||||||
|
je LBB1_2 # cond_true
|
||||||
|
|
||||||
|
(also really horrible code on ppc). This is due to the expand code for 64-bit
|
||||||
|
compares. GCC produces multiple branches, which is much nicer:
|
||||||
|
|
||||||
|
_compare:
|
||||||
|
pushl %ebp
|
||||||
|
movl %esp, %ebp
|
||||||
|
subl $8, %esp
|
||||||
|
movl 8(%ebp), %eax
|
||||||
|
movl 12(%ebp), %edx
|
||||||
|
subl $1, %edx
|
||||||
|
jg L5
|
||||||
|
L7:
|
||||||
|
jl L4
|
||||||
|
cmpl $0, %eax
|
||||||
|
jbe L4
|
||||||
|
L5:
|
||||||
|
|
||||||
|
//===---------------------------------------------------------------------===//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user