Commit Graph

1062 Commits

Author SHA1 Message Date
Misha Brukman 4cf012d845 Encode predict = 1 by default, because the Sparc assembler does this.
llvm-svn: 7181
2003-07-15 21:26:49 +00:00
Misha Brukman 384cb5dd10 Correctly handle calls to functions which are further away than 2**32 bits will
allow, i.e. make a sequence of instructions to enable an indirect call using
jump-and-link and 2 temporary registers (which we save and ultimately restore).

Warning: if the delay slot of a function call is used to do meaningful work and
not just a NOP, this behavior is incorrect. However, the Sparc backend does not
yet utilize the delay slots effectively, so it is not necessary to make an
overly complicated algorithm for something that's not used.

llvm-svn: 7178
2003-07-15 19:09:43 +00:00
Misha Brukman b402819ddf * Added support for the %ccr register
* FP double registers are now coded correctly
* Removed function which converted registers based on register types, it was
  broken (because regTypes are broken)

llvm-svn: 7175
2003-07-14 23:26:03 +00:00
Misha Brukman 7fdaab4f68 The word `separate' only has one `e'.
llvm-svn: 7173
2003-07-14 17:20:40 +00:00
Brian Gaeke b99d684839 If we have a constant pointer reference to a function, we were printing
out the entire llvm disassembly for the function at global constant-output
time, which caused the assembler to barf in 164.gzip. This fixes that
particular problem (though 164.gzip has other problems with X86 llc.)

llvm-svn: 7168
2003-07-11 21:57:01 +00:00
Brian Gaeke 5b04987a4c Fix some serious floating-point bugs (fixes test cases such as Oscar,
Fhourstones, McCat-vor, and many others...)

Printer.cpp: Print implicit uses for AddRegFrm instructions.  Break gas
bug workarounds up into separate stanzas of code for each bug.  Add new
workarounds for fild and fistp.

X86InstrInfo.def: Add O_ST0 implicit uses for more FP instrs where they
obviously apply. Also add PrintImplUses flags for FP instrs where they
are necessary for gas to understand the output.

llvm-svn: 7165
2003-07-11 18:18:35 +00:00
Vikram S. Adve 4f420ce3a3 Several important bug fixes:
(1) Cannot use ANDN(ot), ORN, and XORN for boolean ops, only bitwise ops.

(2) Conditional move instructions must distinguish signed and unsigned
    condition codes, e.g., MOVLE vs. MOVLEU.

(3) Conditional-move-on-register was using the cond-move-on-cc opcodes,
    which produces a valid-looking instruction with bogus registers!

(4) Here's a really cute one: dividing-by-2^k for negative numbers needs to
    add 2^k-1 before shifting, not add 1 after shifting.  Sadly, these
    are the same when k=0 so our poor test case worked fine.

(5) Casting between signed and unsigned values was not correct:
    completely reimplemented.

(6) Zero-extension on unsigned values was bogus: I was only doing the
    SRL and not the SLLX before it.  Don't know WHAT I was thinking!

(7) And the most important class of changes: Sign-extensions on signed values.
    Signed values are not sign-extended after ordinary operations,
    so they must be sign-extended before the following cases:
	-- passing to an external or unknown function
	-- returning from a function
	-- using as operand 2 of DIV or REM
	-- using as either operand of condition-code setting operation
           (currently only SUBCC), with smaller than 32-bit operands


Also, a couple of improvements:

(1) Fold cast-to-bool into Not(bool).  Need to do this for And, Or, XOR also.

(2) Convert SetCC-Const into a conditional-move-on-register (case 41)
    if the constant is 0.  This was only being done for branch-on-SetCC-Const
    when the branch is folded with the SetCC-Const.

llvm-svn: 7159
2003-07-10 20:07:54 +00:00
Vikram S. Adve 8ea738a9ff Bug fix in creating constants: need 1U << 31, not 1 << 31.
llvm-svn: 7158
2003-07-10 19:48:19 +00:00
Vikram S. Adve 2f90c823a2 Fold cast-to-bool into not. Later, this should also be folded into other
boolean operations: AND, OR, XOR.

llvm-svn: 7157
2003-07-10 19:47:42 +00:00
Vikram S. Adve 6528067646 Several fixes to handling of int CC register:
(1) An int CC live range must be spilled if there are any interferences,
    even if no other "neighbour" in the interf. graph has been allocated
    that reg. yet.  This is actually true of any class with only one reg!

(2) SparcIntCCRegClass::colorIGNode sets the color even if the LR must
    be spilled so that the machine-independent spill code doesn't have to
    make the machine-dependent decision of which CC name to use based on
    operand type: %xcc or %icc.  (These are two halves of the same register.)

(3) LR->isMarkedForSpill() is no longer the same as LR->hasColor().
    These should never have been the same, and this is necessary now for #2.

(4) All RDCCR and WRCCR instructions are directly generated with the
    phony number for %ccr so that EmitAssembly/EmitBinary doesn't have to
    deal with this.

llvm-svn: 7151
2003-07-10 19:42:11 +00:00
Misha Brukman ea6e7a5d72 Elaborated assembly syntax of instructions in the comments.
llvm-svn: 7120
2003-07-07 22:18:42 +00:00
Misha Brukman 25a49f0cf1 Removed unnecessary assignment (it was taken care by a superclass) and clarified
some comments.

llvm-svn: 7119
2003-07-07 22:18:06 +00:00
Brian Gaeke c48e3fdffd Insert workaround for GAS bug in assembling FLD/FSTP XWORD PTR [...]
instructions, by outputting them as bytes.

llvm-svn: 7115
2003-07-07 18:34:20 +00:00
Misha Brukman c1db0fdd7e Moved RegClassIDs enum to be next to the RegTypes enum.
llvm-svn: 7114
2003-07-07 16:52:39 +00:00
Vikram S. Adve 55c8e21073 Correction to last fix: Pointer types do not return true in Type::IsIntegral().
llvm-svn: 7113
2003-07-06 22:50:31 +00:00
Vikram S. Adve d09c4c34c0 Major bug fix though it happened rarely (only on a compare after an
integer overflow):
We need to use %icc and not %xcc for comparisons on 32-bit or smaller
integer values.

llvm-svn: 7111
2003-07-06 20:13:59 +00:00
Vikram S. Adve c4499d6cb1 Make the RegClassID values public -- there is no other way to get them.
llvm-svn: 7109
2003-07-06 19:53:59 +00:00
Misha Brukman bb95605448 Apparently, the "regType" and "regClass" used in the Sparc backend are not both
correct: empirically, "regType" is wrong for a number of registers. Thus, one
can only rely on the "regClass" to figure out what kind of register one is
dealing with.

This change switches to using only "regClass" and adds a few extra DEBUG() print
statements and a few clean-ups in comments and code, mostly minor.

llvm-svn: 7103
2003-07-03 18:36:47 +00:00
Misha Brukman 20d93ca01d * Force all "don't care" bits to 0 so that there are absolutely no unset bits in
the TableGen descriptions; all unset bits are thus errors.
* As a result, found and fixed instructions where some operands were not
  actually assigned into the right portion of the instruction.

llvm-svn: 7074
2003-07-02 19:37:48 +00:00
Misha Brukman eccc0dac91 The classes F4_3 and F4_4 have an `rd' operand that needs to be set.
llvm-svn: 7073
2003-07-02 18:27:47 +00:00
Misha Brukman 81951e1142 Properly fix instruction syntax in comments, using `imm' for instructions that
use an immediate value instead of a register.

