1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
Commit Graph

311 Commits

Author SHA1 Message Date
Misha Brukman
bf93b04c17 * Correct 64-bit version: blr 1 (not 0)
* BuildMI() can build 0-param instructions (e.g., NOP)

llvm-svn: 15681
2004-08-12 03:30:03 +00:00
Misha Brukman
e281f3a2ac * Print out full names for non-GPR or -FPR registers
* BuildMI() really *does* handle 0 params!

llvm-svn: 15680
2004-08-12 03:28:47 +00:00
Misha Brukman
2851d39ec4 * Pointers are 8 bytes, hence cLong type on 64-bit PPC
* Fix loading of GlobalValues

llvm-svn: 15678
2004-08-12 02:53:01 +00:00
Misha Brukman
8bcb04dd35 Eliminate special-casing 14-bit immediate load/store opcodes
llvm-svn: 15677
2004-08-12 02:51:38 +00:00
Misha Brukman
1149a822a2 Correctly print out ASCII literal strings on AIX
llvm-svn: 15674
2004-08-12 01:01:13 +00:00
Misha Brukman
d9b3a360fc Mark R2 as available for allocation on Darwin/PPC32, but not AIX/PPC64
llvm-svn: 15673
2004-08-12 00:10:01 +00:00
Misha Brukman
14bf47d0d9 * Move AIX into the llvm namespace to be accessed from RegisterInfo
* Mark InstrInfo with 32 vs. 64 bit flag
* Enable the 64-bit isel and asm printer

llvm-svn: 15672
2004-08-11 23:47:08 +00:00
Misha Brukman
c24851b980 Set the is64bit flag and propagate it to PowerPCRegisterInfo
llvm-svn: 15671
2004-08-11 23:45:43 +00:00
Misha Brukman
42e53e4d94 * Set the is64bit boolean flag in PowerPCRegisterInfo
* Doubles are 8 bytes in 64-bit PowerPC, and use the general register class
* Use double-word loads and stores for restoring from/saving to stack
* Do not allocate R2 if compiling for AIX

llvm-svn: 15670
2004-08-11 23:44:55 +00:00
Misha Brukman
fc82624aab 64-bit instruction selector and AIX-specific 64-bit asm printer
llvm-svn: 15669
2004-08-11 23:42:15 +00:00
Misha Brukman
0b67e02e9c Fix names of 64-bit CMP*D* opcodes, add LWA and STD* opcodes
llvm-svn: 15668
2004-08-11 23:33:34 +00:00
Misha Brukman
08b8a09113 Add support for 64-bit CMPDI, CMPLDI, and CMPLD opcodes
llvm-svn: 15667
2004-08-11 20:56:14 +00:00
Misha Brukman
7325a6c790 Add doubleword load/store (64-bit only).
llvm-svn: 15665
2004-08-11 15:54:36 +00:00
Misha Brukman
1f4fb14301 Hyphenate ##-bit and remove first-person from comments.
llvm-svn: 15663
2004-08-11 13:35:44 +00:00
Nate Begeman
6120e8f04f Clean up 32/64bit and Darwin/AIX split. Next steps: 64 bit ISel, AIX asm printer.
llvm-svn: 15662
2004-08-11 07:40:04 +00:00
Chris Lattner
2903154b98 Fix a case where constantexprs could leak into the PPC isel.
llvm-svn: 15661
2004-08-11 07:34:50 +00:00
Nate Begeman
c07b78eaa2 Fix 255.vortex by using getClassB instead of getClass
llvm-svn: 15648
2004-08-11 03:30:55 +00:00
Misha Brukman
694c9ff1a6 Breaking up the PowerPC target into 32- and 64-bit subparts, Part III: the rest.
llvm-svn: 15636
2004-08-11 00:11:25 +00:00
Misha Brukman
47c87a8808 Breaking up the PowerPC target into 32- and 64-bit subparts: Part II: 64-bit.
llvm-svn: 15635
2004-08-11 00:10:41 +00:00
Misha Brukman
6713996576 Breaking up the PowerPC target into 32- and 64-bit subparts, Part I: 32-bit.
llvm-svn: 15634
2004-08-11 00:09:42 +00:00
Misha Brukman
3f79fbe93f Renamed PPC32 (namespace for regs, opcodes) to PPC to include 64-bit targets
llvm-svn: 15631
2004-08-10 22:47:03 +00:00
Misha Brukman
aa0e45b8d8 * Fix file header to use tablegen emacs mode instead of c++
* Wrap long line to 80 cols

