Commit Graph

2250 Commits

Author SHA1 Message Date
Misha Brukman 5098bd5499 Correctly print out ASCII literal strings on AIX
llvm-svn: 15674
2004-08-12 01:01:13 +00:00
Misha Brukman 345399b06e 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 c94c0f75f4 * 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 aea37d65c8 Set the is64bit flag and propagate it to PowerPCRegisterInfo
llvm-svn: 15671
2004-08-11 23:45:43 +00:00
Misha Brukman 39f7533b40 * 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 c2a043488a 64-bit instruction selector and AIX-specific 64-bit asm printer
llvm-svn: 15669
2004-08-11 23:42:15 +00:00
Misha Brukman d7344dc9bd 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 78c1dcfc3e Add support for 64-bit CMPDI, CMPLDI, and CMPLD opcodes
llvm-svn: 15667
2004-08-11 20:56:14 +00:00
Misha Brukman 28beda9ba4 Add doubleword load/store (64-bit only).
llvm-svn: 15665
2004-08-11 15:54:36 +00:00
Misha Brukman 7224ee1e4c Hyphenate ##-bit and remove first-person from comments.
llvm-svn: 15663
2004-08-11 13:35:44 +00:00
Nate Begeman f17ea0f7b7 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 6f0291792e Fix a case where constantexprs could leak into the PPC isel.
llvm-svn: 15661
2004-08-11 07:34:50 +00:00
Chris Lattner eb34c59930 Remove a bunch of ad-hoc target-specific flags that were only used by the
old asmprinter.

llvm-svn: 15660
2004-08-11 07:12:04 +00:00
Chris Lattner 085663c4ec Remove a dead method
llvm-svn: 15659
2004-08-11 07:07:14 +00:00
Chris Lattner d1bee6ee12 Finally, the entire instruction asmprinter is now generated from tblgen, woo!
llvm-svn: 15658
2004-08-11 07:02:04 +00:00
Chris Lattner a0bafce127 Add asmprintergen support for the last X86 instruction that needs it: pcrelative calls.
llvm-svn: 15657
2004-08-11 06:59:12 +00:00
Chris Lattner 5edeb20bbb This file is long dead
llvm-svn: 15656
2004-08-11 06:55:12 +00:00
Chris Lattner 5f4b65e57d Scrunch memoperands, add a few more for floating point memops
Eliminate the FPI*m classes, converting them to use FPI instead.

llvm-svn: 15655
2004-08-11 06:50:10 +00:00
Chris Lattner b975636f71 Move hacks up
llvm-svn: 15654
2004-08-11 06:09:55 +00:00
Chris Lattner 6dd0474edd Make FPI take asm string and operand list
llvm-svn: 15653
2004-08-11 05:54:16 +00:00
Chris Lattner c52899c3c7 Nuke the Im*i* patterns, by asmprintergenifying all users.
llvm-svn: 15652
2004-08-11 05:31:07 +00:00
Chris Lattner f5c767038a X86 instructions that read-modify-write memory are not LLVM two-address instructions.
llvm-svn: 15651
2004-08-11 05:07:25 +00:00
Chris Lattner 0d7bc2c5da Get rid of the Im8, Im16, Im32 classes, converting more instructions over to
asmprintergeneration

llvm-svn: 15650
2004-08-11 04:31:00 +00:00
Nate Begeman 7526da6ead Fix 255.vortex by using getClassB instead of getClass
llvm-svn: 15648
2004-08-11 03:30:55 +00:00
Chris Lattner 4dfadc05e6 Remove dead method
llvm-svn: 15647
2004-08-11 02:26:39 +00:00
Chris Lattner 09ee05bcdf Convert asmprinter to new style of instruction printer
Start asmprintergen'ifying machine instrs with memory operands.

llvm-svn: 15646
2004-08-11 02:25:00 +00:00
Chris Lattner 6bd2d26b56 Fill out immediate operand classes, add a new Operand class
llvm-svn: 15642
2004-08-11 01:53:34 +00:00
Misha Brukman e67a212267 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 284086aa4a 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 d022a5ac5a 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 3decf86fb7 Implement new constructor.
llvm-svn: 15633
2004-08-10 23:10:25 +00:00
Misha Brukman dad438bfb9 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 0b9444e536 * 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
Chris Lattner ce5fb7db1c This is purely a formatting patch that gets us closer to the mecca of fitting
X86InstrInfo.td into 80 columns