llvm-svn: 7072
2003-07-02 18:15:43 +00:00
Misha Brukman 6f9caec57f Fixed instruction syntax in the comments (specifies how instr is used).
llvm-svn: 7071
2003-07-02 18:02:58 +00:00
Vikram S. Adve 7a4abf89fa Force fixed-size but large alloca objects to the dynamically allocated
area to avoid using up precious stack space within the 4095 offset limit
from %fp.  Such objects that would themselves live at a large offset
were being put there already so this is a simple change.

llvm-svn: 7066
2003-07-02 06:59:22 +00:00
Vikram S. Adve cf952cb504 (1) Major bug fix: DecomposeArrayRef() replaces its argument instr. and
deletes it, but we were merrily trying to fix the operands of that
    instruction anyway!  Instead, fix the replacement instruction.

(2) An Improvement: Check for and extract global values in all operands,
    not just in known pointer operands.  For example, they can occur in
    call arguments, and probably other unforeseeable places as well.
    This also eliminates the special-case handling of Load and Store.

llvm-svn: 7053
2003-07-02 01:23:15 +00:00
Vikram S. Adve b5f8ada255 Bug/case fixes:
(1) select: Ok to convert a pointer to a float or double.
(2) regalloc: Some MachineInstr* for caller-saving code before a call
    were being inserted before and after the call!
(3) Don't insert the caller-saving instructions in the
    MachineCodeForInstruction for the Call instruction.
    *All* instructions generated by register allocation need to be
    recorded in those maps, but it needs to be done uniformly.

llvm-svn: 7051
2003-07-02 01:13:57 +00:00
John Criswell 3ef61afb76 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner 53426e6526 Setjmp should always return zero if we don't implement longjmp. This avoids
leaving trash in the register, fixing anagram

llvm-svn: 7013
2003-06-30 19:35:54 +00:00
Chris Lattner 7ac937e011 Until there is a setjmp/longjmp transformation pass, codegen setjmp as a noop
and longjmp as an abort!

llvm-svn: 6977
2003-06-29 16:42:32 +00:00
Brian Gaeke c1e4ee0f50 Nice tasty llc fixes. These should fix LLC for x86 for everything in
SingleSource except oopack and Oscar.  (Sorry, Oscar.)

include/llvm/Target/TargetInstrInfo.h: Remove virtual print method. Add
 accessors for ImplicitUses/Defs.
lib/Target/TargetInstrInfo.cpp: Remove virtual print method. If you
 really wanted this, just use MI->print(O, TM); instead...
lib/Target/X86:
FloatingPoint.cpp: ...like this.
X86InstrInfo.h: Remove virtual print method. Define the PrintImplUses
 target-specific flag bit.
X86InstrInfo.def: Add the PrintImplUses flag to all the instructions
 which implicitly use CL, because the assembler needs to see the CL in
 order to generate the right instruction.
Printer.cpp: Ditch fnIndex at Chris's request. Now we use CurrentFnName
  to name constants in the constant pool for each function instead. This
  avoids keeping state between runOnMachineFunction() invocations, which
  is a no-no. Having MangledGlobals be global is a bogon I'd like to get
  rid of too, but making it a static member of Printer causes link errors
  (why???).
 Make NumberForBB into a member of Printer instead of a global, too.
 Make printOp and printMemReference into methods of Printer.
 X86InstrInfo::print is now Printer::printMachineInstruction, because
  TargetInstrInfo::print is history. (Because of this, we have to qualify
  the names of some TargetInstrInfo methods we call.)
 Print out the ImplicitUses field of any instruction we print that has
  the PrintImplUses bit set.

llvm-svn: 6924
2003-06-27 00:00:48 +00:00
Brian Gaeke 4ab222142f Number constants from constant pool as CPIf_i where f is the function index
and i is the constant pool index.

llvm-svn: 6920
2003-06-26 18:02:30 +00:00
Brian Gaeke dda8abec9b Integrate the C writer's name mangler.
llvm-svn: 6908
2003-06-25 22:00:39 +00:00
Brian Gaeke 25e766aca5 First draft of X86 LLC backend. This should be OK for small programs like
Shootout, but it has some issues with bigger programs. Work in progress.

llvm-svn: 6907
2003-06-25 18:01:07 +00:00
Vikram S. Adve 50b1d41ad4 Add the padding needed for variable-size alloca's, which should work now.
llvm-svn: 6859
2003-06-23 02:13:57 +00:00
Chris Lattner 53b843fc04 Do not use the inefficient, fixed function, CBW, CDQ, ... instructions
llvm-svn: 6844
2003-06-22 03:31:18 +00:00
Chris Lattner 6e1ec2394f Minor simplification to 64-bit instsel
llvm-svn: 6831
2003-06-21 18:15:27 +00:00
Chris Lattner 22f54501be For 16 and 32-bit multiplies, use the IMUL instruction instead of the MUL instruction.
This allows us to not force the use of the EAX/AX registers!

llvm-svn: 6830
2003-06-21 17:16:58 +00:00
Chris Lattner 2a67e0cf02 Add IMULr16 & IMULr32 instructions
llvm-svn: 6829
2003-06-21 17:13:35 +00:00
Chris Lattner df1230ecf2 Generate code for LONG indexes to getelementptr instructions more efficiently
llvm-svn: 6828
2003-06-21 16:01:24 +00:00
Chris Lattner 9cb6b02dc9 Some preprocessors doen't support // comments and get confused
llvm-svn: 6821
2003-06-20 23:14:50 +00:00
Vikram S. Adve f6aaa90e8d RDCCR defines arg. #1, not arg. #2.
llvm-svn: 6796
2003-06-20 11:32:11 +00:00
Brian Gaeke 272c8871d7 Fix output bug: Intel asm comment character is #, not ;.
llvm-svn: 6792
2003-06-19 19:58:32 +00:00
Brian Gaeke 2181d1f1a2 RECAPITALIZE all the names of pseudo-instructions, and add a comment explaining
the convention.

:-)

llvm-svn: 6791
2003-06-19 19:41:13 +00:00
Brian Gaeke f6de19a095 Rename many instructions to their Intel asm-compatible names. This
involves removing the [bwl] suffixes from instruction names, as well
as some other distinguishing marks (32/64/80 on fp insns, _i suffixes, etc.)

Lowercase all instr. names as well for consistency's sake.

llvm-svn: 6790
2003-06-19 19:34:44 +00:00
Brian Gaeke 259fdbc230 Add Initialization and Finalization methods for the Printer pass,
to print various things on a module-by-module basis (currently, only the
former is used).

Don't print < > around names. The assembler can't take it.

Print pseudoinstructions only as comments. The poor little assembler can't
take that, either.

llvm-svn: 6789
2003-06-19 19:32:32 +00:00
Brian Gaeke ac94bab876 lib/Target/X86/X86TargetMachine.{cpp,h}: Add initial version
(non-working) of llc guts for X86, and add a prototype for it.

llvm-svn: 6779
2003-06-18 21:43:21 +00:00
Brian Gaeke cf8c4f5fe4 lib/Target/Sparc/Sparc.cpp:
Move LowerAllocations, PrintFunction, and SymbolStripping passes, and
  the corresponding -disable-strip and -d options, over here to the SPARC
  target-specific bits of llc. Rename -d to -dump-asm.