llvm-svn: 15630
2004-08-10 21:24:44 +00:00
Nate Begeman
b74ee41754 Fix casts of float to unsigned long
Replace STDX (store 64 bit int indexed) with STFDX (store double indexed)
Fix latent bug in indexed load generation
Generate indexed loads and stores in many more cases

llvm-svn: 15626
2004-08-10 20:42:36 +00:00
Misha Brukman
861d6cdcb1 DForm 5/6 extended mneumonics take 3 arguments.
llvm-svn: 15620
2004-08-10 19:03:31 +00:00
Misha Brukman
fe7a08a933 Fix DForm_4: format is `op r, r, i'
llvm-svn: 15613
2004-08-10 18:07:55 +00:00
Misha Brukman
d345cd9090 Stub definition of the PowerPC CodeEmitter class; this isn't functional (yet).
llvm-svn: 15600
2004-08-09 23:03:59 +00:00
Misha Brukman
3da9167cc4 CodePrinter -> AsmPrinter
llvm-svn: 15599
2004-08-09 22:27:45 +00:00
Misha Brukman
65afbbca70 Remove ClassPrefix variable as it's no longer used.
llvm-svn: 15586
2004-08-09 19:13:29 +00:00
Misha Brukman
1547d8e8d0 Define a ClassPrefix for PowerPC.
llvm-svn: 15580
2004-08-09 17:46:26 +00:00
Misha Brukman
eb8758cc0c Generate a code emitter for PowerPC as well, this will be used in the JIT.
llvm-svn: 15578
2004-08-09 17:24:32 +00:00
Misha Brukman
ba013330a8 Use instruction formats as defined in the PowerPC ISA manual
llvm-svn: 15577
2004-08-09 17:24:04 +00:00
Reid Spencer
8bf21cd984 Fix stack size processing now that the return address isn't an implied
push onto the top of the stack like x86, which uses the local area
offset.  This will allow the removal of PowerPCPEI.cpp soon.

llvm-svn: 15573
2004-08-09 01:24:32 +00:00
Chris Lattner
bbf11b1e1d Changes commited for Nate Begeman:
Use a PowerPC specific prolog epilog inserter to control where spilled
callee save regs are placed on the stack.
Get rid of implicit return address stack slot, save return address reg
(LR) in appropriate slot
Improve code generated for functions that don't have calls or access
globals


Note from Chris: PowerPCPEI will eventually be eliminated, once the
functionality is merged into CodeGen/PrologEpilogInserter.cpp

llvm-svn: 15536
2004-08-06 06:58:50 +00:00
John Criswell
451362550e Added Louis Gerbarg. Louis is given credit in the CREDITS.TXT file, so I
assume Louis also holds copyright.

llvm-svn: 15534
2004-08-05 23:46:27 +00:00
John Criswell
45cf7f6a0f Add additional copyright notice for the PowerPC backend.
Thanks Nate!

llvm-svn: 15531
2004-08-05 20:36:00 +00:00
Misha Brukman
4a2823d1ae Simplify makefile by combining all TableGen dependencies into one variable
llvm-svn: 15527
2004-08-05 18:34:15 +00:00
Misha Brukman
3014727a37 Align dependencies so they don't hurt the eyes to look at them
llvm-svn: 15504
2004-08-04 21:37:41 +00:00
Misha Brukman
b296dd721c Remove unused instruction classes
llvm-svn: 15501
2004-08-04 21:18:57 +00:00
Misha Brukman
ef93ca23ba Make tablegen targets depend on PowerPCInstrFormats.td as well
llvm-svn: 15500
2004-08-04 21:18:36 +00:00
Chris Lattner
1ce22d3d43 getValues does not exist
llvm-svn: 15495
2004-08-04 17:29:14 +00:00
Misha Brukman
07f8b33325 Remove unused opcodes.
llvm-svn: 15447
2004-08-03 20:23:44 +00:00
Misha Brukman
10a585beaf * Use simpler instruction templates to define instructions
* Fix several extended opcodes

llvm-svn: 15423
2004-08-02 21:58:52 +00:00
Misha Brukman
e7ad7b2f2a Replace patterns 0, 4, and 5 with simpler heirarchical definitions that use the
official PowerPC instruction format lingo: X- and D-form.

llvm-svn: 15422
2004-08-02 21:56:35 +00:00
Misha Brukman
f2119a5b6f Separate instruction formats from instruction definitions.
llvm-svn: 15414
2004-08-02 16:54:54 +00:00
Misha Brukman
8209358fca * Conditional save/restore of LR disabled as it's not quite correct
* sumarray2d fixed: large fixed-size alloca
* make is now compileable
* Re-organized tests to fit them under proper headings

Patch by Nate Begeman.

llvm-svn: 15347
2004-07-30 15:53:09 +00:00
Misha Brukman
f0c6eaca10 Do not mark LR as callee-save: not quite correctly done. Patch: Nate Begeman.
llvm-svn: 15346
2004-07-30 15:51:51 +00:00
Misha Brukman
27ced926da * Temporarily suspend LR save/restore optimization as it is not quite correct
* Implement large fixed-size allocas            Entire patch by Nate Begeman.

llvm-svn: 15345
2004-07-30 15:50:45 +00:00
Chris Lattner
6bea23ff54 Minor corrections
llvm-svn: 15309
2004-07-28 20:18:53 +00:00
Misha Brukman
8e19054114 Add notes on bug involving casting ulong -> double, thanks to Nate Begeman.
llvm-svn: 15307
2004-07-28 19:16:10 +00:00
Misha Brukman
a8bcaec663 Simplify loading (un)signed constants to registers, patch by Nate Begeman.
llvm-svn: 15306
2004-07-28 19:13:49 +00:00
Misha Brukman
b699e3d825 Remove an extra 8 byte distance penalty. Patch by Nate Begeman.
llvm-svn: 15305
2004-07-28 19:13:07 +00:00
Misha Brukman
6e134ad499 Find longs by type, not by their primitive size being 64. Patch by Nate Begeman.
llvm-svn: 15304
2004-07-28 19:12:24 +00:00
Misha Brukman
8c293deaad LI can only take signed values, so values > 32767 can only be loaded with ORI
llvm-svn: 15299
2004-07-28 00:56:04 +00:00
Misha Brukman
ac63bc04f8 Reorganize tests to place them in proper directories.
llvm-svn: 15298
2004-07-28 00:55:12 +00:00
Misha Brukman
8fc18d7d1c UnitTests 2003-05-26-Shorts and 2003-07-09-LoadShorts have been fixed;
2003-05-22-VarSizeArray is broken.

llvm-svn: 15297
2004-07-28 00:01:41 +00:00
Misha Brukman
1b4bc02316 Fix printing of immediate operands by looking at their operand types in
the TargetInstrInfo.  This fixes UnitTests 2003-05-26-Shorts and
2003-07-09-LoadShorts.

llvm-svn: 15296
2004-07-28 00:00:48 +00:00
Misha Brukman
148ad01de1 Renamed files:
* PowerPCReg.td => PowerPCRegisterinfo.td
* PowerPCInstrs.td => PowerPCInstrInfo.td

llvm-svn: 15295
2004-07-27 23:29:16 +00:00
Misha Brukman
b779843f6b Branch selection support implemented by Nate Begeman for long branches.
llvm-svn: 15288
2004-07-27 18:43:04 +00:00
Misha Brukman
b07f569386 Correctly print out long branches, assert on finding pseudo instr COND_BRANCH
Patch by Nate Begeman.

llvm-svn: 15286
2004-07-27 18:40:39 +00:00
Misha Brukman
ef0cbd830c Run the branch selection pass right before the asm printer.
Patch by Nate Begeman.

llvm-svn: 15285
2004-07-27 18:39:34 +00:00
Misha Brukman
0f26a3309f Remove empty unused method processFunctionBeforeFrameFinalized()
llvm-svn: 15284
2004-07-27 18:38:40 +00:00
Misha Brukman
8c047d4fad Add COND_BRANCH pseudo instruction, patch by Nate Begeman.
llvm-svn: 15283
2004-07-27 18:35:54 +00:00
Misha Brukman
d7d501d518 Build COND_BRANCHes which may become long or short, decided by a later pass.
Patch by Nate Begeman.

llvm-svn: 15282
2004-07-27 18:35:23 +00:00
Misha Brukman
8e2f8de3c3 Moved definition of invertPPCBranchOpcode() into PowerPCInstrInfo class.
Patch by Nate Begeman.

llvm-svn: 15281
2004-07-27 18:34:11 +00:00
Misha Brukman
0fe1f5d880 Add PowerPCBranchSelector to discover which are `long' branches.
Contributed by Nate Begeman.

