llvm-6502/lib/Target
Chris Lattner ce7cafa960 shld is a very high latency operation. Instead of emitting it for shifts of
two or three, open code the equivalent operation which is faster on athlon
and P4 (by a substantial margin).

For example, instead of compiling this:

long long X2(long long Y) { return Y << 2; }

to:

X3_2:
        movl 4(%esp), %eax
        movl 8(%esp), %edx
        shldl $2, %eax, %edx
        shll $2, %eax
        ret

Compile it to:

X2:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl %eax, %edx
        shrl $30, %edx
        leal (%edx,%ecx,4), %edx
        shll $2, %eax
        ret

Likewise, for << 3, compile to:

X3:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl %eax, %edx
        shrl $29, %edx
        leal (%edx,%ecx,8), %edx
        shll $3, %eax
        ret

This matches icc, except that icc open codes the shifts as adds on the P4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17707 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-13 20:48:57 +00:00
..
CBackend Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
PowerPC Allow hbd to be bugpointable on darwin by fixing common and linkonce codegen 2004-11-09 04:01:18 +00:00
Skeleton Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
Sparc Handle "call" operands of type long/ulong passed in registers. 2004-11-04 00:27:04 +00:00
SparcV8 Handle "call" operands of type long/ulong passed in registers. 2004-11-04 00:27:04 +00:00
SparcV9 Decompose* is V9 specific, make it internal 2004-11-07 00:43:24 +00:00
X86 shld is a very high latency operation. Instead of emitting it for shifts of 2004-11-13 20:48:57 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +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
TargetSchedInfo.cpp Remove dead assert 2004-10-25 19:04:01 +00:00