tools/llc/Makefile:
 Reindent. Add x86 library so that llc compiles again.

tools/llc/llc.cpp:
 Remove support for running arbitrary optimization passes. Use opt instead.
 Remove LowerAllocations, PrintFunction, and SymbolStripping passes, as noted
  above.
 Allow user to select a backend (x86 or SPARC); default to guessing from
  the endianness/pointer size of the input bytecode file.
 Fix typos.
 Delete empty .s file and exit with error status if target does not support
  static compilation.

llvm-svn: 6776
2003-06-18 21:14:23 +00:00
Chris Lattner d768c51f1b These instructions really take three operands. This fixes some assertions
llvm-svn: 6765
2003-06-18 15:09:02 +00:00
Brian Gaeke 7a719ed20c Isolate machine-dependent use of <alloca.h> in "Support/Alloca.h",
so that we can easily change its use to be conditional on the result of
an autoconf test later.

llvm-svn: 6723
2003-06-16 21:54:01 +00:00
Chris Lattner 3bcde17e00 Rename FInfo.cpp to FunctionInfo.cpp, eliminate FInfo.h
llvm-svn: 6712
2003-06-16 15:31:52 +00:00
Chris Lattner 617ea34a6d move contents of include/llvm/Reoptimizer/Mapping/FInfo.h into here, it is sparc internal
llvm-svn: 6711
2003-06-16 15:31:09 +00:00
Chris Lattner cb9ef2bccc Fix invalid number of arguments problem
llvm-svn: 6692
2003-06-16 12:03:00 +00:00
John Criswell fafd3d2b31 Updated for the new projects Makefile.
llvm-svn: 6678
2003-06-11 13:49:11 +00:00
Chris Lattner 11ecb1d8ca Fix warnings on Sparc
llvm-svn: 6658
2003-06-06 18:25:33 +00:00
Misha Brukman ff61facc3c Print address out as hex.
llvm-svn: 6657
2003-06-06 09:53:28 +00:00
Misha Brukman ad2ab66d89 Added 'r' and 'i' versions to WRCCR.
llvm-svn: 6656
2003-06-06 09:52:58 +00:00
Misha Brukman 2969ec5266 * Changed Bcc instructions to behave like BPcc instructions
* BPA and BPN do not take a %cc register as a parameter
* SLL/SRL/SRA{r,i}5 are there for a reason - they are ONLY 32-bit instructions
* Likewise, SLL/SRL/SRAX{r,i}6 are only 64-bit
* Added WRCCR{r,i} opcodes

llvm-svn: 6655
2003-06-06 09:52:23 +00:00
Misha Brukman 0941cd11c8 * Removed PreSelection pass because that is now done in the JIT
* Removed instruction scheduling as it is too slow to run in a JIT environment
* Removed other passes because they aren't necessary and can slow JIT down

llvm-svn: 6652
2003-06-06 07:11:16 +00:00
Misha Brukman b7f76d32fe Fixed a bunch of test cases in test/Regression/Jello which could not get the
address of a floating-point (allocated via ConstantPool) correctly.

llvm-svn: 6647
2003-06-06 04:41:22 +00:00
Chris Lattner 65d29b87e3 Add statistic for # machine instrs emitted
Add GROSS HACK to get CompilationCallback to work when compiled in release mode

llvm-svn: 6646
2003-06-06 04:00:05 +00:00
Misha Brukman 905ffcb780 * If a global is not a function, just ask the MachineCodeEmitter for the addr
* Do not block a print statement with a DEBUG() guard if we're going to abort()

llvm-svn: 6645
2003-06-06 03:35:37 +00:00
Misha Brukman ee21ccc607 The SUB*i instructions belong to a different class than their SUB*r brethren.
llvm-svn: 6644
2003-06-06 03:34:47 +00:00
Misha Brukman 1c1568ed68 Put all debug print statements under the DEBUG() guard to make output clean so
that tests can automatically diff the output.

llvm-svn: 6642
2003-06-06 00:26:11 +00:00
Misha Brukman ee964e2690 Fixed confusion between register classes and register types.
Now %fcc registers are recognized correctly.

llvm-svn: 6640
2003-06-05 23:51:10 +00:00
Misha Brukman 97a04b24cc Added missing directive to store the instruction name.
llvm-svn: 6639
2003-06-05 23:35:11 +00:00
Misha Brukman 90fd75efa4 Moved predict and annul fields to the end of each individual instruction
class, because they are currently unused.

llvm-svn: 6638
2003-06-05 23:33:15 +00:00
Misha Brukman fd394b766a Do not preset the cc register, the instructions actually use it.
llvm-svn: 6637
2003-06-05 23:30:27 +00:00
Vikram S. Adve 82dca3714f Minor tuning -- avoid a non-inlinable function call on every operand.
Also, reorder a couple of functions for inlining.

llvm-svn: 6635
2003-06-05 21:12:56 +00:00
Misha Brukman 27afe52c4c Added lazy function resolution to the JIT.
llvm-svn: 6633
2003-06-05 20:52:06 +00:00
Misha Brukman 9ac56f847f * The textual output of (non-)predicted FP branches is the same.
* Stop mapping FBcc instructions to deprecated opcodes, map to FBPcc instead.
* Fixed opf in FCMPxy instructions.

llvm-svn: 6632
2003-06-05 20:51:37 +00:00
Chris Lattner f6db070e65 Implement generation of cmp R, C to not use an extra register
llvm-svn: 6627
2003-06-05 19:30:30 +00:00
Chris Lattner 06250116a8 Special case simple binary operator X op C
This avoid generating a register to hold C, which in turn speeds up the
  register allocator by a lot: ~9% on 164.gzip and ~17% on 256.bzip2.  This
  also speeds up other passes.  This also speeds up execution of the program
  marginally, and makes the asm much easier to read. :)

llvm-svn: 6626
2003-06-05 18:28:55 +00:00
Chris Lattner 1b84b0b928 Add instructions for (add|sub|and|or|xor)ri(8|16|32)
llvm-svn: 6625
2003-06-05 18:25:08 +00:00
Misha Brukman cbbe7ac699 All store instructions really want 'rd' in the first field.
Special cases: STFSRx and STXFSRx - they operate on predefined rd=0 or rd=1, and
expect %fsr as the parameter in assembly. They are disabled (since not used)
until an encoding, both for code generation and output, is chosen.

llvm-svn: 6619
2003-06-05 01:06:10 +00:00
Misha Brukman 98467a7a18 Added missing 'rs1' field to F3_rdrs1imm13, 'rd' to F3_rdrs1rs2.
llvm-svn: 6618
2003-06-05 00:39:45 +00:00
Brian Gaeke 98eee41e0e lib/CodeGen/Mapping/MappingInfo.cpp:
Update file comment to contain a bunch of the overview mapping-info
  documentation previously buried within the file.
 Remove some unnecessary include/using stmts.
 Rename pass to MappingInfoCollector.
 Rewrite a lot of it so it doesn't use global instance variables and so
  it outputs into MappingInfo objects and then dumps those out, instead of going
  straight to an assembly file.
 Change name of factory to getMappingInfoCollector.
 Fold prologue & epilogue writers into MappingInfo methods.

lib/Target/Sparc/FInfo.cpp:
 Correct file comment to reflect above change

lib/Target/Sparc/Sparc.cpp:
 Change name of factory to getMappingInfoCollector.