llvm-svn: 15629
2004-08-10 21:21:30 +00:00
Chris Lattner 116fc25d79 Drop the first argument of FPI, and asmprinterify fxch
llvm-svn: 15628
2004-08-10 21:02:13 +00:00
Nate Begeman 63be70d8f2 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 1401c28e35 Fix file header comment: update filename, set tablegen emacs mode.
llvm-svn: 15625
2004-08-10 20:28:13 +00:00
Chris Lattner ead14c1a07 This purely mechanical patch gives the "I" tblgen class operand list and asm
string operands, and adjusts all users to pass them in instead of using II.

llvm-svn: 15624
2004-08-10 20:17:41 +00:00
Chris Lattner c4eb5951d5 Convert Ii32 instructions over to use the asmprinter generator
llvm-svn: 15621
2004-08-10 19:06:36 +00:00
Misha Brukman c6b114f258 DForm 5/6 extended mneumonics take 3 arguments.
llvm-svn: 15620
2004-08-10 19:03:31 +00:00
Misha Brukman dc541abcd0 * Instruction definitions moved to SparcV9InstrInfo.td for consistency
* Defined PHI instruction and SparcV9 subclass of Target

llvm-svn: 15615
2004-08-10 18:15:31 +00:00
Misha Brukman 591d47113f Renamed SparcV9_Reg.td -> SparcV9RegisterInfo.td for consistency.
llvm-svn: 15614
2004-08-10 18:14:04 +00:00
Misha Brukman 09d87b4939 Fix DForm_4: format is `op r, r, i'
llvm-svn: 15613
2004-08-10 18:07:55 +00:00
Misha Brukman 17913b3f23 Fix comment header, specify type of file `tablegen'.
llvm-svn: 15612
2004-08-10 17:37:14 +00:00
Chris Lattner 9f49a91b44 Convert the Ii16 instructions over
llvm-svn: 15606
2004-08-10 16:22:02 +00:00
Chris Lattner 4d66b78036 Convert all Ii8 instructions over to the autogenerated asmprinter.
llvm-svn: 15605
2004-08-10 16:09:54 +00:00
Misha Brukman 8fbdc9fc4f Define the target name so we can use it via TableGen.
llvm-svn: 15604
2004-08-10 15:29:15 +00:00
Chris Lattner 1d787355e7 Paper over CBackend/2004-08-09-va-end-null.ll
Note that this indicates a serious problem with the way we are emitting varargs,
but this should not be properly fixed until after 1.3.

This patch SHOULD go into 1.3.

llvm-svn: 15602
2004-08-10 00:19:16 +00:00
Misha Brukman 189229151f 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 eca36a5aa0 CodePrinter -> AsmPrinter
llvm-svn: 15599
2004-08-09 22:27:45 +00:00
Misha Brukman 8f951e579b Remove ClassPrefix variable as it's no longer used.
llvm-svn: 15586
2004-08-09 19:13:29 +00:00
Misha Brukman 0eb9cee698 The (future) SparcV8 JIT would do well to have a class prefix.
llvm-svn: 15583
2004-08-09 18:13:09 +00:00
Misha Brukman 11bbbb9cdd Define the ClassPrefix for SparcV9.
llvm-svn: 15581
2004-08-09 17:46:49 +00:00
Misha Brukman d210ed1855 Define a ClassPrefix for PowerPC.
llvm-svn: 15580
2004-08-09 17:46:26 +00:00
Misha Brukman 8f7272c249 Classes need to have a prefix name, so that they can be tacked on to the pieces
that TableGen creates for them, e.g. CodeEmitter, AsmPrinter, etc.

llvm-svn: 15579
2004-08-09 17:46:06 +00:00
Misha Brukman b3401c4c50 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 5295e1db10 Use instruction formats as defined in the PowerPC ISA manual
llvm-svn: 15577
2004-08-09 17:24:04 +00:00
Reid Spencer 42817b7ea1 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
Brian Gaeke 8d38dee7b4 dumpSavedState has outlived its usefulness.
llvm-svn: 15555
2004-08-06 19:11:43 +00:00
Chris Lattner a8dcf2423e 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
Brian Gaeke a1a0643e38 Update the To-Do list according to my notes + assertions
llvm-svn: 15535
2004-08-06 04:38:13 +00:00
John Criswell 2fc39a9c2f 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 e7ccf6445e Add additional copyright notice for the PowerPC backend.
Thanks Nate!

