summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* * Codegen of GEPs dramatically improved by folding multiplies and addsMisha Brukman2004-07-231-51/+134
| | | | | | | | * Function pointers implemented correctly using appropriate stubs Contributed by Nate Begeman. llvm-svn: 15133
* * Change class of BoolTy back to cIntMisha Brukman2004-07-231-19/+19
| | | | | | * Fix indentation back to 2 spaces llvm-svn: 15121
* * Change bool from cInt to cByte (for now)Misha Brukman2004-07-221-67/+90
| | | | | | | | | | | | | * Don't allow negative immediates to users of unsigned immediates * Fix long compares * Support <const int>, op as a potential immediate candidate * Fix sign extension of short and byte loads * Fix and improve integer casts * Fix passing of doubles as vararg functions Patch contributed by Nate Begeman. llvm-svn: 15109
* * Add the lost fix to define the second reg of a 2-reg representation of longsMisha Brukman2004-07-211-1/+4
| | | | | | * Fix opcode RLWNM -> RLWINM since it uses an immediate const shift value llvm-svn: 15087
* * Speed up canUseAsImmediateForOpcode() by comparing Operand beforeMisha Brukman2004-07-211-19/+19
| | | | | | | dyn_cast<>ing and checking Constant's value * Convert tabs to spaces llvm-svn: 15086
* * Fix printing of signed immediate valuesMisha Brukman2004-07-211-503/+427
| | | | | | | | | | | | * Generation of opcodes that take 16 bit immediates * Rewrote multiply to be correct for 64 bit values * Rewrote all the long handling to be correct for PowerPC * Fix visitSelectInst() to define the upper register of the pair of regs representing a long value Patch contributed by Nate Begeman. llvm-svn: 15083
* Treat external variables similarly to those with weak linkage: load indirect.Misha Brukman2004-07-201-4/+4
| | | | llvm-svn: 15047
* * Differentiate between global and weak symbol loadsMisha Brukman2004-07-201-64/+45
| | | | | | | | | | | | * Fix functions that take more than 32 bytes of args * Alignment of doubles in structs is 4 bytes, not 8 * Fix passing long args: rN = hi, rN+1 = lo * Rewrite signed divide * Rewrite Intrinsic::returnaddress Patch courtesy of Nate Begeman. llvm-svn: 15036
* Move handing of GlobalValues from getReg() to copyConstantToRegister(), thisMisha Brukman2004-07-201-19/+11
| | | | | | will avoid extra register-to-register copies. Thanks to Chris for the idea. llvm-svn: 15019
* * cFP class split into cFP32 and cFP64Misha Brukman2004-07-201-218/+229
| | | | | | | | | | | | | | | * Fn args passed in registers are now recorded as used by the call instruction `-> asm printer updated to not print out those registers with the call instr * Stack frame layout in prolog/epilog fixed, spills and vararg fns now work * float/double to signed int codegen now correct * various single precision float codegen bugs fixed * const integer multiply codegen fixed * select and setcc blocks inserted into the correct place in machine CFG * load of integer constant code optimized All of Shootout tests now work. Great thanks to Nate Begeman for the patch! llvm-svn: 15014
* Fix infinite loopChris Lattner2004-07-181-5/+5
| | | | llvm-svn: 14971
* CPR FixesChris Lattner2004-07-181-4/+2
| | | | llvm-svn: 14961
* * Use LI(S) to copy constants into registers intead of ADDI(S) as the latter isMisha Brukman2004-07-161-77/+154
| | | | | | | | | | | | a funky way to "use" R0 for a 0-valued operand * Add IMPLICIT_DEFs for incoming function arguments via registers to help the register allocator not clobber those registers * Implement comparisons with longs * Teach emitSelectOperation() to fold the SetCC operation Patch contributed by Nate Begeman llvm-svn: 14901
* Patches towards fixing PR341Chris Lattner2004-07-151-1/+1
| | | | llvm-svn: 14841
* Make sure MTSPR instruction is inserted into the BasicBlockMisha Brukman2004-07-141-1/+1
| | | | llvm-svn: 14822
* Don't define the same register twice when loading a ConstantPointerRef to a regMisha Brukman2004-07-141-5/+3
| | | | llvm-svn: 14819
* * Fix multiplication by powers of two and otherwiseMisha Brukman2004-07-141-5/+9
| | | | | | * Clarify variable name (StoreInst SI instead of LI) llvm-svn: 14818
* * Specify that FP arith options have 3 operandsMisha Brukman2004-07-131-13/+10
| | | | | | * Correctly load FP constants from the constant pool, should be refactored llvm-svn: 14799
* Correctly load FP constants out of the constant pool.Misha Brukman2004-07-121-6/+3
| | | | llvm-svn: 14782
* Add compilabilityChris Lattner2004-07-111-0/+1
| | | | llvm-svn: 14744
* * Add support for indexing into structures, thanks to Chris (x86)Misha Brukman2004-07-091-60/+94
| | | | | | | | | | | | The large diff is because of indentation of a whole region * Fix querying predecessor blocks in SelectPHINodes(), thanks to Brian (v8) * Add support for external functions malloc() and free() * Fix some code indentation Remember, kids: It's not plagiarism if you "creatively borrow" from your sources. It's called "research"! llvm-svn: 14723
* Add support for __fixdfdi(), __floatdisf(), and __floatdidf() external functionsMisha Brukman2004-07-081-3/+11
| | | | llvm-svn: 14703
* * Use several Function* for external functions instead of a std::mapMisha Brukman2004-07-081-26/+39
| | | | | | * Non-const FP values must be loaded into int regs (for vararg fns) via memory llvm-svn: 14701
* * Add support for loading FP constants from the constant poolMisha Brukman2004-07-081-10/+44
| | | | | | * Load FP values into int regs as well for vararg functions; without memory ops! llvm-svn: 14700
* * Use a map for caching lookups to external functions (fp div/rem)Misha Brukman2004-07-071-20/+28
| | | | | | * Tabs to spaces llvm-svn: 14673
* Add fmod() to the Module being compiled so that it gets a stub in the asm fileMisha Brukman2004-07-071-3/+8
| | | | llvm-svn: 14670
* * Add support for calling vararg functions (must pass doubles in int regs too)Misha Brukman2004-07-061-68/+89
| | | | | | | | | | | | * Make visitSetCondInst() share condition-generating code with EmitComparison() * There are 13 FPRs for function-passing arguments, not 8 * Do not rely on registers being sequential, use an array lookup * In unimplemented switch cases, send an error and abort instead of silent fall-through * Add doInitialization() for adding function prototypes for external math fns * Minor changes: fix indentation, spacing, code clarity llvm-svn: 14653
* * Add utility functions: convert SetCC => PPC opcode and invert PPC opcodeMisha Brukman2004-07-061-34/+49
| | | | | | | | | * If SetCondInst is folded into BranchInst (and it is the only user), do not emit code for SetCondInst * Fix assembly opcodes in comments in visitSetCondInst() * Fix codegen of conditional branches llvm-svn: 14643
* * Get rid of constant-expr handling code: we use the ConstantExpr lowering passMisha Brukman2004-07-011-100/+82
| | | | | | | | * Use the SetCC handling code in the format of Brian's V8 * Add FIXMEs where calls to functions are being made without adding them to the Module first... they cause missing symbols at assembly-time. llvm-svn: 14553
* * Don't save LR when outputting globals: it's already saved on the stack onceMisha Brukman2004-06-291-41/+46
| | | | | | | | | | | | | | for the function * Registers aren't necessarily sequential wrt their enums, don't rely on it when emitting function arguments into sequential registers * Remove X86-specific comments about AL/BL/AH/BH/EDX/etc * Add an abort() for an unimplemented signed right shift * The src operand for a GEP was never emitted! Fixed. * We can skip zero-valued GEP indices as they are no-ops. "Hello, World!" now works. llvm-svn: 14505
* Fix loading and storing PC-relative static variables, courtesy of Nate Begeman.Misha Brukman2004-06-281-2/+11
| | | | llvm-svn: 14468
* Do not move any values into registers for a void return (there isn't anything).Misha Brukman2004-06-251-20/+23
| | | | llvm-svn: 14413
* Fix opcode: no immediate in an `or r1, r2, r3' (all registers) instr.Misha Brukman2004-06-251-1/+1
| | | | llvm-svn: 14411
* Fix bug in previous checkin.Misha Brukman2004-06-251-1/+1
| | | | llvm-svn: 14405
* * Wrap long linesMisha Brukman2004-06-251-13/+27
| | | | | | | * Replace silent fall-through FIXME comments with an error to cerr and an abort * No need to set size of statically initialized arrays llvm-svn: 14404
* Excise X86-specific comments.Misha Brukman2004-06-251-10/+0
| | | | llvm-svn: 14403
* Add a `break' in the switch/case statement between the int/fp sections.Misha Brukman2004-06-241-1/+1
| | | | llvm-svn: 14385
* Unindent some more code to be consistent.Misha Brukman2004-06-241-59/+59
| | | | llvm-svn: 14377
* Unindent some code, it only needs 2 spaces.Misha Brukman2004-06-241-23/+23
| | | | llvm-svn: 14376
* In emitting code for a GEP instr, iterate over GEPTypes because there is oneMisha Brukman2004-06-241-1/+4
| | | | | | | more operand in GEPOps than there are types in GEPTypes: the pointer that is the first operand of the GEP instruction. llvm-svn: 14375
* * Make indentation consistent at 2 charsMisha Brukman2004-06-211-201/+312
| | | | | | | * Doxygenify function comments * Wrap code at 80 cols llvm-svn: 14295
* llvm/IntrinsicLowering.h => llvm/CodeGen/IntrinsicLowering.hMisha Brukman2004-06-211-1/+1
| | | | llvm-svn: 14292
* Intrinsic::isnan has gone away, support for it commented out.Misha Brukman2004-06-211-3/+7
| | | | | | | Intrinsic::isunordered has arrived, and we just use the standard lowering pass for it. llvm-svn: 14290
* Convert tabs to spaces.Misha Brukman2004-06-211-375/+375
| | | | llvm-svn: 14289
* Type::getPrimitiveID() -> getTypeID()Misha Brukman2004-06-211-4/+4
| | | | llvm-svn: 14288
* Initial revisionMisha Brukman2004-06-211-0/+2621
llvm-svn: 14283
OpenPOWER on IntegriCloud