llvm-svn: 6617
2003-06-04 22:07:12 +00:00
Brian Gaeke 44b2d7a56f Add file comment. Include <vector> and <string>. Update include guards
to reflect file's current location.  Add definition of class
MappingInfo.

llvm-svn: 6616
2003-06-04 22:02:47 +00:00
Chris Lattner 365a47bdbb Revert brians patch to get mapping info working again
sorry dude

llvm-svn: 6615
2003-06-04 21:01:12 +00:00
Tanya Lattner cbf828dd0d Had to comment out a line in outByte() to get it to compile because Out and tmp were
undeclared. I was not sure what Brian wanted, so I will let him fix this. But now it compiles.

llvm-svn: 6614
2003-06-04 20:53:46 +00:00
Misha Brukman efafdf8046 * Instead of re-inventing the MachineConstantPool emitter that's already given
in Emitter.cpp, just convert the Sparc version of the constant pool into
  what's already supported and inter-operate.
* Implemented a first pass at lazy function resolution in the JITResolver. That
  required adding a SparcV9CodeEmitter pointer to simplify generating
  bit-patterns of the instructions.
* SparcV9CodeEmitter now creates and destroys static TheJITResolver, which makes
  sense because the SparcV9CodeEmitter is the only user of TheJITResolver, and
  lives for the entire duration of the JIT (via PassManager which lives in VM).
* Changed all return values in the JITResolver to uint64_t because of the 64-bit
  Sparc architecture.
* Added a new version of getting the value of a GlobalValue in the
  SparcV9CodeEmitter, which now works for already-generated functions (JITted or
  library functions).
* Removed little-used and unused functions, cleaning up the internal view of the
  SparcV9CodeEmitter.

llvm-svn: 6612
2003-06-04 20:01:13 +00:00
Brian Gaeke 49833da4bf Make writeNumber() void. Get ready to decouple it from .byte directive output.
llvm-svn: 6609
2003-06-04 18:17:22 +00:00
Misha Brukman 7be5063ccc Added the 4.7 instruction class and all the FMOVcc instructions in them.
llvm-svn: 6601
2003-06-04 04:48:31 +00:00
Misha Brukman 11cfb6f7dc Comment out opcodes currently unused in the Sparc backend.
llvm-svn: 6597
2003-06-04 02:57:55 +00:00
Chris Lattner fee44070a1 No really, you _cannot use_ getelementptr on an unsized type: that makes
no sense.

llvm-svn: 6595
2003-06-04 02:35:35 +00:00
Misha Brukman 37586db4b5 Added instruction format class 3.15 and floating-point compare instructions.
llvm-svn: 6594
2003-06-04 02:26:14 +00:00
Vikram S. Adve 680ee9f634 Undo one of those last fixes -- it was incorrect.
llvm-svn: 6593
2003-06-04 02:10:37 +00:00
Chris Lattner 46666cfcdd Avoid generating a getelementptr instruction of a function
llvm-svn: 6591
2003-06-04 01:24:40 +00:00
Brian Gaeke 49e14432c2 Make the write*map methods more self-contained. Document some more.
llvm-svn: 6589
2003-06-03 19:30:15 +00:00
Chris Lattner fd2a8f5868 Remove usage of typedef
llvm-svn: 6583
2003-06-03 15:41:58 +00:00
Chris Lattner 0addbab5e2 Add namespace comments for doxygen
llvm-svn: 6581
2003-06-03 15:31:23 +00:00
Brian Gaeke 71ab329f08 I documented this file, in an attempt to understand it, with a view toward
rewriting it.  I also vacuumed out all the commented-out code and
inaccurate comments, etc.

(We need to put the mapping information in a data structure so that we can
pass it out to the JIT, instead of automagically converting it to .byte
directives.)

llvm-svn: 6574
2003-06-03 07:56:05 +00:00
Chris Lattner 0521493aa9 Use the new -o tablegen option
llvm-svn: 6572
2003-06-03 05:06:33 +00:00
Misha Brukman 2712333e5f Constants are laid out in memory in PC-relative form.
llvm-svn: 6568
2003-06-03 03:24:12 +00:00
Misha Brukman c8728a147e Added opcode conversion for conditional move of integers.
llvm-svn: 6567
2003-06-03 03:23:35 +00:00
Misha Brukman cdf6256940 * Convert load/store opcodes from register to immediate forms.
* Stop code from wrapping to the next line.

llvm-svn: 6566
2003-06-03 03:21:58 +00:00
Misha Brukman 3cdf52a644 Convert load/store opcodes from register to immediate forms, if necessary.
llvm-svn: 6565
2003-06-03 03:20:57 +00:00
Misha Brukman b54bf54065 Store instructions are different from other Format 3.1/3.2 instructions in that
they prefer the destination register to be last. Thus, two new classes were made
for them that accomodate for having this layout of operands (F3_1rd, F3_2rd).

llvm-svn: 6564
2003-06-03 03:20:14 +00:00
Misha Brukman bbd10f96a2 * Added section A.34: Move FP register on int reg condition (FMOVr)
* Labeled sections that are not currently used in the Sparc backend as not
  requiring completion at this time.

llvm-svn: 6562
2003-06-03 01:16:27 +00:00
Misha Brukman e9465fc1d4 * Removed unused classes (rd field is always mentioned last); fixed comments.
* Added instruction classes which start building from rs1, then rs2, and rd.
* Fixed order of operands in classes 4.1 and 4.2; added 4.6 .

