1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/lib/Target
Chris Lattner dac54ebbee Improve signed division by power of 2 *dramatically* from this:
div:
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %ECX, 64
        mov %EAX, %EDX
        sar %EDX, 31
        idiv %ECX
        ret

to this:

div:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        sar %ECX, 5
        shr %ECX, 26
        mov %EDX, %EAX
        add %EDX, %ECX
        sar %EAX, 6
        ret

Note that the intel compiler is currently making this:

div:
        movl      4(%esp), %edx                                 #3.5
        movl      %edx, %eax                                    #4.14
        sarl      $5, %eax                                      #4.14
        shrl      $26, %eax                                     #4.14
        addl      %edx, %eax                                    #4.14
        sarl      $6, %eax                                      #4.14
        ret                                                     #4.14

Which has one less register->register copy.  (hint hint alkis :)

llvm-svn: 13354
2004-05-04 19:33:58 +00:00
..
CBackend Changes to fix up the inst_iterator to pass to boost iterator checks. This 2004-04-27 15:13:33 +00:00
PowerPC
SparcV8 I don't think we have to have 4 extra allocated (but unused) bytes on the stack. 2004-04-13 18:28:37 +00:00
SparcV9 Integrate the rest of my random sparcv9 scribblings into this file 2004-04-27 22:04:03 +00:00
X86 Improve signed division by power of 2 *dramatically* from this: 2004-05-04 19:33:58 +00:00
Makefile
MRegisterInfo.cpp
Target.td
TargetData.cpp Fix typo. 2004-04-14 21:21:56 +00:00
TargetFrameInfo.cpp
TargetInstrInfo.cpp
TargetMachine.cpp
TargetSchedInfo.cpp Add a constructor that got lost 2004-05-01 11:17:13 +00:00