llvm-svn: 15280
2004-07-27 18:33:06 +00:00
Misha Brukman
c22bbdd36d Fixed saving/restoring LR unconditionally, only done as necessary.
llvm-svn: 15275
2004-07-27 17:17:48 +00:00
Misha Brukman
adb86dba29 Save and restore LR just like any other register and ONLY if we actually modify
it (due to calls or globals access).  We now compile `void empty(){}' to `blr'.

llvm-svn: 15274
2004-07-27 17:17:18 +00:00
Misha Brukman
6fec7336fe LR is a 32-bit int reg
llvm-svn: 15273
2004-07-27 17:15:32 +00:00
Misha Brukman
93b0ea58a2 MovePCtoLR (which is `bl' in disguise) modifies LR implicitly
llvm-svn: 15272
2004-07-27 17:15:05 +00:00
Misha Brukman
4be6841bc0 Register LR is callee-saved
llvm-svn: 15271
2004-07-27 17:14:34 +00:00
Misha Brukman
a3ac216fce Add IMPLICIT_DEF of LR for branch-and-link instrs (calls and global accesses)
llvm-svn: 15270
2004-07-27 17:13:58 +00:00
Misha Brukman
6272268028 Do not store the stack pointer if the stack size is 0.
Also, convert C-style comments to C++ and make sure code wraps at 80 cols.

llvm-svn: 15245
2004-07-26 22:00:26 +00:00
Misha Brukman
a979e8a08a ADDI can take several forms, including:
addi r1, r2, 0
  addi r1, <frame index #n>, 0

so we must check for the second parameter being a register for this instruction
to be considered a reg-to-reg copy.

llvm-svn: 15244
2004-07-26 21:50:38 +00:00
Misha Brukman
a2cf775362 assert() on MachineInstr properties instead of checking them dynamically
llvm-svn: 15243
2004-07-26 21:35:58 +00:00
Misha Brukman
73687cfcc6 * Recognize `addi r1, r2, 0' a move instruction
* List formats of instructions currently recognized as moves

llvm-svn: 15242
2004-07-26 21:29:00 +00:00
Misha Brukman
288289f9a7 * Rewrote casts
* Implemented GEP folding
* Dynamically output global address stuff once per function
* Fix casting fp<->short/byte

Patch contributed by Nate Begeman.

llvm-svn: 15237
2004-07-26 18:13:24 +00:00
Misha Brukman
bf2ad22ff6 Increment the label number in runOnFunction() rather than while printing out
some instruction.  Patch by Nate Begeman.

llvm-svn: 15236
2004-07-26 16:28:33 +00:00
Misha Brukman
796cc48f99 More notes on bugs, unimplemented features, and suggested code improvements.
Written by Nate Begeman.

llvm-svn: 15235
2004-07-26 16:23:55 +00:00
Misha Brukman
29efda2e6b Fix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.
llvm-svn: 15234
2004-07-26 16:22:52 +00:00
Misha Brukman
c1e23e1939 Running list of bugs, unimplemented features, currently broken tests, until we
have a nightly tester set up for PowerPC.

llvm-svn: 15147
2004-07-23 22:37:22 +00:00
Misha Brukman
c7291558eb Eliminate spurious empty space; make code easier to page through.
llvm-svn: 15146
2004-07-23 22:35:49 +00:00
Misha Brukman
eaac0bbed7 Simplify boolean test.
llvm-svn: 15145
2004-07-23 21:43:26 +00:00
Misha Brukman
a899694208 Implement casting a floating point to 32-bit unsigned value
llvm-svn: 15143
2004-07-23 20:32:59 +00:00
Misha Brukman
ef73e28236 * Codegen of GEPs dramatically improved by folding multiplies and adds
* Function pointers implemented correctly using appropriate stubs

Contributed by Nate Begeman.

llvm-svn: 15133
2004-07-23 16:08:20 +00:00
Misha Brukman
2ad2adf8cb Bool alignment on MacOSX/PowerPC is 4 bytes.
llvm-svn: 15122
2004-07-23 01:11:46 +00:00
Misha Brukman
3f338d98a6 * Change class of BoolTy back to cInt
* Fix indentation back to 2 spaces

llvm-svn: 15121
2004-07-23 01:11:19 +00:00
Misha Brukman
1109566c8d * Change bool from cInt to cByte (for now)
* 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
2004-07-22 15:58:04 +00:00
Misha Brukman
28e92a3fde * Add the lost fix to define the second reg of a 2-reg representation of longs
* Fix opcode RLWNM -> RLWINM since it uses an immediate const shift value

llvm-svn: 15087
2004-07-21 20:30:18 +00:00
Misha Brukman
9543849102 * Speed up canUseAsImmediateForOpcode() by comparing Operand before
dyn_cast<>ing and checking Constant's value
* Convert tabs to spaces

llvm-svn: 15086
2004-07-21 20:22:06 +00:00
Misha Brukman
7507403c2b * Fix printing of signed immediate values (Nate Begeman)
* Fix printing of `zeroinitializer'
* Fix printing of `linkonce' globals, complete with stubs

llvm-svn: 15084
2004-07-21 20:11:11 +00:00
Misha Brukman
64f203922d * Fix printing of signed immediate values
* 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
2004-07-21 20:09:08 +00:00
Misha Brukman
752584b520 Use addSImm() instead of addImm() for stack offsets, which may be negative.
llvm-svn: 15081
2004-07-21 19:36:57 +00:00
Misha Brukman
3d395cbda3 Add SUBI instruction
llvm-svn: 15077
2004-07-21 15:53:04 +00:00
Misha Brukman
3e3d141a92 Shorts are aligned to 2 bytes, bools to 1 byte (in structs).
llvm-svn: 15048
2004-07-20 20:59:57 +00:00
Misha Brukman
6283677946 Treat external variables similarly to those with weak linkage: load indirect.
llvm-svn: 15047
2004-07-20 20:43:05 +00:00
Misha Brukman
f47940855d Differentiate between global and weak symbol loads
llvm-svn: 15037
2004-07-20 15:52:25 +00:00
Misha Brukman
fe769110a0 * Differentiate between global and weak symbol loads
* 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
2004-07-20 15:51:37 +00:00
Misha Brukman
5b5aff390a Differentiate between global and weak symbol loads
llvm-svn: 15035
2004-07-20 15:45:27 +00:00
Misha Brukman
1942534307 Double alignment in structs is 4 bytes, not 8. Patch by Nate Begeman.
llvm-svn: 15034
2004-07-20 15:43:25 +00:00
Misha Brukman
0a12f91274 Fix stack frame layout in prologue/epilogue. Patch courtesy of Nate Begeman.
llvm-svn: 15026
2004-07-20 02:23:09 +00:00
Misha Brukman
6baf9045f6 Move handing of GlobalValues from getReg() to copyConstantToRegister(), this
will avoid extra register-to-register copies.  Thanks to Chris for the idea.

llvm-svn: 15019
2004-07-20 00:59:38 +00:00
Misha Brukman
bec77933fa * 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

All of Shootout tests now work.  Great thanks to Nate Begeman for the patch!

llvm-svn: 15015
2004-07-20 00:42:19 +00:00
Misha Brukman
fdc633a29b * cFP class split into cFP32 and cFP64
* 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
2004-07-20 00:41:46 +00:00
Chris Lattner
8eb32809bc Fix infinite loop
llvm-svn: 14971
2004-07-18 18:45:01 +00:00
Chris Lattner
c62e642a1a CPR Fixes
llvm-svn: 14961
2004-07-18 07:29:35 +00:00
Misha Brukman
c52cf4db44 We don't really need to #include IPO.h into this file.
llvm-svn: 14911
2004-07-17 18:37:46 +00:00
Misha Brukman
36bf6aa37c * Use LI(S) to copy constants into registers intead of ADDI(S) as the latter is
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
2004-07-16 21:06:24 +00:00
Misha Brukman
3a720bbeaa * Store all non-volatile int registers R13-31 on the stack, restore on exit
* Fix comment formatting

llvm-svn: 14900
2004-07-16 20:55:20 +00:00
Misha Brukman
2fd8a66d40 Fix code formatting
llvm-svn: 14899
2004-07-16 20:54:25 +00:00
Misha Brukman
d2ddc81a25 Implement PowerPCInstrInfo::isMoveInstr(), patch by Nate Begeman
llvm-svn: 14898
2004-07-16 20:51:55 +00:00
Misha Brukman
2bfd750278 Add prototype for TargetInstrInfo::isMoveInstr()
llvm-svn: 14897
2004-07-16 20:50:55 +00:00
Misha Brukman
468900296b * Enable allocation of registers r2-r10
* Allocate registers 13-31 backwards (to be able to store them all at once)

llvm-svn: 14896
2004-07-16 20:35:20 +00:00
Misha Brukman
f93e5532d5 Add IMPLICIT_DEFS pseudo-instruction; patch by: Nate Begeman
llvm-svn: 14895
2004-07-16 20:33:41 +00:00
Misha Brukman
4b944fcdf9 The generated instruction selector isn't (yet) functional
llvm-svn: 14894
2004-07-16 20:31:13 +00:00
Misha Brukman
c3c9dc04ac * Output non-lazy linking stubs for external global variables
* Get rid of dead and #if 0'd code
* Minor for loop speed-up: save end iterator instead of querying every time

llvm-svn: 14893
2004-07-16 20:29:04 +00:00
Misha Brukman
0d35548f37 Define double alignment as 8 bytes now that assert(DoubleAlignment == PointerSize)
has been eliminated

llvm-svn: 14891
2004-07-16 19:32:12 +00:00
Misha Brukman
0a92212542 * Add spaces between words and numbers in comments printed out for longs/floats
* Print out IMPLICIT_DEFS as comments in the assembly, patch by Nate Begeman

llvm-svn: 14890
2004-07-16 19:01:13 +00:00
Brian Gaeke
53dc31efcd Do IMPLICIT_DEFs on incoming args' hard regs, to avoid confusing the regalloc.
Support single-fp incoming args.
Support single-fp outgoing args ('call' operands).
Support double-fp return values.

llvm-svn: 14880
2004-07-16 10:31:25 +00:00
Chris Lattner
60fb3d60a8 The powerpc is now gone. However it is now just known as the Skeleton target.
llvm-svn: 14877
2004-07-16 07:14:34 +00:00
Chris Lattner
b9ec0b791c Revert stuff that I didn't mean to checkin
llvm-svn: 14844
2004-07-15 02:33:38 +00:00
Chris Lattner
c4888ccda7 Patches towards fixing PR341
llvm-svn: 14841
2004-07-15 02:14:30 +00:00
Misha Brukman
d6a9646f29 Make sure MTSPR instruction is inserted into the BasicBlock
llvm-svn: 14822
2004-07-14 18:26:31 +00:00
Misha Brukman
0f42826f30 Don't define the same register twice when loading a ConstantPointerRef to a reg
llvm-svn: 14819
2004-07-14 17:57:04 +00:00
Misha Brukman
73d729838f * Fix multiplication by powers of two and otherwise
* Clarify variable name (StoreInst SI instead of LI)

llvm-svn: 14818
2004-07-14 15:29:51 +00:00
Misha Brukman
79b089abff * Specify that FP arith options have 3 operands
* Correctly load FP constants from the constant pool, should be refactored

llvm-svn: 14799
2004-07-13 15:35:45 +00:00
Misha Brukman
449715a57d Correctly load FP constants out of the constant pool.
llvm-svn: 14782
2004-07-12 23:49:47 +00:00
Misha Brukman
b7f3d7b04b Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC
llvm-svn: 14780
2004-07-12 23:36:12 +00:00
Chris Lattner
773f2d65c2 Delete the allocate*TargetMachine function, which is now dead.
The shared command line options are now in a header that makes sense.

llvm-svn: 14757
2004-07-11 04:17:58 +00:00
Chris Lattner
6331eb6bbe Delete the allocate*TargetMachine function, which is now dead .
The shared command line options are now in a header that makes sense.

llvm-svn: 14756
2004-07-11 04:17:10 +00:00
Chris Lattner
b67e3b01bc Make these format a bit nicer
llvm-svn: 14747
2004-07-11 03:27:42 +00:00
Chris Lattner
2ada866a78 Auto-registrate target
llvm-svn: 14745
2004-07-11 02:48:49 +00:00
Chris Lattner
164659f141 Add compilability
llvm-svn: 14744
2004-07-11 02:48:28 +00:00
Misha Brukman
f8f753f04b * Add support for indexing into structures, thanks to Chris (x86)
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
2004-07-09 15:45:07 +00:00
Misha Brukman
1881beb0b3 Read/write the offset value for stack-relative loads via correct instr operand.
llvm-svn: 14722
2004-07-09 15:37:16 +00:00
Misha Brukman
b83ace891d Add support for __fixdfdi(), __floatdisf(), and __floatdidf() external functions
llvm-svn: 14703
2004-07-08 19:41:16 +00:00
Misha Brukman
db4cddea8d * Use several Function* for external functions instead of a std::map
* Non-const FP values must be loaded into int regs (for vararg fns) via memory

llvm-svn: 14701
2004-07-08 18:27:59 +00:00
Misha Brukman
869f2b7219 * Add support for loading FP constants from the constant pool
* Load FP values into int regs as well for vararg functions; without memory ops!

llvm-svn: 14700
2004-07-08 18:02:38 +00:00
Misha Brukman
3bbd3cd1de * Fix header comment, excise references to X86
* Add suport for printing out references to constant pool indices

llvm-svn: 14699
2004-07-08 17:58:04 +00:00
Misha Brukman
93b47cc963 * Use a map for caching lookups to external functions (fp div/rem)
* Tabs to spaces

llvm-svn: 14673
2004-07-07 20:07:22 +00:00
Misha Brukman
f2473e6267 * Wrap long lines (comments and code)
* Tabs to spaces

llvm-svn: 14672
2004-07-07 20:01:36 +00:00
Misha Brukman
d5a439760c Add fmod() to the Module being compiled so that it gets a stub in the asm file
llvm-svn: 14670
2004-07-07 15:36:18 +00:00
Misha Brukman
ef78244e72 * Add support for calling vararg functions (must pass doubles in int regs too)
* 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
2004-07-06 22:51:53 +00:00
Misha Brukman
4543cea6ae Use the more compact bl' instead of cryptic (but equivalent) bcl 20,31'
llvm-svn: 14652
2004-07-06 22:40:34 +00:00
Misha Brukman
0b6de12a84 * Add utility functions: convert SetCC => PPC opcode and invert PPC opcode
* 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
2004-07-06 15:32:44 +00:00
Misha Brukman
607dd868a8 Add FIXME notes for spilling int/fp regs (need to calculate stack space).
llvm-svn: 14581
2004-07-02 17:54:38 +00:00
Chris Lattner
a99a36881f Fix all of those problems that the PPC backend has running 176.gcc :)
llvm-svn: 14565
2004-07-02 05:48:42 +00:00
Misha Brukman
c9ecaeb69d * Follow the PowerPC convention of leaving 24 bytes for linking on the stack.
* Also leave space for spilling integer registers (this should be calculated)

llvm-svn: 14554
2004-07-01 21:35:00 +00:00
Misha Brukman
f5deab6100 * Get rid of constant-expr handling code: we use the ConstantExpr lowering pass
* 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
2004-07-01 21:34:10 +00:00
Misha Brukman
1546c2e9c0 Wrap long line
llvm-svn: 14552
2004-07-01 21:27:59 +00:00
Misha Brukman
e409874a9f * Do not allocate r0 as we use it indiscriminantly in the instr selector.
* Do not define CR register class because we don't (yet) have the i4 type

llvm-svn: 14551
2004-07-01 21:24:50 +00:00