llvm-6502/lib
Chris Lattner 26d2990e03 Lower X%C into X/C+stuff. This allows the 'division by a constant' logic to
apply to rems as well as divs.  This fixes PR945 and speeds up ReedSolomon
from 14.57s to 10.90s (which is now faster than gcc).

It compiles CodeGen/X86/rem.ll into:

_test1:
        subl $4, %esp
        movl %esi, (%esp)
        movl $2155905153, %ecx
        movl 8(%esp), %esi
        movl %esi, %eax
        imull %ecx
        addl %esi, %edx
        movl %edx, %eax
        shrl $31, %eax
        sarl $7, %edx
        addl %eax, %edx
        imull $255, %edx, %eax
        subl %eax, %esi
        movl %esi, %eax
        movl (%esp), %esi
        addl $4, %esp
        ret
_test2:
        movl 4(%esp), %eax
        movl %eax, %ecx
        sarl $31, %ecx
        shrl $24, %ecx
        addl %eax, %ecx
        andl $4294967040, %ecx
        subl %ecx, %eax
        ret
_test3:
        subl $4, %esp
        movl %esi, (%esp)
        movl $2155905153, %ecx
        movl 8(%esp), %esi
        movl %esi, %eax
        mull %ecx
        shrl $7, %edx
        imull $255, %edx, %eax
        subl %eax, %esi
        movl %esi, %eax
        movl (%esp), %esi
        addl $4, %esp
        ret

instead of div/idiv instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30920 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 20:58:32 +00:00
..
Analysis Fix a bug pointed out by Zhongxing Xu 2006-10-09 17:28:13 +00:00
Archive For PR797: 2006-08-25 19:54:53 +00:00
AsmParser Fix PR886: 2006-10-09 17:36:59 +00:00
Bytecode Fix massive resource leaks in the bytecode reader. Reading a bytecode file 2006-10-12 18:32:30 +00:00
CodeGen Lower X%C into X/C+stuff. This allows the 'division by a constant' logic to 2006-10-12 20:58:32 +00:00
Debugger For PR797: 2006-08-25 17:43:11 +00:00
ExecutionEngine Unbreak the JIT 2006-09-15 04:56:11 +00:00
Linker Adding dllimport, dllexport and external weak linkage types. 2006-09-14 18:23:27 +00:00
Support Fix a static dtor issue 2006-10-04 22:13:11 +00:00
System Use new config.h macro 2006-09-14 06:21:59 +00:00
Target Doh. This wasn't causing problems by luck. 2006-10-12 19:13:59 +00:00
Transforms Replace custom dispatch code with two uses of InstVisitor. Improves 2006-10-12 02:02:44 +00:00
VMCore Add insertelement/extractelement helper ctors. 2006-10-05 06:24:58 +00:00
Makefile Make some changes suggested by Chris: 2006-05-17 22:55:35 +00:00