llvm-svn: 15531
2004-08-05 20:36:00 +00:00
Misha Brukman 7d41ed5271 Simplify makefile by combining all TableGen dependencies into one variable
llvm-svn: 15527
2004-08-05 18:34:15 +00:00
Misha Brukman 1d1d1c4676 PowerPC is a real target now.
llvm-svn: 15522
2004-08-05 18:22:30 +00:00
Misha Brukman 283042bed3 Hand-propagate the constant TARGET_NAME which was making lines wrap anyway
llvm-svn: 15506
2004-08-04 21:48:45 +00:00
Misha Brukman b2b9686b3a * Remove unnecessary comment
* Fix alignment of code
* Tabs to spaces

llvm-svn: 15505
2004-08-04 21:48:00 +00:00
Misha Brukman 2068654d68 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 cdd72aaa1f Remove unused instruction classes
llvm-svn: 15501
2004-08-04 21:18:57 +00:00
Misha Brukman f74157ab15 Make tablegen targets depend on PowerPCInstrFormats.td as well
llvm-svn: 15500
2004-08-04 21:18:36 +00:00
Chris Lattner 08c58e63d9 getValues does not exist
llvm-svn: 15495
2004-08-04 17:29:14 +00:00
Chris Lattner 50c6df4ba0 getValues is gone
llvm-svn: 15494
2004-08-04 17:27:27 +00:00
Alkis Evlogimenos 832437255d Stop using getValues().
llvm-svn: 15487
2004-08-04 08:44:43 +00:00
Brian Gaeke ef57e5b91a Get rid of the only use of TargetInstrInfo::getResultPos(), a deprecated method.
llvm-svn: 15483
2004-08-04 08:05:27 +00:00
Brian Gaeke def3b458b0 Include SparcV9BurgISel.h, to pick up the definition of
createSparcV9BurgInstSelector().

llvm-svn: 15474
2004-08-04 07:30:04 +00:00
Brian Gaeke 813d9f5023 Include SparcV9TmpInstr.h instead of llvm/CodeGen/InstrSelection.h, to pick
up the definition of class TmpInstruction.

llvm-svn: 15473
2004-08-04 07:29:53 +00:00
Brian Gaeke 4b621da631 Include SparcV9BurgISel.h, because PreSelection uses routines from within
the SparcV9 BURG instruction selector.  Eww!

llvm-svn: 15472
2004-08-04 07:29:40 +00:00
Brian Gaeke 908df3299f Add a Doxygen comment, and inline the constructor (which is now almost empty).
llvm-svn: 15471
2004-08-04 07:29:28 +00:00
Brian Gaeke 16f092fe93 The InstrForest data type has moved from llvm/CodeGen/InstrForest.h
to SparcV9InstrForest.h.

llvm-svn: 15470
2004-08-04 07:29:16 +00:00
Brian Gaeke b3e3c539a4 Add a new file containing just TmpInstruction and its implementation.
Many other pieces of the SparcV9 backend want to use TmpInstruction, but
don't need any other instruction selector baggage.

llvm-svn: 15469
2004-08-04 07:29:04 +00:00
Brian Gaeke 61dd48425f All the SparcV9 BURG instruction selector pieces have been collected into the
new file SparcV9BurgISel.cpp, with exposed interfaces in SparcV9BurgISel.h.
The InstrSelection directory is now dead.

llvm-svn: 15468
2004-08-04 07:28:51 +00:00
Misha Brukman 8a1978fd72 Remove unused opcodes.
llvm-svn: 15447
2004-08-03 20:23:44 +00:00
Chris Lattner 9e92b19182 Move this file out of the top-level docs directory
llvm-svn: 15429
2004-08-03 04:15:02 +00:00
Misha Brukman 570dcf63e6 * Use simpler instruction templates to define instructions
* Fix several extended opcodes

llvm-svn: 15423
2004-08-02 21:58:52 +00:00
Misha Brukman 6b21bde2d6 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 cd4f51b4b6 Separate instruction formats from instruction definitions.
llvm-svn: 15414
2004-08-02 16:54:54 +00:00
Chris Lattner 4d7af1c680 Fix a warning
llvm-svn: 15409
2004-08-01 19:31:30 +00:00
Chris Lattner 2b47c02b64 Convert all I<> instructions to asmformat.
Delete the 'name' field of all instructions that have asmformats.

