summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix grammar: apostrophe-s ('s) is possessive, not plural; also iff vs. if.Misha Brukman2005-08-031-4/+4
| | | | llvm-svn: 22619
* minor capitalization thing, patch by Jim LaskeyChris Lattner2005-08-031-1/+1
| | | | llvm-svn: 22617
* This hunk accidentally got dropped. Patch by Jim LaskeyChris Lattner2005-08-021-67/+0
| | | | llvm-svn: 22595
* Update to use the new MathExtras.h support for log2 computation.Chris Lattner2005-08-021-11/+35
| | | | | | Patch contributed by Jim Laskey! llvm-svn: 22594
* add a pass name to make debugging dumps nicerChris Lattner2005-08-021-0/+4
| | | | llvm-svn: 22588
* Eliminate an extra copy from R1 that Nate noticed on function calls thatChris Lattner2005-07-281-1/+2
| | | | | | have to write arguments to the stack llvm-svn: 22536
* Specify the correct number of operandsChris Lattner2005-07-281-3/+3
| | | | llvm-svn: 22535
* Fold constant adds into loads and stores to frame indices.Nate Begeman2005-07-281-17/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the following code: double %ext(int %A.0__, long %A.1__) { %A_addr = alloca %typedef.DComplex ; <%typedef.DComplex*> [#uses=2] %tmp.1 = cast %typedef.DComplex* %A_addr to int* ; <int*> [#uses=1] store int %A.0__, int* %tmp.1 %tmp.2 = getelementptr %typedef.DComplex* %A_addr, int 0, uint 1 ; <double*> [#uses=2] %tmp.3 = cast double* %tmp.2 to long* ; <long*> [#uses=1] store long %A.1__, long* %tmp.3 %tmp.5 = load double* %tmp.2 ; <double> [#uses=1] ret double %tmp.5 } We now generate: _ext: .LBB_ext_0: ; stw r3, -12(r1) stw r4, -8(r1) stw r5, -4(r1) lfd f1, -8(r1) blr Instead of: _ext: .LBB_ext_0: ; stw r3, -12(r1) addi r2, r1, -12 stw r4, 4(r2) stw r5, 8(r2) lfd f1, 4(r2) blr This also fires hundreds of times on MultiSource. llvm-svn: 22533
* Fix some commentsNate Begeman2005-07-271-3/+1
| | | | llvm-svn: 22530
* Eliminate all remaining tabs and trailing spaces.Jeff Cohen2005-07-271-11/+11
| | | | llvm-svn: 22523
* Fix an optimization put in for accessing static globals. This obviatesNate Begeman2005-07-251-5/+6
| | | | | | the need to build PIC. llvm-svn: 22512
* PowerPC no-pic code is not quite ready for prime-timeChris Lattner2005-07-221-0/+1
| | | | llvm-svn: 22507
* Support building non-PICNate Begeman2005-07-211-56/+86
| | | | | | | | Remove the LoadHiAddr pseudo-instruction. Optimization of stores to and loads from statics. Force JIT to use new non-PIC codepaths. llvm-svn: 22494
* Generate mfocrf when targeting g5. Generate fsqrt/fsqrts when targetin g5.Nate Begeman2005-07-201-3/+18
| | | | | | 8-byte align doubles. llvm-svn: 22486
* Integrate SelectFPExpr into SelectExpr. This gets PPC32 closer to beingNate Begeman2005-07-191-338/+242
| | | | | | automatically generated from a target description. llvm-svn: 22470
* Change *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.Chris Lattner2005-07-101-2/+2
| | | | | | | | | | | | This is the last MVTSDNode. This allows us to eliminate a bunch of special case code for handling MVTSDNodes. Also, remove some uses of dyn_cast that should really be cast (which is cheaper in a release build). llvm-svn: 22368
* Change TRUNCSTORE to use a VTSDNode operand instead of being an MVTSTDNodeChris Lattner2005-07-101-1/+1
| | | | llvm-svn: 22366
* Make several cleanups to Andrews varargs change:Chris Lattner2005-07-051-19/+17
| | | | | | | | | | | | 1. Pass Value*'s into lowering methods so that the proper pointers can be added to load/stores from the valist 2. Intrinsics that return void should only return a token chain, not a token chain/retval pair. 3. Rename LowerVAArgNext -> LowerVAArg, because VANext is long gone. 4. Now that we have Value*'s available in the lowering methods, pass them into any load/stores from the valist that are emitted llvm-svn: 22339
* Fix PowerPC varargsChris Lattner2005-07-051-24/+25
| | | | llvm-svn: 22335
* Varargs is apparently currently broken on PPC. This hacks it so that itChris Lattner2005-07-011-4/+9
| | | | | | | | is at least overloading the right virtual methods. The implementations are currently wrong though. This fixes Ptrdist/bc, but not other programs (e.g. siod). llvm-svn: 22326
* Commit fix for generating conditional branch pseudo instructions thatNate Begeman2005-06-151-3/+8
| | | | | | | avoids dereferencing the end() iterator when selecting the fallthrough block. This requires an ilist change. llvm-svn: 22212
* Commit a small improvement that is already in the x86 and ia64 backends toNate Begeman2005-06-141-0/+5
| | | | | | | not generate unnecessary register copies. This improves compile time by 2-5% depending on the test. llvm-svn: 22210
* Handle some more real world cases of rlwimi. These don't come up thatNate Begeman2005-06-081-10/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regularly in "normal" code, but for things like software graphics, they make a big difference. For the following code: unsigned short Trans16Bit(unsigned srcA,unsigned srcB,unsigned alpha) { unsigned tmpA,tmpB,mixed; tmpA = ((srcA & 0x03E0) << 15) | (srcA & 0x7C1F); tmpB = ((srcB & 0x03E0) << 15) | (srcB & 0x7C1F); mixed = (tmpA * alpha) + (tmpB * (32 - alpha)); return ((mixed >> 5) & 0x7C1F) | ((mixed >> 20) & 0x03E0); } We now generate: _Trans16Bit: .LBB_Trans16Bit_0: ; entry andi. r2, r4, 31775 rlwimi r2, r4, 15, 7, 11 subfic r4, r5, 32 mullw r2, r2, r4 andi. r4, r3, 31775 rlwimi r4, r3, 15, 7, 11 mullw r3, r4, r5 add r2, r2, r3 srwi r3, r2, 5 andi. r3, r3, 31775 rlwimi r3, r2, 12, 22, 26 blr Instead of: _Trans16Bit: .LBB_Trans16Bit_0: ; entry slwi r2, r4, 15 rlwinm r2, r2, 0, 7, 11 andi. r4, r4, 31775 or r2, r2, r4 subfic r4, r5, 32 mullw r2, r2, r4 slwi r4, r3, 15 rlwinm r4, r4, 0, 7, 11 andi. r3, r3, 31775 or r3, r4, r3 mullw r3, r3, r5 add r2, r2, r3 srwi r3, r2, 5 andi. r3, r3, 31775 srwi r2, r2, 20 rlwimi r3, r2, 0, 22, 26 blr llvm-svn: 22201
* Fix andrews changes to fit in 80 columnsChris Lattner2005-05-151-9/+18
| | | | llvm-svn: 22064
* treat TAILCALL nodes identically to CALL nodesChris Lattner2005-05-131-1/+4
| | | | llvm-svn: 21977
* Add an isTailCall flag to LowerCallToChris Lattner2005-05-131-2/+3
| | | | llvm-svn: 21958
* Realize that we don't support fmod directly, fixing ↵Chris Lattner2005-05-131-1/+3
| | | | | | CodeGen/Generic/print-arith-fp.ll llvm-svn: 21939
* rename the ADJCALLSTACKDOWN/ADJCALLSTACKUP nodes to be CALLSEQ_START/BEGIN.Chris Lattner2005-05-121-6/+6
| | | | llvm-svn: 21915
* Pass in Calling Convention to use into LowerCallToChris Lattner2005-05-121-1/+2
| | | | llvm-svn: 21899
* These targets don't like setccChris Lattner2005-05-121-0/+3
| | | | llvm-svn: 21884
* Necessary changes to codegen cttz efficiently on PowerPCNate Begeman2005-05-111-6/+28
| | | | | | | | | | 1. Teach LegalizeDAG how to better legalize CTTZ if the target doesn't have CTPOP, but does have CTLZ 2. Teach PPC32 how to do sub x, const -> add x, -const for valid consts 3. Teach PPC32 how to do and (xor a, -1) b -> andc b, a 4. Teach PPC32 that ISD::CTLZ -> PPC::CNTLZW llvm-svn: 21880
* fold and (shl X, C1), C2 -> rlwinm when possible. Many other cases are ↵Chris Lattner2005-05-091-1/+20
| | | | | | | | possible, include and (srl) and the inverses (shl and) etc. llvm-svn: 21820
* fix typoAndrew Lenharth2005-05-041-1/+1
| | | | llvm-svn: 21693
* Implement count leading zeros (ctlz), count trailing zeros (cttz), and countAndrew Lenharth2005-05-031-0/+5
| | | | | | | | | population (ctpop). Generic lowering is implemented, however only promotion is implemented for SelectionDAG at the moment. More coming soon. llvm-svn: 21676
* This target doesn't support the FSIN/FCOS/FSQRT nodes yetChris Lattner2005-04-301-0/+8
| | | | llvm-svn: 21633
* Implement Value* tracking for loads and stores in the selection DAG. This ↵Andrew Lenharth2005-04-271-11/+11
| | | | | | | | enables one to use alias analysis in the backends. (TRUNK)Stores and (EXT|ZEXT|SEXT)Loads have an extra SDOperand which is a SrcValueSDNode which contains the Value*. Note that if the operation is introduced by the backend, it will still have the operand, but the value* will be null. llvm-svn: 21599
* Convert tabs to spacesMisha Brukman2005-04-221-3/+4
| | | | llvm-svn: 21452
* Remove trailing whitespaceMisha Brukman2005-04-211-135/+135
| | | | llvm-svn: 21425
* Match another form of eqvChris Lattner2005-04-211-1/+6
| | | | llvm-svn: 21413
* Next round of PPC CR optimizations. For the following code:Nate Begeman2005-04-181-62/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int %bar(float %a, float %b, float %c, float %d) { entry: %tmp.1 = setlt float %a, %d %tmp.2 = setlt float %b, %d %or = or bool %tmp.1, %tmp.2 %tmp.3 = setgt float %c, %d %tmp.4 = or bool %or, %tmp.3 %tmp.5 = and bool %tmp.4, true %retval = cast bool %tmp.5 to int ret int %retval } We now emit: _bar: .LBB_bar_0: ; entry fcmpu cr0, f1, f4 fcmpu cr1, f2, f4 cror 0, 0, 4 fcmpu cr1, f3, f4 cror 28, 0, 5 mfcr r2 rlwinm r3, r2, 29, 31, 31 blr Instead of: _bar: .LBB_bar_0: ; entry fcmpu cr7, f1, f4 mfcr r2 rlwinm r2, r2, 29, 31, 31 fcmpu cr7, f2, f4 mfcr r3 rlwinm r3, r3, 29, 31, 31 or r2, r2, r3 fcmpu cr7, f3, f4 mfcr r3 rlwinm r3, r3, 30, 31, 31 or r3, r2, r3 blr llvm-svn: 21321
* Change codegen for setcc to read the bit directly out of the conditionNate Begeman2005-04-181-42/+31
| | | | | | | | register. Added support in the .td file for the g5-specific variant of cr -> gpr moves that executes faster, but we currently don't generate it. llvm-svn: 21314
* Make pattern isel default for ppcNate Begeman2005-04-151-3/+2
| | | | | | | | | | Add new ppc beta option related to using condition registers Make pattern isel control flag (-enable-pattern-isel) global and tristate 0 == off 1 == on 2 == target default llvm-svn: 21309
* Implement multi-way branches through logical ops on condition registers.Nate Begeman2005-04-141-2/+68
| | | | | | | | This can generate considerably shorter code, reducing the size of crafty by almost 1%. Also fix the printing of mcrf. The code is currently disabled until it gets a bit more testing, but should work as-is. llvm-svn: 21298
* Start allocating condition registers. Almost all explicit uses of CR0 areNate Begeman2005-04-131-23/+26
| | | | | | | now gone. Next step is to get rid of the remaining ones and then start allocating bools to CRs where appropriate. llvm-svn: 21294
* Implement the fold shift X, zext(Y) -> shift X, Y at the target level,Nate Begeman2005-04-131-6/+22
| | | | | | where it is safe to do so. llvm-svn: 21293
* Disbale the broken fold of shift + sz[ext] for nowNate Begeman2005-04-131-19/+0
| | | | | | | | Move the transform for select (a < 0) ? b : 0 into the dag from ppc isel Enable the dag to fold and (setcc, 1) -> setcc for targets where setcc always produces zero or one. llvm-svn: 21291
* remove one more occurance of this that snuck inChris Lattner2005-04-131-1/+1
| | | | llvm-svn: 21271
* Elimate handling of ZERO_EXTEND_INREG. This causes the PPC backend to emitChris Lattner2005-04-131-13/+0
| | | | | | | andi instructions instead of rlwinm instructions for zero extend, but they seem like they would take the same time. llvm-svn: 21268
* Fold shift by size larger than type size to undefNate Begeman2005-04-121-1/+0
| | | | | | Make llvm undef values generate ISD::UNDEF nodes llvm-svn: 21261
* Implement setcc op, -1 sequencesNate Begeman2005-04-121-22/+41
| | | | | | | Remove dead setcc op, 0 sequences Coming later: generalization of op, imm llvm-svn: 21260
OpenPOWER on IntegriCloud