llvm-6502/lib/Target/X86
Chris Lattner 928b47ae2e Revamp long/ulong comparisons to use a much more efficient sequence (thanks
to Brian and the Sun compiler for pointing out that the obvious works :)

This also enables folding all long comparisons into setcc and branch
instructions: before we could only do == and !=

For example, for:
void test(unsigned long long A, unsigned long long B) {
   if (A < B) foo();
 }

We now generate:

test:
        subl $4, %esp
        movl %esi, (%esp)
        movl 8(%esp), %eax
        movl 12(%esp), %ecx
        movl 16(%esp), %edx
        movl 20(%esp), %esi
        subl %edx, %eax
        sbbl %esi, %ecx
        jae .LBBtest_2  # UnifiedReturnBlock
.LBBtest_1:     # then
        call foo
        movl (%esp), %esi
        addl $4, %esp
        ret
.LBBtest_2:     # UnifiedReturnBlock
        movl (%esp), %esi
        addl $4, %esp
        ret

Instead of:

test:
        subl $12, %esp
        movl %esi, 8(%esp)
        movl %ebx, 4(%esp)
        movl 16(%esp), %eax
        movl 20(%esp), %ecx
        movl 24(%esp), %edx
        movl 28(%esp), %esi
        cmpl %edx, %eax
        setb %al
        cmpl %esi, %ecx
        setb %bl
        cmove %ax, %bx
        testb %bl, %bl
        je .LBBtest_2   # UnifiedReturnBlock
.LBBtest_1:     # then
        call foo
        movl 4(%esp), %ebx
        movl 8(%esp), %esi
        addl $12, %esp
        ret
.LBBtest_2:     # UnifiedReturnBlock
        movl 4(%esp), %ebx
        movl 8(%esp), %esi
        addl $12, %esp
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18330 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 05:55:24 +00:00
..
.cvsignore ignore generated files 2004-11-21 00:01:54 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
X86.h Add -sse[,2,3] arguments to LLC 2004-08-24 08:18:44 +00:00
X86.td Add support for the -x86-asm-syntax flag, which can be used to choose between 2004-10-03 20:36:57 +00:00
X86AsmPrinter.cpp GhostLinkage should not reach asm printing stage 2004-11-14 21:03:49 +00:00
X86CodeEmitter.cpp There is no reason to emit function stubs for direct calls. 2004-11-21 03:46:06 +00:00
X86FloatingPoint.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
X86InstrBuilder.h Allow X86 addressing modes to represent globals with offsets. Patch contributed 2004-10-15 04:43:20 +00:00
X86InstrInfo.cpp
X86InstrInfo.h Remove a bunch of ad-hoc target-specific flags that were only used by the 2004-08-11 07:12:04 +00:00
X86InstrInfo.td Correct the name of stosd for the AT&T syntax: 2004-11-10 04:48:15 +00:00
X86ISelPattern.cpp Disable the pattern isel 2004-08-15 23:02:17 +00:00
X86ISelSimple.cpp Revamp long/ulong comparisons to use a much more efficient sequence (thanks 2004-11-29 05:55:24 +00:00
X86JITInfo.cpp Do not push two return addresses on the stack when we call external functions who have their addresses taken. This fixes test-call.ll 2004-11-22 22:25:30 +00:00
X86JITInfo.h We implement these interfaces 2004-11-20 23:53:56 +00:00
X86PeepholeOpt.cpp Add some new instructions. Fix the asm string for sbb32rr 2004-10-06 04:01:02 +00:00
X86RegisterInfo.cpp Add some new instructions. Fix the asm string for sbb32rr 2004-10-06 04:01:02 +00:00
X86RegisterInfo.h Code insertion methods now return void instead of an int. 2004-08-15 22:15:11 +00:00
X86RegisterInfo.td The real x87 floating point registers should not be allocatable. They 2004-09-21 21:22:11 +00:00
X86Relocations.h Describe the X86 target-specific relocations. 2004-11-20 23:54:19 +00:00
X86TargetMachine.cpp Fix a warning 2004-11-02 15:27:57 +00:00
X86TargetMachine.h Remove a dead function, which died when we got GAS emission working (phwew, 2004-11-16 04:34:29 +00:00