llvm-svn: 15403
2004-08-01 09:52:59 +00:00
Chris Lattner 1cabced74b Add some immediate forms, make name optional
llvm-svn: 15401
2004-08-01 09:36:44 +00:00
Chris Lattner 27fcf976f2 Eliminate 3 of the X86 printImplicit* flags.
llvm-svn: 15398
2004-08-01 08:23:17 +00:00
Chris Lattner e42675f5af Get rid of 3 of the 4 'printimplicit' flags. Implicit operands are now
explicitly listed in the asm string.

llvm-svn: 15397
2004-08-01 08:22:29 +00:00
Chris Lattner f6bd77190e Convert more instructions over to the asmprinter
llvm-svn: 15396
2004-08-01 08:13:11 +00:00
Chris Lattner 06cf67ee14 Handle registers a bit more efficiently
llvm-svn: 15395
2004-08-01 08:12:41 +00:00
Chris Lattner ba52a58836 give FP stack registers names
llvm-svn: 15394
2004-08-01 08:12:13 +00:00
Chris Lattner 275d98dcbb Switch more instructions over to using the asmprinter. Fix bugs in the emission
of in/out instructions (missing %'s on registers).

llvm-svn: 15393
2004-08-01 07:44:35 +00:00
Chris Lattner d5540021fc The tblgen'erated asmparser wants a way to print operands.
llvm-svn: 15392
2004-08-01 07:43:46 +00:00
Chris Lattner 9520d20c83 Rename the Printer class -> X86AsmPrinter.
Include the tablegenerated assembly writer.

llvm-svn: 15389
2004-08-01 06:02:08 +00:00
Chris Lattner 1d21ea7f1f Factor a bunch of the rules and add support for generating the asmwriter.
llvm-svn: 15388
2004-08-01 06:01:32 +00:00
Chris Lattner 321763358b Specify an asm string and operands lists for a bunch of instructions.
This only really covers no-operand instructions so far.

llvm-svn: 15387
2004-08-01 06:01:00 +00:00
Chris Lattner fd6893837c Add the 'ops' marker, add an AsmString initializer
llvm-svn: 15383
2004-08-01 04:40:43 +00:00
Chris Lattner 6971be8159 Completely disable the pattern isel until it is more substantial.
llvm-svn: 15380
2004-08-01 03:28:02 +00:00
Chris Lattner 70d2260eb9 Entirely eliminate all patterns and expanders from this file. We shall go
with an incremental approach rather than a revolutionary approach.

llvm-svn: 15379
2004-08-01 03:25:01 +00:00
Chris Lattner fc24e838a6 Move the 'Expander' node to later in the file, with the other experimental
stuff.  The pattern becomes a list, add some stuff, add some comments.

llvm-svn: 15378
2004-08-01 03:23:34 +00:00
Chris Lattner 06bfc0d930 Remove obsolete file
llvm-svn: 15377
2004-08-01 03:19:28 +00:00
Alkis Evlogimenos bb635a27a4 Align breaks.
llvm-svn: 15371
2004-07-31 10:05:44 +00:00
Chris Lattner fcef7655fa Add breaks
llvm-svn: 15365
2004-07-31 09:53:31 +00:00
Alkis Evlogimenos ce15f8f4c9 Simplify code a bit.
llvm-svn: 15364
2004-07-31 09:44:32 +00:00
Alkis Evlogimenos aaf642103a Correctly spell 'unconditional'.
llvm-svn: 15363
2004-07-31 09:41:44 +00:00
Alkis Evlogimenos f57d78a87d Implement insertGoto and reverseBranchCondition for the X86.
llvm-svn: 15362
2004-07-31 09:38:47 +00:00
Chris Lattner 4504b95801 I'm pretty sure that ba is branch always, which is a barrier. Brg should
check this :)

llvm-svn: 15357
2004-07-31 02:24:37 +00:00
Chris Lattner 66a13e230d Mark barrier instructions. Execution does not fall through uncond branches
or return intructions.

llvm-svn: 15356
2004-07-31 02:10:53 +00:00
Chris Lattner 2ab1142138 New flag
llvm-svn: 15354
2004-07-31 02:07:07 +00:00
Misha Brukman 695d50d030 * 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 c102577ff1 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 471b43a357 * 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 66a64fb997 Fix #includes of i*.h => Instructions.h as per PR403:
http://llvm.cs.uiuc.edu/PR403 .

