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
Misha Brukman
b296163bb1
Check if operand has an allocated reg before requesting it.
...
llvm-svn: 14550
2004-07-01 21:09:12 +00:00
Misha Brukman
efcb6b8c2c
* Coalesce the handy CALL* alias opcodes with the standard ones
...
* Congregate more branch-and-link opcodes together
* Mark FP, CPR, and special registers as volatile across calls
llvm-svn: 14511
2004-06-30 22:00:45 +00:00
Misha Brukman
7089b3d426
* Allow more registers to be allocated from the general register pool
...
* Define the condition register class
llvm-svn: 14510
2004-06-30 21:54:50 +00:00
Misha Brukman
08a07e969f
* Inquire about the number of operands from the instruction directly
...
* Only check for a register if we are sure the instruction has one allocated
llvm-svn: 14509
2004-06-30 21:54:12 +00:00
Misha Brukman
49e6aa1ba7
Always assume a function may have calls because the printer may add `bl' to get
...
the PC in a code sequence for global variables.
llvm-svn: 14506
2004-06-30 00:09:12 +00:00
Misha Brukman
3422760e16
* Don't save LR when outputting globals: it's already saved on the stack once
...
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
2004-06-29 23:45:05 +00:00
Misha Brukman
e9166fd352
* Stop using BBNumbering, we don't really need it
...
* Only increment labelNumber once, because it's used by both Load{hi,lo}Addr
* There is no .bss section on PowerPC
* Use .align 2 instead of other random numbers
llvm-svn: 14504
2004-06-29 23:40:57 +00:00
Misha Brukman
79a92e35b4
Set up the prologue and epilogue to be more like the manual and GCC output.
...
llvm-svn: 14502
2004-06-29 23:38:26 +00:00
Misha Brukman
2242e8d27f
* Use LA instead of LWZ for LoadLoAddr
...
* Specify the isCall bit and caller-save registers for some call instrs
llvm-svn: 14501
2004-06-29 23:37:36 +00:00
Misha Brukman
a0721ac147
Only allocate non-volatile registers R13-31 (for now).
...
llvm-svn: 14500
2004-06-29 23:35:32 +00:00
Misha Brukman
ddf07d1c08
Lower ConstantExpressions before the code generator.
...
llvm-svn: 14497
2004-06-29 23:33:20 +00:00
Misha Brukman
01841234e8
* Fix saving LR in function prologue
...
* Adjust epilogue restore sequence to match the PowerPC documentation
llvm-svn: 14480
2004-06-29 17:14:42 +00:00
Misha Brukman
08f6a46ce2
Assembly syntax/comment fixes by Nate Begeman.
...
llvm-svn: 14479
2004-06-29 17:13:26 +00:00
Chris Lattner
dda82ce624
The code generator should work with unreachable blocks. If not, then this
...
is a bug that should be fixed in the code generator, not papered over with
the simplifycfg pass. Eliminating this makes bugpoint much more useful
llvm-svn: 14477
2004-06-29 07:20:16 +00:00
Misha Brukman
7627e1ff1a
Can't print out machine code before it is constructed.
...
llvm-svn: 14472
2004-06-28 21:16:57 +00:00
Misha Brukman
92cc94a0e5
Fix the assembly opcode on LOADLoAddr, courtesy of Nate Begeman.
...
llvm-svn: 14470
2004-06-28 18:27:08 +00:00
Misha Brukman
2f7332b752
Set isBranch and isTerminator bits on all branch instructions.
...
llvm-svn: 14469
2004-06-28 18:23:35 +00:00
Misha Brukman
8f1e58dfe3
Fix loading and storing PC-relative static variables, courtesy of Nate Begeman.
...
llvm-svn: 14468
2004-06-28 18:20:59 +00:00
Misha Brukman
2eccf504e2
No need to generate a lazy-linking stub for internal functions, they can be
...
resolved by the static linker.
llvm-svn: 14467
2004-06-28 18:03:37 +00:00
Misha Brukman
5a52b7aa36
Do not set the `link' bit when branching to the first BB of a function, as it
...
will cause an infinite loop. The link bit is only used for calling functions.
llvm-svn: 14466
2004-06-28 17:57:40 +00:00
Misha Brukman
02ac5488d5
Fix spacing around function arguments.
...
llvm-svn: 14463
2004-06-28 15:53:27 +00:00
Misha Brukman
aef8fec73f
Allow debugging machine instrs (by printout) before/after isel and regalloc
...
llvm-svn: 14416
2004-06-25 19:57:47 +00:00
Misha Brukman
64c1484679
Combine several if stmts with returns into an if-then-elseif-else chain.
...
llvm-svn: 14414
2004-06-25 19:24:52 +00:00
Misha Brukman
d903511cdf
Do not move any values into registers for a void return (there isn't anything).
...
llvm-svn: 14413
2004-06-25 19:04:27 +00:00
Misha Brukman
981cf1f1b4
Convert tabs to spaces.
...
llvm-svn: 14412
2004-06-25 18:45:07 +00:00
Misha Brukman
8f9b970b80
Fix opcode: no immediate in an `or r1, r2, r3' (all registers) instr.
...
llvm-svn: 14411
2004-06-25 18:36:53 +00:00
Misha Brukman
d635cd485a
* Be consistent about MachineBB labels and references to them in instr stream
...
* Use MachineBB's built-in numbering system instead of reinventing one
llvm-svn: 14408
2004-06-25 15:42:10 +00:00
Misha Brukman
4f15d2830a
* Initialize the entire array statically, not member-at-a-time
...
* Remove x86-specific comment re: intel vs. at&t assembly syntax
llvm-svn: 14406
2004-06-25 15:11:34 +00:00
Misha Brukman
fb9eb50899
Fix bug in previous checkin.
...
llvm-svn: 14405
2004-06-25 14:57:19 +00:00
Misha Brukman
4e610581b0
* Wrap long lines
...
* 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
2004-06-25 14:50:41 +00:00
Misha Brukman
167dd03c82
Excise X86-specific comments.
...
llvm-svn: 14403
2004-06-25 14:13:26 +00:00
Misha Brukman
854b18fd19
Add option to print out machine code before register allocation.
...
llvm-svn: 14387
2004-06-24 23:55:01 +00:00
Misha Brukman
91ffab9644
Use DEBUG() guard for printing out debug info.
...
llvm-svn: 14386
2004-06-24 23:54:05 +00:00
Misha Brukman
1d7c31b2c1
Add a `break' in the switch/case statement between the int/fp sections.
...
llvm-svn: 14385
2004-06-24 23:53:24 +00:00
Misha Brukman
4e3d5069db
* Lowercase the register names
...
* Parenthesize assert() expressions correctly
* Fix spacing around for() and if() statements
llvm-svn: 14384
2004-06-24 23:51:00 +00:00
Misha Brukman
5d0be46fb7
* Tabs to spaces
...
* Send an error message to std::cerr before abort()ing
llvm-svn: 14381
2004-06-24 23:19:36 +00:00
Misha Brukman
b312aa9f4b
* Tabs to spaces
...
* Remove unnecessary parens, braces, clean up code layout
llvm-svn: 14379
2004-06-24 23:04:11 +00:00
Misha Brukman
2faa0989d0
Unindent some more code to be consistent.
...
llvm-svn: 14377
2004-06-24 22:00:15 +00:00
Misha Brukman
021bf53a50
Unindent some code, it only needs 2 spaces.
...
llvm-svn: 14376
2004-06-24 21:56:15 +00:00
Misha Brukman
ec698da314
In emitting code for a GEP instr, iterate over GEPTypes because there is one
...
more operand in GEPOps than there are types in GEPTypes: the pointer that is the
first operand of the GEP instruction.
llvm-svn: 14375
2004-06-24 21:54:47 +00:00
Misha Brukman
0e076dbd7a
* Order #includes
...
* Use the DEBUG() guard for debug printouts
llvm-svn: 14367
2004-06-24 17:31:42 +00:00
Misha Brukman
ae07b686fa
Spell out `NoFramePointerElim'.
...
llvm-svn: 14300
2004-06-21 21:18:48 +00:00
Misha Brukman
a2ac4e4345
Use the common `NoFPElim' setting instead of our own.
...
llvm-svn: 14298
2004-06-21 21:10:24 +00:00
Misha Brukman
a79674d478
* Make indentation consistent at 2 chars
...
* Doxygenify function comments
* Wrap code at 80 cols
llvm-svn: 14295
2004-06-21 20:22:03 +00:00
Misha Brukman
4424ef9dd1
This file is no longer applicable.
...
llvm-svn: 14294
2004-06-21 20:17:41 +00:00
Misha Brukman
3d93b9ccca
llvm/IntrinsicLowering.h => llvm/CodeGen/IntrinsicLowering.h
...
llvm-svn: 14292
2004-06-21 18:30:31 +00:00
Misha Brukman
36089f7034
Intrinsic::isnan has gone away, support for it commented out.
...
Intrinsic::isunordered has arrived, and we just use the standard lowering
pass for it.
llvm-svn: 14290
2004-06-21 17:58:36 +00:00
Misha Brukman
1c26b2e29d
Convert tabs to spaces.
...
llvm-svn: 14289
2004-06-21 17:41:12 +00:00
Misha Brukman
30e1885192
Type::getPrimitiveID() -> getTypeID()
...
llvm-svn: 14288
2004-06-21 17:25:55 +00:00
Misha Brukman
76b4796e7c
Type::getPrimitiveID() -> getTypeID()
...
llvm-svn: 14287
2004-06-21 17:19:08 +00:00
Misha Brukman
269034c151
Initial revision
...
llvm-svn: 14283
2004-06-21 16:55:25 +00:00
Misha Brukman
130e02f232
Add file comment.
...
llvm-svn: 14172
2004-06-14 15:13:59 +00:00
Chris Lattner
1f0e0d55c4
Fix the fixed stack offset, patch contributed by Vladimir Prus
...
llvm-svn: 14110
2004-06-10 06:19:25 +00:00
Chris Lattner
5effdb67b7
fine grainify namespacification
...
llvm-svn: 11959
2004-02-28 19:53:18 +00:00
Alkis Evlogimenos
e8f9647831
Add back machine code deleter pass until we get a MachineCode pass
...
that will be responsible for the creation of MachineFunctions and will
be required by all MachineFunctionPass passes.
llvm-svn: 11453
2004-02-15 00:03:15 +00:00
Alkis Evlogimenos
b755d35fd2
Change MachineBasicBlock's vector of MachineInstr pointers into an
...
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.
llvm-svn: 11340
2004-02-12 02:27:10 +00:00
Brian Gaeke
355bc299b7
Include PowerPC.h. Flesh out the stub versions of addPassesToEmitAssembly()
...
and addPassesToJITCompile() slightly.
llvm-svn: 11076
2004-02-02 19:06:36 +00:00
Brian Gaeke
24f70fa16d
Add comments describing how you would add prototypes for factory methods for
...
PowerPC-specific passes here.
llvm-svn: 11073
2004-02-02 19:05:28 +00:00
Brian Gaeke
bc72431950
Add the JITInfo object, accessor & initializer.
...
llvm-svn: 10972
2004-01-23 06:39:30 +00:00
Brian Gaeke
2757ec5b94
Add CodeEmitter and JITInfo stubs. Dump the old
...
PowerPCTargetMachine::addPassesToJITCompile() method, in favor of the
TargetJITInfo interface.
llvm-svn: 10971
2004-01-23 06:35:43 +00:00
Brian Gaeke
764f1b476a
Import of skeletal PowerPC backend I have had laying around for months...
...
llvm-svn: 10937
2004-01-21 21:13:19 +00:00