aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Move ChooseRegOrImmed() prototype here, from InstrSelectionSupport.h.Brian Gaeke2004-04-071-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12765 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include InstrSelectionSupport.h.Brian Gaeke2004-04-072-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12764 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement test/Regression/Transforms/InstCombine/getelementptr_index.llChris Lattner2004-04-071-23/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12762 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix insertion of SelectInsts.Brian Gaeke2004-04-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12760 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't print [%reg + 0], just print [%reg]Brian Gaeke2004-04-072-4/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12759 91177308-0d34-0410-b5e6-96231b3b80d8
* First version of code to handle loads. Stub function for handling stores.Brian Gaeke2004-04-074-4/+156
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12758 91177308-0d34-0410-b5e6-96231b3b80d8
* Support loading arguments from %I0...%I5 into virtual registers inBrian Gaeke2004-04-074-12/+120
| | | | | | | | function prologues, and fix an off-by-one in visitCallInst that was putting call args into the wrong registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12757 91177308-0d34-0410-b5e6-96231b3b80d8
* It's setting up the call args right now, but on the callee side, it'sBrian Gaeke2004-04-074-4/+52
| | | | | | | | trying to get incoming args off the stack, instead of the %i0...%i6 regs, which is wrong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12756 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug Brian found.Chris Lattner2004-04-071-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12754 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a start on handling setcc instructions. As the comment notes, weChris Lattner2004-04-074-0/+140
| | | | | | | | have no good way of handling this until the code generator is improved. We should probably just emit V9 instructions in the meantime. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12745 91177308-0d34-0410-b5e6-96231b3b80d8
* andd subcc instructions which is used to create the 'cmp' pseudo instructionChris Lattner2004-04-072-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12744 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid emitting an extra copy on each 32-bit operationChris Lattner2004-04-074-16/+44
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12743 91177308-0d34-0410-b5e6-96231b3b80d8
* Make generation of stack-slot loads and copies less ugly.Brian Gaeke2004-04-072-14/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12742 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in printing loads.Brian Gaeke2004-04-072-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12741 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for shift instructions, wrap some long linesChris Lattner2004-04-074-60/+96
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12740 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix encoding of existing shift instructions, add rr shiftsChris Lattner2004-04-072-6/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12739 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a bunch more instructionsChris Lattner2004-04-076-104/+200
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12737 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge my changes with briansChris Lattner2004-04-072-12/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12736 91177308-0d34-0410-b5e6-96231b3b80d8
* Add in some things I forgot, which Chris helpfully reminded me of...Brian Gaeke2004-04-072-4/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12735 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the "Y" register, used by MUL & DIV.Brian Gaeke2004-04-072-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12734 91177308-0d34-0410-b5e6-96231b3b80d8
* Add UDIV, SDIV, and a few variants of WR.Brian Gaeke2004-04-072-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12733 91177308-0d34-0410-b5e6-96231b3b80d8
* Preliminary support for getting 64-bit integer constants into registers.Brian Gaeke2004-04-074-8/+108
| | | | | | | | Preliminary support for division. It's gross because you have to initialize the "Y" register, which is the top 32 bits of the thing you're dividing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12732 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune unnecessary #includesBrian Gaeke2004-04-062-24/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12731 91177308-0d34-0410-b5e6-96231b3b80d8
* Simple delay slot filler pass.Brian Gaeke2004-04-062-0/+174
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12730 91177308-0d34-0410-b5e6-96231b3b80d8
* Add references to delay slot filler pass.Brian Gaeke2004-04-064-2/+48
| | | | | | | Fill in addPassesToJITCompile method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12729 91177308-0d34-0410-b5e6-96231b3b80d8
* First attempt at handling frame index elimination.Brian Gaeke2004-04-062-16/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12728 91177308-0d34-0410-b5e6-96231b3b80d8
* First attempt at special-casing printing of [%reg + offset] forBrian Gaeke2004-04-062-0/+110
| | | | | | | | ld/st instructions - doesn't seem to work yet, but I think it's just a typo or something somewhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12727 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete reference to "the Mach-O Runtime ABI".Brian Gaeke2004-04-062-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12726 91177308-0d34-0410-b5e6-96231b3b80d8
* Deal with call return values.Brian Gaeke2004-04-064-4/+60
| | | | | | | Don't put NOPs in delay slots at all. We'll have a fix-up pass later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12725 91177308-0d34-0410-b5e6-96231b3b80d8
* file based off InstSelectSimple.cpp, slowly being replaced by generated code ↵Jakub Staszak2004-04-061-0/+2831
| | | | | | from the really simple X86 instruction selector tablegen backend git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12715 91177308-0d34-0410-b5e6-96231b3b80d8
* Tablgen files for really simple instruction selectorJakub Staszak2004-04-065-2/+653
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12714 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR313: [x86] JIT miscompiles unsigned short to floating pointChris Lattner2004-04-062-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12711 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix incorrect encoding of some ADC and SBB instuctionsChris Lattner2004-04-061-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12710 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor bug in previous checkingChris Lattner2004-04-062-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | Enable folding of long seteq/setne comparisons into branches and select instructions Implement unfolded long relational comparisons against a constants a bit more efficiently Folding comparisons changes code that looks like this: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] mov %ECX, %EAX or %ECX, %EDX sete %CL test %CL, %CL je .LBB2 # PC rel: F into code that looks like this: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] mov %ECX, %EAX or %ECX, %EDX jne .LBB2 # PC rel: F This speeds up 186.crafty by 6% with llc-ls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12702 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve codegen of long == and != comparisons against constants. Before,Chris Lattner2004-04-062-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comparing a long against zero got us this: sub %ESP, 8 mov DWORD PTR [%ESP + 4], %ESI mov DWORD PTR [%ESP], %EDI mov %EAX, DWORD PTR [%ESP + 12] mov %EDX, DWORD PTR [%ESP + 16] mov %ECX, 0 mov %ESI, 0 mov %EDI, %EAX xor %EDI, %ECX mov %ECX, %EDX xor %ECX, %ESI or %EDI, %ECX sete %CL test %CL, %CL je .LBB2 # PC rel: F Now it gets us this: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] mov %ECX, %EAX or %ECX, %EDX sete %CL test %CL, %CL je .LBB2 # PC rel: F git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12696 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle various other important cases of multiplying a long constant ↵Chris Lattner2004-04-062-38/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | immediate. For example, multiplying X*(1 + (1LL << 32)) now produces: test: mov %ECX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] mov %EAX, %ECX add %EDX, %ECX ret [[[Note to Alkis: why isn't linear scan generating this code?? This might be a problem with your intervals being too conservative: test: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] add %EDX, %EAX ret end note]]] Whereas GCC produces this: T: sub %esp, 12 mov %edx, DWORD PTR [%esp+16] mov DWORD PTR [%esp+8], %edi mov %ecx, DWORD PTR [%esp+20] xor %edi, %edi mov DWORD PTR [%esp], %ebx mov %ebx, %edi mov %eax, %edx mov DWORD PTR [%esp+4], %esi add %ebx, %edx mov %edi, DWORD PTR [%esp+8] lea %edx, [%ecx+%ebx] mov %esi, DWORD PTR [%esp+4] mov %ebx, DWORD PTR [%esp] add %esp, 12 ret I'm not sure example what GCC is smoking here, but it looks like it has just confused itself with a bunch of stack slots or something. The intel compiler is better, but still not good: T: movl 4(%esp), %edx #2.11 movl 8(%esp), %eax #2.11 lea (%eax,%edx), %ecx #3.12 movl $1, %eax #3.12 mull %edx #3.12 addl %ecx, %edx #3.12 ret #3.12 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12693 91177308-0d34-0410-b5e6-96231b3b80d8
* Efficiently handle a long multiplication by a constant. For this testcase:Chris Lattner2004-04-062-50/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | long %test(long %X) { %Y = mul long %X, 123 ret long %Y } we used to generate: test: sub %ESP, 12 mov DWORD PTR [%ESP + 8], %ESI mov DWORD PTR [%ESP + 4], %EDI mov DWORD PTR [%ESP], %EBX mov %ECX, DWORD PTR [%ESP + 16] mov %ESI, DWORD PTR [%ESP + 20] mov %EDI, 123 mov %EBX, 0 mov %EAX, %ECX mul %EDI imul %ESI, %EDI add %ESI, %EDX imul %ECX, %EBX add %ESI, %ECX mov %EDX, %ESI mov %EBX, DWORD PTR [%ESP] mov %EDI, DWORD PTR [%ESP + 4] mov %ESI, DWORD PTR [%ESP + 8] add %ESP, 12 ret Now we emit: test: mov %EAX, DWORD PTR [%ESP + 4] mov %ECX, DWORD PTR [%ESP + 8] mov %EDX, 123 mul %EDX imul %ECX, %ECX, 123 add %ECX, %EDX mov %EDX, %ECX ret Which, incidently, is substantially nicer than what GCC manages: T: sub %esp, 8 mov %eax, 123 mov DWORD PTR [%esp], %ebx mov %ebx, DWORD PTR [%esp+16] mov DWORD PTR [%esp+4], %esi mov %esi, DWORD PTR [%esp+12] imul %ecx, %ebx, 123 mov %ebx, DWORD PTR [%esp] mul %esi mov %esi, DWORD PTR [%esp+4] add %esp, 8 lea %edx, [%ecx+%edx] ret git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12692 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve code generation of long shifts by 32.Chris Lattner2004-04-062-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On this testcase: long %test(long %X) { %Y = shr long %X, ubyte 32 ret long %Y } instead of: t: mov %EAX, DWORD PTR [%ESP + 4] mov %EAX, DWORD PTR [%ESP + 8] sar %EAX, 0 mov %EDX, 0 ret we now emit: test: mov %EAX, DWORD PTR [%ESP + 4] mov %EAX, DWORD PTR [%ESP + 8] mov %EDX, 0 ret git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12688 91177308-0d34-0410-b5e6-96231b3b80d8
* Bugfixes: inc/dec don't set the carry flag!Chris Lattner2004-04-062-24/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12687 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve code for passing constant longs as arguments to function calls.Chris Lattner2004-04-062-10/+26
| | | | | | | | | | | | | | | | | | | | | For example, on this instruction: call void %test(long 1234) Instead of this: mov %EAX, 1234 mov %ECX, 0 mov DWORD PTR [%ESP], %EAX mov DWORD PTR [%ESP + 4], %ECX call test We now emit this: mov DWORD PTR [%ESP], 1234 mov DWORD PTR [%ESP + 4], 0 call test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12686 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit more efficient 64-bit operations when the RHS is a constant, and oneChris Lattner2004-04-062-10/+82
| | | | | | | | | | | | | | | | of the words of the constant is zeros. For example: Y = and long X, 1234 now generates: Yl = and Xl, 1234 Yh = 0 instead of: Yl = and Xl, 1234 Yh = and Xh, 0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12685 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typeoChris Lattner2004-04-062-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12684 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for simple immediate handling to long instruction selection.Chris Lattner2004-04-062-50/+74
| | | | | | | This allows us to handle code like 'add long %X, 123456789012' more efficiently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12683 91177308-0d34-0410-b5e6-96231b3b80d8
* The sbb instructions really ARE sbb's, not adc'sChris Lattner2004-04-061-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12682 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement negation of longs efficiently. For this testcase:Chris Lattner2004-04-062-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | long %test(long %X) { %Y = sub long 0, %X ret long %Y } We used to generate: test: sub %ESP, 4 mov DWORD PTR [%ESP], %ESI mov %ECX, DWORD PTR [%ESP + 8] mov %ESI, DWORD PTR [%ESP + 12] mov %EAX, 0 mov %EDX, 0 sub %EAX, %ECX sbb %EDX, %ESI mov %ESI, DWORD PTR [%ESP] add %ESP, 4 ret Now we generate: test: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] neg %EAX adc %EDX, 0 neg %EDX ret git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12681 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor tweak to avoid an extra reg-reg copy that the register allocator has ↵Chris Lattner2004-04-062-2/+20
| | | | | | to eliminate git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12680 91177308-0d34-0410-b5e6-96231b3b80d8
* Two changes:Chris Lattner2004-04-062-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * In promote32, if we can just promote a constant value, do so instead of promoting a constant dynamically. * In visitReturn inst, actually USE the promote32 argument that takes a Value* The end result of this is that we now generate this: test: mov %EAX, 0 ret instead of... test: mov %AX, 0 movzx %EAX, %AX ret for: ushort %test() { ret ushort 0 } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12679 91177308-0d34-0410-b5e6-96231b3b80d8
* lli no longer takes the -quiet option!Chris Lattner2004-04-051-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12674 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not mangle intrinsics in any way!Chris Lattner2004-04-052-2/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12673 91177308-0d34-0410-b5e6-96231b3b80d8
* Sparc don't got not "sqrtl", bum bum bumChris Lattner2004-04-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12670 91177308-0d34-0410-b5e6-96231b3b80d8