llvm-svn: 15331
2004-07-29 17:11:37 +00:00
Brian Gaeke 690bdefb5f Get rid of a few dead method declarations.
llvm-svn: 15323
2004-07-29 06:43:10 +00:00
Brian Gaeke d7b36632af Get rid of calls to void llvm::printSet(const ValueSet &).
llvm-svn: 15322
2004-07-29 06:43:09 +00:00
Brian Gaeke 8f8a2ed0b3 Get rid of calls to void llvm::printSet(const ValueSet &).
Use LiveRange's iterator types and operations instead of ValueSet's.

llvm-svn: 15321
2004-07-29 06:43:08 +00:00
Brian Gaeke 3073fe3cee Don't derive from ValueSet to implement class LiveRange; instead, use a
SetVector<Value *> data member.
Add << operator for LiveRanges (a dumb one, for now.)

llvm-svn: 15320
2004-07-29 06:43:06 +00:00
Brian Gaeke 818b3631f3 Fix a few typoes and grammaroes in comments.
llvm-svn: 15319
2004-07-29 04:25:43 +00:00
Brian Gaeke 3cf8d5b0a2 Remove mustSaveAcrossCalls flag, which isn't ever read, and its mutator,
markForSaveAcrossCalls.

llvm-svn: 15317
2004-07-29 04:15:36 +00:00
Chris Lattner 07fad1cdee Minor corrections
llvm-svn: 15309
2004-07-28 20:18:53 +00:00
Misha Brukman 7f01b2539b 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 862bb562cc Simplify loading (un)signed constants to registers, patch by Nate Begeman.
llvm-svn: 15306
2004-07-28 19:13:49 +00:00
Misha Brukman db13b6edba Remove an extra 8 byte distance penalty. Patch by Nate Begeman.
llvm-svn: 15305
2004-07-28 19:13:07 +00:00
Misha Brukman ca5880025d 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 f7037385e2 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 bd1d7dceb7 Reorganize tests to place them in proper directories.
llvm-svn: 15298
2004-07-28 00:55:12 +00:00
Misha Brukman 04dee3bb66 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 47d5a22f8b 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 92ca8eccd8 Renamed files:
* PowerPCReg.td => PowerPCRegisterinfo.td
* PowerPCInstrs.td => PowerPCInstrInfo.td

llvm-svn: 15295
2004-07-27 23:29:16 +00:00
Brian Gaeke fa8ab0ab6d ConstantTypeMustBeLoaded has been incorporated into SparcV9PreSelection, its
only user.

llvm-svn: 15294
2004-07-27 21:43:38 +00:00
Brian Gaeke 28f75c2140 This was the only user of TargetInstrInfo::ConstantTypeMustBeLoaded().
llvm-svn: 15293
2004-07-27 21:11:20 +00:00
Brian Gaeke c3259f6413 Get rid of the (apparently non-working) filePrinterEmitter which is added in
debug mode.  Its only effect seems to be the creation of an empty file...

llvm-svn: 15289
2004-07-27 19:37:37 +00:00
Misha Brukman 2ffb787446 Branch selection support implemented by Nate Begeman for long branches.
llvm-svn: 15288
2004-07-27 18:43:04 +00:00
Misha Brukman a594740016 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 09396bf158 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 4d66925aea Remove empty unused method processFunctionBeforeFrameFinalized()
llvm-svn: 15284
2004-07-27 18:38:40 +00:00
Misha Brukman 83df71af70 Add COND_BRANCH pseudo instruction, patch by Nate Begeman.
llvm-svn: 15283
2004-07-27 18:35:54 +00:00
Misha Brukman 5b092c15c6 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 a783ee55a9 Moved definition of invertPPCBranchOpcode() into PowerPCInstrInfo class.
Patch by Nate Begeman.

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

llvm-svn: 15280
2004-07-27 18:33:06 +00:00
Brian Gaeke f4c1d1ee34 TargetInstrInfo::getNOPOpCode() has been replaced by a reference to V9::NOP.
llvm-svn: 15279
2004-07-27 17:43:24 +00:00
Brian Gaeke 64f51df06d Convert many of the virtual TargetInstrInfo methods used as helper
functions in SparcV9InstrSelection and SparcV9PreSelection into regular
old global functions.  As it happens, none of them really have anything
to do with TargetInstrInfo.

