llvm/lib/Target
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
..
CBackend Hack around stupidity in GCC, fixing Burg with the CBE and 2004-11-13 22:21:56 +00:00
PowerPC The LLVM bool type shall have 1 byte alignment on PPC. 2004-11-28 21:16:45 +00:00
Skeleton ignore generated files 2004-11-21 00:01:54 +00:00
Sparc Update list of failing benchmarks. 2004-11-24 04:07:42 +00:00
SparcV8 Update list of failing benchmarks. 2004-11-24 04:07:42 +00:00
SparcV9 Reworked branching so we don't handle BAs specially. It just updates the branchTO regardless of what type of branch it is. 2004-11-29 04:39:47 +00:00
X86 Revamp long/ulong comparisons to use a much more efficient sequence (thanks 2004-11-29 05:55:24 +00:00
Makefile Fix file comment header 2004-11-19 22:09:21 +00:00
MRegisterInfo.cpp Move destructor out of line to avoid vtable emission in every file that includes the header. Thanks to sabre. 2004-10-27 06:00:53 +00:00
Target.td Add isLittleEndianEncoding to InstrInfo class, defaults to `off' 2004-10-14 05:53:40 +00:00
TargetData.cpp Fix this function to not say that longs have 8-byte alignment on X86/PPC. 2004-11-02 22:18:18 +00:00
TargetFrameInfo.cpp Remove dead methods 2004-08-12 18:37:15 +00:00
TargetInstrInfo.cpp ConstantTypeMustBeLoaded has been incorporated into SparcV9PreSelection, its 2004-07-27 21:43:38 +00:00
TargetMachine.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
TargetMachineRegistry.cpp Implement TargetRegistrationListener 2004-07-11 06:03:21 +00:00
TargetSchedInfo.cpp Remove dead assert 2004-10-25 19:04:01 +00:00