llvm-svn: 6561
2003-06-03 01:13:53 +00:00
Misha Brukman ace89ff224 * Removed unused classes: the rd field is always mentioned as the last reg.
* Added new classes which start building from rs1, adding rs2, and then rd.
* Fixed order of operands in classes 3.11, 3.12, 3.16, and 3.17 .
* Fixed comments to reflect Real Life (tm).
* Removed "don't care" commented out assignments and dead classes (#if 0).

llvm-svn: 6560
2003-06-03 01:11:58 +00:00
Misha Brukman 4485c795a9 The rd field goes after the immediate field in format 2.1 instructions.
llvm-svn: 6559
2003-06-03 01:04:04 +00:00
Misha Brukman f545b2402f Added MOVR (move int reg on register condition), aka comparison with zero.
None of these instructions are actually used in the Sparc backend, so no changes
were required in the instruction selector.

llvm-svn: 6549
2003-06-02 21:16:54 +00:00
Misha Brukman 843d6933a0 SparcInstr.def: added 'r' and 'i' versions of MOV(F)cc instructions
SparcInstrSelection.cpp:
* Fixed opcodes to return correct 'i' version since the two functions are each
  only used in one place.
* Changed name of function to have an 'i' in the name to signify that they each
  return an immediate form of the opcode.
* Added a warning if either of the functions is ever used in a context which
  requires a register-version opcode.

SparcV9_F4.td: fixed class F4_3, added F4_4 and notes that F4_{1,2} need fixing
SparcV9.td: added the MOV(F)cc instructions

llvm-svn: 6548
2003-06-02 20:55:14 +00:00
Misha Brukman 609b55c255 * Added casts to/from floating-point to integers.
* Changed // comments to #ifdef 0 to maintain syntax highlighting.

llvm-svn: 6546
2003-06-02 19:08:37 +00:00
Misha Brukman 55c6331637 Clean up after merging in SparcEmitter.cpp; branches and return work again.
llvm-svn: 6536
2003-06-02 05:24:46 +00:00
Chris Lattner 7b66a726f8 Minor cleanups
llvm-svn: 6535
2003-06-02 05:21:06 +00:00
Misha Brukman f9162dc713 Eliminated a compiler warning due to casting to a different-sized datatype.
llvm-svn: 6531
2003-06-02 04:13:58 +00:00
Misha Brukman ce62d36615 Merged in tools/lli/JIT/SparcEmitter.cpp, coupled with the JITResolver taken
from lib/Target/X86/X86CodeEmitter.cpp .

llvm-svn: 6530
2003-06-02 04:12:39 +00:00
Misha Brukman 29848417f3 Renamed MachineCodeEmitter.cpp -> X86CodeEmitter.cpp as it conflicts with the
target-independent lib/CodeGen/MachineCodeEmitter.cpp; preserved CVS history.

llvm-svn: 6528
2003-06-02 03:28:00 +00:00
Brian Gaeke bca71e4735 Deal with %lo/%lm/%hm/%hh flags in getMachineOpValue().
llvm-svn: 6522
2003-06-02 02:13:26 +00:00
Chris Lattner 3bb2a00849 Move X86 specific code out of the JIT into the X86 backend
llvm-svn: 6516
2003-06-01 23:23:50 +00:00
Brian Gaeke 13dffdefef Make the .inc file depend on $(TBLGEN), so that changes to TableGen followed
by a re-link of TableGen will notify Make to rebuild the .inc file.

llvm-svn: 6512
2003-06-01 04:52:51 +00:00
Chris Lattner 4536fcd57b * Implement cast (long|ulong) to bool
* Fix cast of (short|ushort|int|uint) to bool to work right

llvm-svn: 6510
2003-06-01 03:38:24 +00:00
Chris Lattner bf37f7de1b Add RR forms of test instruction
llvm-svn: 6509
2003-06-01 03:37:46 +00:00
Anand Shukla e6c3ee6b07 Add map info for arguments to call (copies)
llvm-svn: 6503
2003-06-01 02:48:23 +00:00
Chris Lattner 372086c87b Add support for shl and shr for 64 bit integer types
llvm-svn: 6499
2003-06-01 01:56:54 +00:00
Chris Lattner ea447da8a8 Add definitions for TEST instructions
llvm-svn: 6498
2003-06-01 01:56:39 +00:00
Chris Lattner 70f158330c Add new cmovne32 instruction
llvm-svn: 6496
2003-06-01 00:05:15 +00:00
Vikram S. Adve ba6f8e274a Several bug fixes: globals in call operands were not being pulled out;
globals in some other places may not have been pulled out either;
globals in phi operands were being put just before the phi instead of
in the predecessor basic blocks.

llvm-svn: 6466
2003-05-31 07:34:57 +00:00
Vikram S. Adve a83804a29a Extensive changes to the way code generation occurs for function
call arguments and return values:
Now all copy operations before and after a call are generated during
selection instead of during register allocation.
The values are copied to virtual registers (or to the stack), but
in the former case these operands are marked with the correct physical
registers according to the calling convention.
Although this complicates scheduling and does not work well with
live range analysis, it simplifies the machine-dependent part of
register allocation.

llvm-svn: 6465
2003-05-31 07:32:01 +00:00
Vikram S. Adve 96b801ab56 Reverting previous beautification changes.
llvm-svn: 6464
2003-05-31 07:27:17 +00:00
Misha Brukman bf69b7fe69 Removed useless code -- the byte order of output code is correct as is.
llvm-svn: 6462
2003-05-31 06:26:06 +00:00
Misha Brukman 23937091f0 The 'rd' register is consistently mentioned last in instruction definitions.
Created new classes from which instructions inherit their ordering of fields.

llvm-svn: 6461
2003-05-31 06:25:19 +00:00
Misha Brukman c4f029f8ba * Put back into action SLL/SRL/SRA{r,i}6 instructions
* Fixed page numbers referring to the Sparc manual

llvm-svn: 6460
2003-05-31 06:24:29 +00:00
Misha Brukman 8d5316769f Code beautification, no functional changes.
llvm-svn: 6459
2003-05-31 06:22:37 +00:00
Misha Brukman 0b3a70c25b Enabling some of these passes causes lli to break
llvm-svn: 6457
2003-05-31 04:23:04 +00:00
Misha Brukman 87cbd97710 The actual order of parameters in a 2-reg-immediate assembly instructions is
"rs1, imm, rd": most importantly, rd goes last.

llvm-svn: 6456
2003-05-31 04:22:26 +00:00
Misha Brukman 5bf351c880 Added:
* ability to save BasicBlock references to be resolved later
* register remappings from the enum values to the real hardware numbers

llvm-svn: 6449
2003-05-30 20:17:33 +00:00
Misha Brukman 0757de607a Fixed the namespace to match SparcInternals.h; added notes on some missing
sections of instructions.

llvm-svn: 6448
2003-05-30 20:15:59 +00:00
Misha Brukman 8747377292 The register types need to be visible outside of the class to be useful.
For one, converting register numbers based on class in the code emitter.

llvm-svn: 6447
2003-05-30 20:12:42 +00:00
Misha Brukman a853af587a Moved and expanded convertOpcodeFromRegToImm() to conver more opcodes.
Code beautification for the rest of the code: changed layout to match the rest
of the code base.

llvm-svn: 6446
2003-05-30 20:11:56 +00:00
Misha Brukman c1830a472a Make LLI behave just like LLC with regard to the compile passes it uses.
llvm-svn: 6444
2003-05-30 20:00:13 +00:00
Misha Brukman 39dfa6a920 Made the register and immediate versions of instructions consecutive.
llvm-svn: 6439
2003-05-30 19:14:01 +00:00
Misha Brukman f6e4dce74c Because the format of the shift instructions is `shift r, shcnt, r', the
instructions of format 3.12 and 3.13 cannot inherit from F3rdrs1, because that
implies that the two registers are the first two parameters to the instruction.

Thus I made the instructions inherit from F3rd again, and manually added an rs1
field AFTER the shcnt field in the instruction, which maps to the appropriate
place in the instruction.

The other changes are just elimination of unnecessary spaces.

llvm-svn: 6437
2003-05-30 18:06:10 +00:00
Brian Gaeke d380f29377 Makefile: Make SparcV9CodeEmitter.inc depend on SparcV9_F*.td as well.
SparcV9_F3.td: F3_12 and F3_13 instructions have rd and rs1 fields. Also,
 their fields were totally screwed up. This seems to fix the problem.

llvm-svn: 6429
2003-05-30 08:02:14 +00:00
Misha Brukman 6ada87e6eb Since there is now another derived .inc file, ignore them all.
llvm-svn: 6411
2003-05-29 20:15:27 +00:00
Misha Brukman 9175a5de53 Use an absolute path to TableGen because not everyone (e.g. automatic tester)
has their path set up by this point.

llvm-svn: 6410
2003-05-29 20:09:56 +00:00
Misha Brukman bb053cefe8 Added the target-independent part of TableGen data.
llvm-svn: 6403
2003-05-29 18:48:17 +00:00
Misha Brukman 35d5512f34 When TableGen finds an error in the SparcV9.td file, it exits with a non-zero
exit code. This, in turn, makes an empty file SparcV9CodeEmitter.inc, and only
much later, produces a link error because the key function that TableGen creates
isn't found.

Using a temporary file in the middle forces a good .INC file to be generated by
TableGen, and it will keep trying until you fix the input file.

llvm-svn: 6392
2003-05-29 05:29:22 +00:00
Misha Brukman 794c8a1334 Fixed to use the correct format of the instruction.
llvm-svn: 6390
2003-05-29 04:53:56 +00:00
Misha Brukman 376dac2eed This should work better with re-generating the SparcV9CodeEmitter.inc file.
Also, added a rule to delete the generated .inc file on `make clean'.

llvm-svn: 6389
2003-05-29 03:32:49 +00:00
Misha Brukman ea4f498395 * Broke up SparcV9.td into separate files as it was getting unmanageable
* Added some Format 4 classes, but not instructions
* Added notes on missing sections with FIXMEs
* Added RDCCR instr

llvm-svn: 6388
2003-05-29 03:31:43 +00:00
Misha Brukman fded35952a Fixed ordering of elements in instructions: although the binary instructions
list (rd, rs1, imm), in that order (bit-wise), the actual assembly syntax is
instr rd, imm, rs1, and that is how they are constructed in the instruction
selector. This fixes the discrepancy.

Also fixed some comments along the same lines and fixed page numbers referring
to where instructions are described in the Sparc manual.

llvm-svn: 6384
2003-05-28 17:49:29 +00:00
Brian Gaeke 2c35144ce5 Add dependency to make TableGen rule fire.
llvm-svn: 6383
2003-05-28 17:41:09 +00:00
Misha Brukman 07b60f8e2e Fixed an error preventing compilation.
llvm-svn: 6381
2003-05-27 22:48:28 +00:00
Misha Brukman 481dfdb523 Added the 'r' and 'i' annotations to instructions as their opcode names have
changed.

llvm-svn: 6380
2003-05-27 22:44:44 +00:00
Misha Brukman 7975661a8e Keep track of the current BasicBlock being processed so that a referencing
MachineInstr can later be patched up correctly.

llvm-svn: 6378
2003-05-27 22:41:44 +00:00
Misha Brukman af96d39c04 Added 'r' and 'i' annotations to instructions as SparcInstr.def has changed.
llvm-svn: 6377
2003-05-27 22:40:34 +00:00
Misha Brukman 96ce62a105 Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
Non-obvious change: since I have changed ST and STD to be STF and STDF to
(a) closer resemble their name (NOT assembly text) in the Sparc manual, and
(b) clearly specify that they they are floating-point opcodes,
I made the same changes in this file.

llvm-svn: 6376
2003-05-27 22:39:01 +00:00
Misha Brukman da83883ef1 Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
Here I had to make one non-trivial change: add a function to get a version of
the opcode that takes an immediate, given an opcode that takes all registers.

This is required because sometimes it is not known at construction time which
opcode is used because opcodes are passed around between functions.

llvm-svn: 6375
2003-05-27 22:37:00 +00:00
Misha Brukman 8bde6a688c Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
llvm-svn: 6373
2003-05-27 22:35:43 +00:00
Misha Brukman cb801a6884 Added entries for each of the instructions with annotations ('r' or 'i').
llvm-svn: 6372
2003-05-27 22:33:39 +00:00
Misha Brukman db69bebc89 One of the first major changes to make the work of JITting easier: adding
annotations on instructions to specify which format they are (i.e., do they take
2 registers and 1 immediate or just 3 registers) as that changes their binary
representation and hence, code emission.

This makes instructions more like how X86 defines them to be. Now, writers of
instruction selection must choose the correct opcode based on what instruction
type they are building, which they already know. Thus, the JIT doesn't have to
do the same work by `discovering' which operands an instruction really has.

As this involves lots of small changes to a lot of files in lib/target/Sparc,
I'll commit them individually because otherwise the diffs will be unreadable.

llvm-svn: 6371
2003-05-27 22:32:38 +00:00
Misha Brukman 8110439ff6 * Allow passing in an unsigned configuration to allocateSparcTargetMachine()
a default value is set in the header file.
* Fixed some code layout to make it more consistent with the rest of codebase
* Added addPassesToJITCompile() with relevant passes

llvm-svn: 6369
2003-05-27 22:24:48 +00:00
Misha Brukman 8b28140662 Moved generation of the SparcV9CodeEmitter.inc file higher in the Makefile so
that Makefile.common would see it.

llvm-svn: 6367
2003-05-27 22:04:38 +00:00
Misha Brukman 5641434438 Add prototypes to add passes to JIT compilation and code emission.
Also, added annotations to how instructions are modified (reg/imm operands).
Added prototype for adding register numbers to values pass for interfacing with
the target-independent register allocators in the JIT.

llvm-svn: 6366
2003-05-27 22:01:10 +00:00
Misha Brukman e195b7c0fc Broke out class definition from SparcV9CodeEmitter, and added ability to take a
MachineCodeEmitter to make a pass-through debugger -- output to memory and to
std::cerr.

llvm-svn: 6363
2003-05-27 21:45:05 +00:00
Misha Brukman 3e9272fb29 SparcV9CodeEmitter.cpp is a part of the Sparc code emitter. The main function
that assembles instructions is generated via TableGen (and hence must be built
before building this directory, but that's already the case in the top-level
Makefile).

Also added is .cvsignore to ignore the generated file `SparcV9CodeEmitter.inc',
which is included by SparcV9CodeEmitter.cpp .

llvm-svn: 6357
2003-05-27 20:07:58 +00:00
Misha Brukman d452b60678 Added definitions for a bunch of floating-point instructions.
llvm-svn: 6356
2003-05-27 20:03:29 +00:00
Vikram S. Adve 631006ba48 Renamed opIsDef to opIsDefOnly.
llvm-svn: 6340
2003-05-27 00:03:17 +00:00
Vikram S. Adve 8adb9944aa Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.
Moved some machine-independent reg-class code to class TargetRegInfo
from SparcReg{Class,}Info.

llvm-svn: 6339
2003-05-27 00:02:22 +00:00
Vikram S. Adve 3ee4e2a3c1 Bug fix: right shift for int divide-by-power-of-2 was incorrect for
negative values.  Need to add one to a negative value before right shift!

llvm-svn: 6334
2003-05-25 21:59:47 +00:00
Vikram S. Adve 5f36d741db Bug fix: padding bytes within a structure should go after each field!
llvm-svn: 6333
2003-05-25 21:59:09 +00:00
Vikram S. Adve 5b941461b1 Bug fix: sign-extension was not happening for C = -MININT since C == -C!
llvm-svn: 6332
2003-05-25 21:58:11 +00:00
Vikram S. Adve c9a0a1d728 Add support for compiling varargs functions.
llvm-svn: 6325
2003-05-25 15:59:47 +00:00
Misha Brukman e2402c65d0 Reword to remove reference to how things worked in the past.
llvm-svn: 6323
2003-05-24 01:08:43 +00:00
Misha Brukman d21a02ad58 Implement the TargetInstrInfo's createNOPinstr() and isNOPinstr() interface.
llvm-svn: 6320
2003-05-24 00:09:50 +00:00
Misha Brukman 39968bbc46 Cleaned up code layout; no functional changes.
llvm-svn: 6312
2003-05-23 19:20:57 +00:00
Misha Brukman c42dc745db Fixed `volatile' typo.
llvm-svn: 6266
2003-05-21 19:34:28 +00:00
Misha Brukman f865cc44ab Cleaned up code layout, spacing, etc. for readability purposes and to be more
consistent with the style of LLVM's code base (and itself! it's inconsistent in
some places.)

No functional changes were made.

llvm-svn: 6265
2003-05-21 18:48:06 +00:00
Chris Lattner 6532e427b4 * Fix divide by zero error with empty structs
* Empty structs should have ALIGNMENT 1, not SIZE 1.

llvm-svn: 6263
2003-05-21 18:08:44 +00:00
Misha Brukman 2a651d7a0e Cleaned up code layout, spacing, etc. for readability purposes and to be more
consistent with the style of LLVM's code base (and itself! it's inconsistent in
some places.)

No functional changes were made.

llvm-svn: 6262
2003-05-21 18:05:35 +00:00
Misha Brukman 352f7ac072 Namespacified `vector' and `cerr' to always use the `std::' namespace.
Eliminated `using' directives.

llvm-svn: 6261
2003-05-21 17:59:06 +00:00
Misha Brukman 56f4fa10fd Sparc instruction opcodes now all live under the `V9' namespace.
llvm-svn: 6249
2003-05-20 20:32:24 +00:00
Chris Lattner 9c105cd27f Clean up #includes
llvm-svn: 6173
2003-05-13 20:21:19 +00:00
Chris Lattner 3fa7b77ddf Make abort more explicit
llvm-svn: 6151
2003-05-12 21:16:26 +00:00
Chris Lattner d4e5409f35 Remove the assertion failure of course... doh
llvm-svn: 6150
2003-05-12 20:39:39 +00:00
Chris Lattner 5069283493 Implement casts from unsigned integers to floating point
llvm-svn: 6148
2003-05-12 20:36:13 +00:00
Chris Lattner 6c906adb73 Make error messages more useful than jsut an abort
llvm-svn: 6146
2003-05-12 20:16:58 +00:00
Chris Lattner b1eee00034 Remove wierd printout
llvm-svn: 6145
2003-05-12 20:10:12 +00:00
Chris Lattner 786bd8849a Do not insert multiple initializations for the same value in a PHI node
llvm-svn: 6113
2003-05-12 14:22:21 +00:00
Chris Lattner 74b65ee219 This blank line has GOT to go.
llvm-svn: 6057
2003-05-09 03:28:13 +00:00
Chris Lattner 93c8eddd75 Add support for Add, Sub, And, Or, & Xor constant exprs
llvm-svn: 6049
2003-05-08 20:49:25 +00:00
Chris Lattner b257aab658 Add support for variable argument functions!
llvm-svn: 6046
2003-05-08 19:44:13 +00:00
Misha Brukman 25e907dae4 Added the initial version of the TableGen description for the Sparc backend.
llvm-svn: 6021
2003-05-07 21:52:39 +00:00
Chris Lattner d964c3b9fd IMPLICIT_DEF was not the beautiful elegant solution I thought it was going
to be.  In fact, it made stuff worse.  :(

llvm-svn: 6013
2003-05-07 19:21:28 +00:00
Chris Lattner 37ffac92d5 Emit pseudo instructions to indicate that some registers are live on entrance
and exit of the function.  This fixes bug: Jello/2003-05-06-LivenessClobber.llx
and the Fhourstones benchmark

llvm-svn: 6010
2003-05-06 21:32:22 +00:00
Chris Lattner 4b1e02df8f Don't have a cow with new pseudo instructions
llvm-svn: 6009
2003-05-06 21:31:47 +00:00
Chris Lattner 8788d6e122 Add two new pseudo instructions
llvm-svn: 6008
2003-05-06 21:31:31 +00:00
Misha Brukman effa5ba1ac The Hyphenation-Adding Committee is now in session.
llvm-svn: 5986
2003-05-03 02:18:17 +00:00
Chris Lattner 3ed86610cd Eliminate use of NonCopyable so that doxygen documentation doesn't link
the Annotation classes with the noncopyable classes for no reason

llvm-svn: 5973
2003-05-01 20:28:45 +00:00
Chris Lattner 4f6cdbdf81 Remove two fields from TargetData which are target specific.
llvm-svn: 5963
2003-04-26 20:11:09 +00:00
Chris Lattner 25900cf220 The promotion rules are the same for all targets, they are set by the C standard.
llvm-svn: 5962
2003-04-26 19:47:36 +00:00
Chris Lattner 21d4509d76 IntegerRegSize is always 8 for sparc
llvm-svn: 5961
2003-04-26 19:44:35 +00:00
Chris Lattner 2a2338f1ba Fix bogus assert
llvm-svn: 5949
2003-04-25 21:58:54 +00:00
Chris Lattner b05f851d59 Whoops, 32 bit targets have _4_ byte pointers, not _32_ byte pointers!
llvm-svn: 5937
2003-04-25 06:06:43 +00:00
Chris Lattner afdf01ef62 Fix compatibility bug: X86 aligns doubles to 4 bytes, not 8!
llvm-svn: 5935
2003-04-25 06:05:57 +00:00
Chris Lattner efbae9cff1 Fix obvious type-o
llvm-svn: 5932
2003-04-25 05:23:10 +00:00
Chris Lattner e483398516 Allow for easy detection of when a "default" TargetData is created by the
passmanager, which is never the right thing to do.

llvm-svn: 5922
2003-04-25 02:50:45 +00:00
Chris Lattner 42516baf76 add a new targetdata ctor to create a target data appropriate to the module
llvm-svn: 5903
2003-04-24 19:09:05 +00:00
Chris Lattner 13cafd041a Trivial cleanup
llvm-svn: 5899
2003-04-24 18:35:51 +00:00
Chris Lattner ec6f16eae6 Fix iterator invalidation problem with cast instructions
llvm-svn: 5876
2003-04-23 17:57:48 +00:00
Chris Lattner 2670371c9a Implement the constantexpr CAST instruction correctly
llvm-svn: 5875
2003-04-23 17:22:12 +00:00
Chris Lattner 524608ab79 Add support for the Switch instruction by running the lowerSwitch pass first
llvm-svn: 5867
2003-04-23 16:24:55 +00:00
Misha Brukman dd4745241f It's "necessary"...
llvm-svn: 5848
2003-04-22 20:20:11 +00:00
Misha Brukman e569e992d8 It's "necessary" to spell "necessarily" correctly.
llvm-svn: 5833
2003-04-22 17:54:23 +00:00
Chris Lattner 5b348718df Add support for a simple constantexpr: cast of one ptr type to another
llvm-svn: 5829
2003-04-21 21:33:44 +00:00
Chris Lattner 379a8d2d1c Add new linkage types to support a real frontend
llvm-svn: 5786
2003-04-16 20:28:45 +00:00
Chris Lattner 30f40d94cc Rename -no-* to -disable-*
llvm-svn: 5642
2003-02-26 20:00:41 +00:00
Chris Lattner ae1f73b4f5 Remove wierd case that can never happen
llvm-svn: 5623
2003-02-25 20:27:09 +00:00
Chris Lattner 76e9f774dd Don't emit unneccesary branch instructions!
llvm-svn: 5328
2003-01-16 18:07:23 +00:00
Chris Lattner 4769c1bef8 Fix problem with invalidated iterator
llvm-svn: 5327
2003-01-16 18:07:13 +00:00
Chris Lattner 2f983fcce3 Implement optimization folding setcc into branch.
llvm-svn: 5324
2003-01-16 16:43:00 +00:00
Chris Lattner 8c59d64041 Add more flavors of branch instructions
llvm-svn: 5323
2003-01-16 16:42:45 +00:00
Chris Lattner b2809dc6b5 Implement code to keep the stack pointer aligned to an 8 byte boundary.
This improves the performance of the power benchmark by a few percent.
This will be neccesary for SSE code, which requires 16 byte alignment of
the stack.

llvm-svn: 5320
2003-01-16 02:20:12 +00:00
Chris Lattner 9e75444c8b Handle frame offset due to return address pushed on the stack
llvm-svn: 5319
2003-01-15 22:57:35 +00:00
Chris Lattner dea36ca100 Move sparc specific code into the Sparc backend
llvm-svn: 5317
2003-01-15 21:36:50 +00:00
Chris Lattner 4f596d7a2c Fix warnings
llvm-svn: 5316
2003-01-15 21:36:30 +00:00
Chris Lattner f9fd59148c Adjust to simpler interfaces
Eliminate dependency on RegClass.h

llvm-svn: 5315
2003-01-15 21:14:32 +00:00
Chris Lattner a23969b669 #include RegClass.h explicitly
llvm-svn: 5307
2003-01-15 19:57:07 +00:00
Chris Lattner 90fc665489 Move private header to private directory
llvm-svn: 5305
2003-01-15 19:50:44 +00:00
Chris Lattner d840ccd2e0 Prune #includes
llvm-svn: 5303
2003-01-15 19:48:13 +00:00
Chris Lattner e58cd301cd Use BuildMI more
llvm-svn: 5299
2003-01-15 19:23:34 +00:00
Chris Lattner 8145abb99e Fix bug found by regtests
llvm-svn: 5294
2003-01-15 18:11:11 +00:00
Chris Lattner 1ebaa90f48 Use BuildMI more, Create*Instruction less
llvm-svn: 5291
2003-01-15 17:47:49 +00:00
Chris Lattner 33be2a23ee X86 backend should never use addMReg
llvm-svn: 5288
2003-01-15 00:04:14 +00:00
Chris Lattner 71aa7afc27 * Elimiante a bunch of functions from InstrSelectionSupport.h, replacing users
of them with BUildMI calls instead.
* Fix def information in instructions generated by prologepilog inserter

llvm-svn: 5287
2003-01-15 00:03:28 +00:00
Chris Lattner 24c1d5e551 Rename llvm/Analysis/LiveVar/FunctionLiveVarInfo.h -> llvm/CodeGen/FunctionLiveVarInfo.h
llvm-svn: 5284
2003-01-14 23:05:08 +00:00
Chris Lattner b4d58d7f9e Rename MachineInstrInfo -> TargetInstrInfo
llvm-svn: 5272
2003-01-14 22:00:31 +00:00
Chris Lattner c49ca9ce58 Minor cleanups
llvm-svn: 5266
2003-01-14 20:32:10 +00:00
Chris Lattner cf53bcf8e4 New files
llvm-svn: 5260
2003-01-13 01:01:59 +00:00
Chris Lattner 962d5befb3 * No longer need lowerallocation pass
* Add X86 Stackifier pass
* Add peephole optimizer pass

llvm-svn: 5233
2003-01-13 00:51:23 +00:00
Chris Lattner c39dc9e648 rename FP -> fp*
llvm-svn: 5232
2003-01-13 00:50:46 +00:00
Chris Lattner 06e07162fc * Move frame and constant pool indexes to first argument of memory reference
so we can put an offset in there as well...
* Fix long/ulong stuff

llvm-svn: 5231
2003-01-13 00:50:33 +00:00
Chris Lattner 9fe3518dc0 * Some instructions take 64 bit integers, add an Arg type for it
* Add flags for different types of FP pseudo instrs

llvm-svn: 5230
2003-01-13 00:49:24 +00:00
Chris Lattner 5cc425a8e1 * Function calls clobber fp registers
* Use new M_TERMINATOR_FLAG flag
* Add ::Void flag on several instructions so def-use info is correct!
* Implement MANY FP instructions
* Finalize pseudo FP instructions
* Add set of Pseudo FP instruction description flags
* Add support for MOVim instrs
* Add support for 64 bit support instrs, like adc sbb, etc
* Add conditional move

llvm-svn: 5229
2003-01-13 00:48:46 +00:00
Chris Lattner 7878563ff9 Add support for frame and constant pool references
llvm-svn: 5228
2003-01-13 00:45:53 +00:00
Chris Lattner 61e1195e89 Move passes out to Passes.h
llvm-svn: 5227
2003-01-13 00:45:29 +00:00
Chris Lattner 888a8084b6 Add speculation
llvm-svn: 5226
2003-01-13 00:35:08 +00:00
Chris Lattner 956e8379f9 * Implement rudimentary output of the constant pool
* Implement support for MRMS?m instructions
* Add Arg64 support
* Add support for frame indexes and constant pool indexes
*

llvm-svn: 5225
2003-01-13 00:35:03 +00:00
Chris Lattner d4ba62218e * Add support for FP registers ST*
* Add support for the constant pool & constant pool indices
* Add support for MRMS?m instructions
* Fix FP Prefix emission
* Add support for global addresses and external symbols

llvm-svn: 5224
2003-01-13 00:33:59 +00:00
Chris Lattner 6c0daf795a * Adjust to use new interfaces, eliminating CurReg stuff
* Support arbitrary FP constants
* Fix bugs in frame layout for function calls and incoming arguments
* Insert copies for constant arguments to PHI nodes into the BOTTOM of
  predecessor blocks, not the top.
* Implement _floating point_ support: setcc, return, load, store, cast
* Fix several bugs in the cast instruction
* Abstract out call emission and load/store for FP
* Implement malloc/free without previous lowering pass.
* Make use of new forms of MachineOperand
* Implement _long_ support!
* Fix many bugs in FP support
* Change branch from je/jne to je/jmp
* Simplify code generated for GEP instructions

llvm-svn: 5223
2003-01-13 00:32:26 +00:00
Chris Lattner 0d5644bb6d Start renaming MachineInstrInfo -> TargetInstrInfo
llvm-svn: 5221
2003-01-13 00:26:36 +00:00
Chris Lattner f9781b59ab More renamings of Target/Machine*Info to Target/Target*Info
llvm-svn: 5204
2002-12-29 03:13:05 +00:00
Chris Lattner 42d59219c7 Rename MachineOptInfo to TargetoptInfo
Rename MachineCacheInfo to TargetCacheInfo

llvm-svn: 5203
2002-12-29 02:50:35 +00:00
Chris Lattner 83d835da2a Rename MachineOptInfo to TargetoptInfo
Rename MachineCacheInfo to TargetCacheInfo

llvm-svn: 5202
2002-12-29 02:50:33 +00:00
Chris Lattner 26c23467c5 Rename FunctionFrameInfo to MachineFrameInfo
llvm-svn: 5201
2002-12-28 21:08:28 +00:00
Chris Lattner 871e591e34 Rename MachineFrameInfo to TargetFrameInfo.h
llvm-svn: 5199
2002-12-28 21:00:25 +00:00
Chris Lattner 2ca5e23403 Put class in anonymous namespace
llvm-svn: 5197
2002-12-28 20:42:56 +00:00
Chris Lattner 0ccedc254c Eliminate unneccesary file
llvm-svn: 5191
2002-12-28 20:34:47 +00:00
Chris Lattner d2577010d5 Capture more information in ctor
llvm-svn: 5190
2002-12-28 20:34:18 +00:00