llvm-svn: 15278
2004-07-27 17:43:23 +00:00
Brian Gaeke b788626dc8 As it happens, none of these TargetInstrInfo methods which are only
used in the SparcV9 backend really have anything to do with
TargetInstrInfo, so we're converting them into regular old global
functions and moving their declarations to SparcV9InstrSelectionSupport.h.
(They're mostly used as helper functions for SparcV9InstrSelection.)

llvm-svn: 15277
2004-07-27 17:43:22 +00:00
Misha Brukman 9eaa879f49 Fixed saving/restoring LR unconditionally, only done as necessary.
llvm-svn: 15275
2004-07-27 17:17:48 +00:00
Misha Brukman bc1a2f96a6 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 26978c3730 LR is a 32-bit int reg
llvm-svn: 15273
2004-07-27 17:15:32 +00:00
Misha Brukman f1a7e941fb MovePCtoLR (which is `bl' in disguise) modifies LR implicitly
llvm-svn: 15272
2004-07-27 17:15:05 +00:00
Misha Brukman 2bcffa484b Register LR is callee-saved
llvm-svn: 15271
2004-07-27 17:14:34 +00:00
Misha Brukman 640ec1e5e6 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 b5ed14486b 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 58499ead7d 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 6c125a92d7 assert() on MachineInstr properties instead of checking them dynamically
llvm-svn: 15243
2004-07-26 21:35:58 +00:00
Misha Brukman 43f1c4045a * 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 a332a646a0 Fix indentation: should be 2 spaces.
llvm-svn: 15240
2004-07-26 18:48:58 +00:00
Misha Brukman cf7d3af07f Fix file header as it has been renamed.
llvm-svn: 15239
2004-07-26 18:45:48 +00:00
Misha Brukman bca562404c Renamed files to have the `X86' prefix for uniqueness purposes.
All CVS history was renamed, the *,v were copied over.  No worries.

llvm-svn: 15238
2004-07-26 18:43:11 +00:00
Misha Brukman 74e3a17958 * 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 ed664f91a4 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 d815472ebd 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 40f07ec771 Fix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.
llvm-svn: 15234
2004-07-26 16:22:52 +00:00
Chris Lattner 21a015c12f Temporarily disable this code, as it is emitting LLVM_NAN("nan") which results in a call to the
glibc 'nan' function because the initializer is not a string.  This breaks when used in a global
initializer.  Try compiling this testcase for example:

%X = global float <some nan value>

llvm-svn: 15223
2004-07-25 22:36:35 +00:00
Chris Lattner 51ebdec5c0 I think that V8 should coallesce registers, don't you?
llvm-svn: 15192
2004-07-25 06:19:04 +00:00
Misha Brukman 8930d4f24e 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 c150bdb52e Eliminate spurious empty space; make code easier to page through.
llvm-svn: 15146
2004-07-23 22:35:49 +00:00
Misha Brukman 66c816a6a3 Simplify boolean test.
llvm-svn: 15145
2004-07-23 21:43:26 +00:00
Misha Brukman 26a04b79cb Implement casting a floating point to 32-bit unsigned value
llvm-svn: 15143
2004-07-23 20:32:59 +00:00
Misha Brukman 7dba17d1ce * 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 4fb48609dc Bool alignment on MacOSX/PowerPC is 4 bytes.
llvm-svn: 15122
2004-07-23 01:11:46 +00:00
Misha Brukman db72025d1d * 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 3faa865508 * Add BoolAlignment to TargetData, default is 1 byte, size 1 byte
* Convert tabs to spaces

llvm-svn: 15120
2004-07-23 01:09:52 +00:00
Chris Lattner 8d06c43f01 Remove some (LARGE) abandoned code for the release. If this is ever needed
again in the future, it can be resurrected out of CVS

llvm-svn: 15112
2004-07-22 21:30:35 +00:00
Misha Brukman 333f58836c * 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
Chris Lattner fac8452acf Fix cases where we generated horrible code like this:
mov %EDI, 12
        add %EDI, %ECX
        mov %ECX, 12
        add %ECX, %EDX
        mov %EDX, 12
        add %EDX, %ESI

instead (really!) generate this:

        add %ECX, 12
        add %EDX, 12
        add %ESI, 12

llvm-svn: 15090
2004-07-21 21:28:26 +00:00
Misha Brukman dbd14bc3e5 * 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 87e07f8596 * 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 8d75aa4475 * 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 072af37088 * 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 455622577a 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 984bfdc702 Add SUBI instruction
llvm-svn: 15077
2004-07-21 15:53:04 +00:00
Brian Gaeke 1dde3fa94f Emit NaNs and INFs bit-identically to the bytecode file, if the system has
printf("%a") support.
Patch contributed by Bill Wendling.

llvm-svn: 15056
2004-07-21 03:15:26 +00:00
Misha Brukman 75f3291ef3 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 8e36261aa8 Treat external variables similarly to those with weak linkage: load indirect.
llvm-svn: 15047
2004-07-20 20:43:05 +00:00
Misha Brukman 4aab086eda Differentiate between global and weak symbol loads
llvm-svn: 15037
2004-07-20 15:52:25 +00:00
Misha Brukman 684ef6ca20 * 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 42666aed5e Differentiate between global and weak symbol loads
llvm-svn: 15035
2004-07-20 15:45:27 +00:00
Misha Brukman dff882a230 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 e036ff8b32 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 5e744fa1a3 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 22802cc6cd * 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 818a9dc317 * 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 f8cf35855a While I'm at it, don't break codegen of mul by 3,5,9.
llvm-svn: 15013
2004-07-19 23:50:57 +00:00
Chris Lattner 7c06d44f42 Generate better code for multiplies by negative constants like -4, -1, -9, etc.
llvm-svn: 15012
2004-07-19 23:47:21 +00:00
Reid Spencer 82e7fe5b5b bug 122:
Simplify a conditional operator for a constant result from
GV->isNullValue()

llvm-svn: 15001
2004-07-19 13:25:02 +00:00
Chris Lattner 57ca7382d9 Inline 4 methods
llvm-svn: 15000
2004-07-19 07:52:35 +00:00
Chris Lattner 6bdfbaf80d Fix infinite loop
llvm-svn: 14971
2004-07-18 18:45:01 +00:00
Chris Lattner aba6c47900 CPR Fixes
llvm-svn: 14961
2004-07-18 07:29:35 +00:00
Chris Lattner 9ce34cb323 CPR fixes
llvm-svn: 14960
2004-07-18 07:26:17 +00:00
Reid Spencer cb3fb5d4f5 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage

llvm-svn: 14953
2004-07-18 00:44:37 +00:00
Reid Spencer 874368790f bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14950
2004-07-18 00:38:32 +00:00
Reid Spencer 3074d3cfe7 bug 122:
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14949
2004-07-18 00:37:35 +00:00
Chris Lattner c856e90d1d Make sure to emit the immediate byte for instructions like:
shrd [mem], reg, imm

This fixes the jit-ls failure on 186.crafty.

llvm-svn: 14914
2004-07-17 20:26:14 +00:00
Chris Lattner 8a4039ed9a Reserve the correct amt of space.
llvm-svn: 14913
2004-07-17 20:24:05 +00:00
Misha Brukman e6f4a5ebb0 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 b85c2522fa * 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 db032fb1f9 * 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 780da8425f Fix code formatting
llvm-svn: 14899
2004-07-16 20:54:25 +00:00
Misha Brukman 3adf84ba0d Implement PowerPCInstrInfo::isMoveInstr(), patch by Nate Begeman
llvm-svn: 14898
2004-07-16 20:51:55 +00:00
Misha Brukman f0def96a36 Add prototype for TargetInstrInfo::isMoveInstr()
llvm-svn: 14897
2004-07-16 20:50:55 +00:00
Misha Brukman 9c2c293225 * 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 6ed15fd181 Add IMPLICIT_DEFS pseudo-instruction; patch by: Nate Begeman
llvm-svn: 14895
2004-07-16 20:33:41 +00:00
Misha Brukman 8c9938654a The generated instruction selector isn't (yet) functional
llvm-svn: 14894
2004-07-16 20:31:13 +00:00
Misha Brukman d4ac818593 * 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 a6b9a566b9 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 d350b64352 * 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
Misha Brukman 65728ddf45 Fix grammar.
llvm-svn: 14888
2004-07-16 17:40:28 +00:00
Brian Gaeke 135b870f72 Add a class for pseudo-instructions. Use it.
Add IMPLICIT_USE and IMPLICIT_DEF, a la X86.

llvm-svn: 14884
2004-07-16 10:32:10 +00:00
Brian Gaeke a57943154e Add what will eventually be the TSFlags. Big switch(opcode) statements are bad.
llvm-svn: 14883
2004-07-16 10:31:59 +00:00
Brian Gaeke f486726c56 Add special handling for pseudo-instructions (print them as comments).
llvm-svn: 14882
2004-07-16 10:31:47 +00:00
Brian Gaeke 97b71c9fa9 Add to-do list.
llvm-svn: 14881
2004-07-16 10:31:36 +00:00
Brian Gaeke 5ce1408537 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 2453818b8a 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 a46d2a63c7 Build the skeleton target
llvm-svn: 14875
2004-07-16 07:11:53 +00:00
Chris Lattner ed85542ad7 Initial checkin of the rest of the skeleton target
llvm-svn: 14874
2004-07-16 07:11:15 +00:00
Chris Lattner 3d53a4752d Initial skeleton tablegen files
llvm-svn: 14873
2004-07-16 06:29:19 +00:00
Chris Lattner 42023220fa Add skeleton makefile
llvm-svn: 14872
2004-07-16 06:20:55 +00:00
Chris Lattner e8a034901d Initial readme
llvm-svn: 14871
2004-07-16 06:12:28 +00:00
Chris Lattner 9716100a5d IA64 compat
llvm-svn: 14867
2004-07-16 00:08:28 +00:00
Chris Lattner 072a4c0091 Nuke a clearly bogus assertion
llvm-svn: 14854
2004-07-15 07:44:34 +00:00
Chris Lattner c9819f09c2 Revert stuff that I didn't mean to checkin
llvm-svn: 14844
2004-07-15 02:33:38 +00:00
Chris Lattner 7dc9de5f43 Patches towards fixing PR341
llvm-svn: 14841
2004-07-15 02:14:30 +00:00
Chris Lattner 33930ad7bd Improve codegen for the LLVM offsetof/sizeof "operator". Before we compiled
this LLVM function:

int %foo() {
        ret int cast (int** getelementptr (int** null, int 1) to int)
}

into:

foo:
        mov %EAX, 0
        lea %EAX, DWORD PTR [%EAX + 4]
        ret

now we compile it into:

foo:
        mov %EAX, 4
        ret

This sequence is frequently generated by the MSIL front-end, and soon the malloc lowering pass and
Java front-ends as well..

-Chris

llvm-svn: 14834
2004-07-15 00:58:53 +00:00
Misha Brukman 2661c50173 Make sure MTSPR instruction is inserted into the BasicBlock
llvm-svn: 14822
2004-07-14 18:26:31 +00:00
Misha Brukman 5193410cd9 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 d4cbe67ce6 * 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
Brian Gaeke 590b5f12db Add Machine-CFG edges to SparcV9 MachineBasicBlocks.
llvm-svn: 14806
2004-07-14 05:40:50 +00:00
Misha Brukman aa678b5ed4 * 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 be1b680f54 Correctly load FP constants out of the constant pool.
llvm-svn: 14782
2004-07-12 23:49:47 +00:00
Misha Brukman 9dacda651f Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>
llvm-svn: 14781
2004-07-12 23:37:18 +00:00
Misha Brukman dcb0eec80d Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC
llvm-svn: 14780
2004-07-12 23:36:12 +00:00
Chris Lattner c9c16a0e60 Implement TargetRegistrationListener
llvm-svn: 14759
2004-07-11 06:03:21 +00:00
Chris Lattner b889c6b261 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 c2726e63ed 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 2beb4392cf Delete the allocate*TargetMachine function, which is now dead .
llvm-svn: 14755
2004-07-11 04:16:31 +00:00
Chris Lattner baf43cf335 Implement a couple of methods that TargetMachineRegistry now provides. See,
I told you this file wasn't useless :)

llvm-svn: 14749
2004-07-11 04:00:19 +00:00
Chris Lattner 73eb9436ee Make these format a bit nicer
llvm-svn: 14747
2004-07-11 03:27:42 +00:00
Chris Lattner 4266f8017d Auto-registrate target
llvm-svn: 14745
2004-07-11 02:48:49 +00:00
Chris Lattner 97c176b639 Add compilability
llvm-svn: 14744
2004-07-11 02:48:28 +00:00