Commit Graph

2463 Commits

Author SHA1 Message Date
Chris Lattner
7c38def077 Implement TargetRegistrationListener
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14759 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 06:03:21 +00:00
Chris Lattner
68905bb6fc Delete the allocate*TargetMachine function, which is now dead.
The shared command line options are now in a header that makes sense.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14757 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:17:58 +00:00
Chris Lattner
0cf0c37469 Delete the allocate*TargetMachine function, which is now dead .
The shared command line options are now in a header that makes sense.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14756 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:17:10 +00:00
Chris Lattner
4e547ec8bf Delete the allocate*TargetMachine function, which is now dead .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14755 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:16:31 +00:00
Chris Lattner
d7099bc608 Implement a couple of methods that TargetMachineRegistry now provides. See,
I told you this file wasn't useless :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14749 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:00:19 +00:00
Chris Lattner
71d24aab2d Make these format a bit nicer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14747 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 03:27:42 +00:00
Chris Lattner
d36c970a11 Auto-registrate target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14745 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 02:48:49 +00:00
Chris Lattner
98599d098f Add compilability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14744 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 02:48:28 +00:00
Chris Lattner
bf5733737f Initial impl of this file. Yes this is pretty useless right now, but it
will grow in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14743 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 02:44:26 +00:00
Misha Brukman
313efcb886 * 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"!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14723 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 15:45:07 +00:00
Misha Brukman
c1ef127ae2 Read/write the offset value for stack-relative loads via correct instr operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14722 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 15:37:16 +00:00
Misha Brukman
f3f6382423 Add support for __fixdfdi(), __floatdisf(), and __floatdidf() external functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14703 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 19:41:16 +00:00
Misha Brukman
0aa97c625b * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14701 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 18:27:59 +00:00
Misha Brukman
fc879c336b * Add support for loading FP constants from the constant pool
* Load FP values into int regs as well for vararg functions; without memory ops!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14700 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 18:02:38 +00:00
Misha Brukman
05fcd0c891 * Fix header comment, excise references to X86
* Add suport for printing out references to constant pool indices


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14699 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 17:58:04 +00:00
Brian Gaeke
3a0858957a Support setcc on fp values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14687 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 09:08:35 +00:00
Brian Gaeke
4185d03dc5 Add floating-point branches and compares. Compares don't complete
until the next cycle, and there's no interlock, so they effectively
have a delay slot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14686 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 09:08:22 +00:00
Brian Gaeke
7e540fe2b6 Fix bug where SwitchSection would fail to change to ".bss" successfully.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14685 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 08:08:23 +00:00
Brian Gaeke
ccdd70a5c0 Fix bug involving bool arguments to binary operators.
Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14684 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 08:08:10 +00:00
Brian Gaeke
2a9f539168 Fix bug in copying long constants to register pairs. We were getting
the top and bottom halves backwards...how embarrassing.
Support 'cast long to long' and other similar no-op casts to long.
Support 'ret long'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14683 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 07:52:13 +00:00
Brian Gaeke
f9a75460ee Support 'ret float'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14681 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 07:22:27 +00:00
Misha Brukman
2834a4dd1d * Use a map for caching lookups to external functions (fp div/rem)
* Tabs to spaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14673 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 20:07:22 +00:00
Misha Brukman
e62cd37c2a * Wrap long lines (comments and code)
* Tabs to spaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14672 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 20:01:36 +00:00
Misha Brukman
b093259edd Add fmod() to the Module being compiled so that it gets a stub in the asm file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14670 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 15:36:18 +00:00
Misha Brukman
d18a31d2fa * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14653 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 22:51:53 +00:00
Misha Brukman
4cf5112500 Use the more compact bl' instead of cryptic (but equivalent) bcl 20,31'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14652 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 22:40:34 +00:00
Misha Brukman
e9c6551fed * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14643 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 15:32:44 +00:00
Chris Lattner
38343f6cfe Add #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14625 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 17:19:21 +00:00
Reid Spencer
954da37bb4 Add #include <iostream> since Value.h does not #include it any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14622 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:19:56 +00:00
Misha Brukman
68a9b04e77 Add FIXME notes for spilling int/fp regs (need to calculate stack space).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14581 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 17:54:38 +00:00
Brian Gaeke
e0e3589949 Fix use-before-def thinko
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14570 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 07:01:31 +00:00
Chris Lattner
a9a582fbb6 Fix potential problems with unreachable basic blocks.
Also, while noone's looking, add support for constant expressions.  Wait,
I said not to look!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14566 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:49:11 +00:00
Chris Lattner
fab96f0b69 Fix all of those problems that the PPC backend has running 176.gcc :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14565 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:48:42 +00:00
Chris Lattner
9a9ca0f06b Remove dead blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14564 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:46:41 +00:00
Brian Gaeke
90c5bbe100 Add M_TERMINATOR_FLAG to terminator instructions (branches and returns).
Also, the RETURN instructions are not used in the sparcv9 backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14559 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 04:57:37 +00:00
Brian Gaeke
3c95d3a9dc RETURN instructions are not used in the sparc backend.
When in doubt, stamp it out!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14558 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 04:57:35 +00:00
Misha Brukman
452069abcc * Follow the PowerPC convention of leaving 24 bytes for linking on the stack.
* Also leave space for spilling integer registers (this should be calculated)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14554 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:35:00 +00:00
Misha Brukman
425ff24bb3 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14553 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:34:10 +00:00
Misha Brukman
f233a84b3c Wrap long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14552 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:27:59 +00:00
Misha Brukman
15eb0a15e5 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14551 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:24:50 +00:00
Misha Brukman
4363bdb0e5 Check if operand has an allocated reg before requesting it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14550 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:09:12 +00:00
Chris Lattner
59b0067334 Handle targets where alignment can be bigger than the size of the data.
Contributed by Vladimir Prus!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14534 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 17:32:59 +00:00
Misha Brukman
d2d5df207a Fix indentation to be 2 spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14512 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 22:11:03 +00:00
Misha Brukman
c661c3001c * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14511 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 22:00:45 +00:00
Misha Brukman
da7515a378 * Allow more registers to be allocated from the general register pool
* Define the condition register class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14510 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 21:54:50 +00:00
Misha Brukman
b9e8f97aef * Inquire about the number of operands from the instruction directly
* Only check for a register if we are sure the instruction has one allocated


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14509 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 21:54:12 +00:00
Misha Brukman
ea09126414 visitSetCondInst() takes a parameter of type `SetCondInst'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14508 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 21:47:40 +00:00
Misha Brukman
ce76db9083 Always assume a function may have calls because the printer may add `bl' to get
the PC in a code sequence for global variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14506 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 00:09:12 +00:00
Misha Brukman
14d8c7a6a0 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14505 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:45:05 +00:00
Misha Brukman
61297ee118 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14504 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:40:57 +00:00