1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 14:02:52 +02:00
Commit Graph

1874 Commits

Author SHA1 Message Date
Brian Gaeke
b92c136437 Add M_TERMINATOR_FLAG to terminator instructions (branches and returns).
Also, the RETURN instructions are not used in the sparcv9 backend.

llvm-svn: 14559
2004-07-02 04:57:37 +00:00
Brian Gaeke
62ceddefe8 RETURN instructions are not used in the sparc backend.
When in doubt, stamp it out!!

llvm-svn: 14558
2004-07-02 04:57:35 +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
Chris Lattner
3fd0ea69f6 Handle targets where alignment can be bigger than the size of the data.
Contributed by Vladimir Prus!

llvm-svn: 14534
2004-07-01 17:32:59 +00:00
Misha Brukman
a691e0bff7 Fix indentation to be 2 spaces.
llvm-svn: 14512
2004-06-30 22:11:03 +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
010e07078b visitSetCondInst() takes a parameter of type `SetCondInst'
llvm-svn: 14508
2004-06-30 21:47:40 +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
9e015dddb8 Fix associativity of parameters to assert(): now it actually makes sense.
llvm-svn: 14483
2004-06-29 19:43:20 +00:00
Misha Brukman
b3e4179f42 Convert tabs to spaces.
llvm-svn: 14482
2004-06-29 19:28:53 +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
Chris Lattner
2abf0134d0 I believe that the code generator now properly handles dead basic blocks. If not,
this is a bug, and should be fixed.

llvm-svn: 14476
2004-06-29 07:17:12 +00:00
Chris Lattner
cd1a39bbec Fix a regression from r1.224. In particular, codegen a cast from double ->
float as a truncation by going through memory.  This truncation was being
skipped, which caused 175.vpr to fail after aggressive register promotion.

llvm-svn: 14473
2004-06-29 00:14:38 +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
Brian Gaeke
92bba4c696 Allow saving and restoring of double and float registers.
Allow copying of float registers.

llvm-svn: 14445
2004-06-27 22:59:56 +00:00
Brian Gaeke
6edb16d8cd Add FITOS, FITOD, and F{ADD,SUB,MUL,DIV}{S,D}.
llvm-svn: 14444
2004-06-27 22:53:56 +00:00
Brian Gaeke
5b14de32c6 Support printing constant pool indices.
If we see an "unknown operand", abort so it's easier to fix it.

llvm-svn: 14441
2004-06-27 22:50:44 +00:00
Brian Gaeke
0cee4d2fb9 Trim whitespace.
Support cast of ints (and narrower) to float and double.
Support cast double to double (using load and store).
Abort if we see a CallInst or SetCondInst with long/fp args, instead
of producing bad code.
Support add, sub, mul, div of float and double.

llvm-svn: 14440
2004-06-27 22:47:33 +00:00
Chris Lattner
680ff7de4a There is no reason to print ValueType here
llvm-svn: 14425
2004-06-26 19:36:34 +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
Tanya Lattner
da38dc5180 Made a fix so that you can print out MachineInstrs that belong to a MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function.
llvm-svn: 14389
2004-06-25 00:13:11 +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
57b3f07b31 * LowercaseString moved to StringExtras.h
* Wrap long line to 80 cols

llvm-svn: 14382
2004-06-24 23:38:20 +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
Brian Gaeke
67fe35225a Add FSTOD and FDTOS conversion instructions.
llvm-svn: 14372
2004-06-24 21:22:09 +00:00
Brian Gaeke
8ce4fc5917 Support cast float to float, cast double to float, and cast float to double.
(It's not yet clear how to copy doubles from register to register.)

llvm-svn: 14371
2004-06-24 21:22:08 +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
Brian Gaeke
003a4a500c Make the double-fp pseudo registers be "NamedRegs".
llvm-svn: 14366
2004-06-24 09:23:21 +00:00
Brian Gaeke
2e0d04003c Fix a dyn_cast in copyConstantToRegister which should have been a cast.
Compactify the code that emits copies of constant ints into registers.

llvm-svn: 14365
2004-06-24 09:17:47 +00:00
Brian Gaeke
734c654e50 The long integer pseudo-regs are history. So long, we hardly knew ye.
llvm-svn: 14364
2004-06-24 08:55:21 +00:00
Brian Gaeke
9a7eca6c51 Use correct add*Imm form in more BuildMI calls.
Fix bug in emitGEPOperation where we weren't passing MBB, IP to getReg.
(hey, wouldn't a constant expression lowering pass be cool? huh huhuhuh)
Fix bug in emitGEPOperation where we might try to OR a constant into a
register which was too big to fit in the immediate field.
Support and, or, xor of longs.

llvm-svn: 14363
2004-06-24 08:55:09 +00:00
Brian Gaeke
99b4ee166c Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.

llvm-svn: 14362
2004-06-24 07:37:12 +00:00
Brian Gaeke
8f0aac675d Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.
Add fp stores.

llvm-svn: 14361
2004-06-24 07:36:59 +00:00
Brian Gaeke
e39ef4e8b9 Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.
Stub out the case analysis of int-to-fp casts (no code yet).
I think the number of operands passed to BuildMI for loads was wrong.
Support load and store of float and double.

llvm-svn: 14360
2004-06-24 07:36:48 +00:00
Brian Gaeke
236ef1542c Strange as it may sound, we'll not use LDD/STD to store longs. For reasons of
representational consistency, we want to address the halves of each 64-bit value
separately.

llvm-svn: 14356
2004-06-24 06:44:57 +00:00
Brian Gaeke
ac14491ad0 Support constant cast expressions.
llvm-svn: 14355
2004-06-24 06:33:00 +00:00
Brian Gaeke
908208bc50 Make the most commonly preselected instructions add to the names of the
instructions they augment, instead of replacing them.  It's good for debugging,
and it's OK for the sparcv9 backend.

llvm-svn: 14353
2004-06-23 21:41:32 +00:00
Brian Gaeke
771e52d494 Add pseudo-registers and register class for 64-bit integer values.
llvm-svn: 14332
2004-06-22 20:14:41 +00:00
Misha Brukman
6a0ace201c Order #includes as per style guide.
llvm-svn: 14305
2004-06-21 21:54:40 +00:00
Misha Brukman
1c33cc1ad1 Direct declaration of namespace-ified globals does not work, must enclose
them with a namespace declaration.

llvm-svn: 14303
2004-06-21 21:44:12 +00:00
Misha Brukman
c66135f976 Specify variables' namespace directly instead of using an enclosing namespace.
llvm-svn: 14302
2004-06-21 21:21:49 +00:00
Misha Brukman
53df2fe9e7 Move implemented interface header up to the top.
llvm-svn: 14301
2004-06-21 21:20:23 +00:00
Misha Brukman
ae07b686fa Spell out `NoFramePointerElim'.
llvm-svn: 14300
2004-06-21 21:18:48 +00:00
Misha Brukman
e38f7ed2cc Spell out `NoFramePointerElim' for readability.
llvm-svn: 14299
2004-06-21 21:17:44 +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
2f580c043c Implement `NoFPElim' in a target-agnostic fashion so it can be shared.
llvm-svn: 14297
2004-06-21 21:08:45 +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
Chris Lattner
cc465361d9 Move the IntrinsicLowering header into the CodeGen directory, as per PR346
llvm-svn: 14266
2004-06-20 07:49:54 +00:00
Brian Gaeke
26336244f5 .zero doesn't work in the Solaris assembler.
llvm-svn: 14231
2004-06-18 08:59:16 +00:00
Brian Gaeke
6a8de685b3 Get rid of selects the easy way
llvm-svn: 14230
2004-06-18 08:46:15 +00:00
Brian Gaeke
a9daa0a519 Make visitAllocaInst() look more like its X86 counterpart.
llvm-svn: 14229
2004-06-18 08:45:52 +00:00
Brian Gaeke
ab4687b176 Mess around with allocation order. In particular, I think we ought to be
using the local & in regs first because they are not clobbered by calls.

llvm-svn: 14228
2004-06-18 08:19:08 +00:00
Brian Gaeke
f5697cf56c JMPL has a delay slot.
llvm-svn: 14227
2004-06-18 08:18:54 +00:00
Brian Gaeke
2a5dec63a6 Clean up the commented-out F3_3 stuff.
Replace it with a working class for FP instrs.

llvm-svn: 14226
2004-06-18 06:28:21 +00:00
Brian Gaeke
01309de73d Fix jmpl.
Add some FP moves.

llvm-svn: 14225
2004-06-18 06:28:10 +00:00
Brian Gaeke
c045f38dcb Support printing base+offset pairs where the offset is a register.
Use this for printing the jmpl indirect-call instruction.

llvm-svn: 14224
2004-06-18 06:27:59 +00:00
Brian Gaeke
92a3e14ac4 Support intrinsic calls (although no particular intrinsics are supported yet).
Support indirect calls.
Support returning a float value.

llvm-svn: 14223
2004-06-18 06:27:48 +00:00
Brian Gaeke
c5f1146e62 Add load instructions for floating-point registers.
llvm-svn: 14217
2004-06-18 05:19:27 +00:00
Brian Gaeke
7a618842f1 Support alloca instructions.
Support copying floating-point constants to registers.
Add assertion to visitCallInst to abort if we hit a NULL calledFunction, for now.

llvm-svn: 14216
2004-06-18 05:19:16 +00:00
Chris Lattner
9e1bbe86ba Codegen sub C, X a little bit better for register pressure. Instead of
mov REG, C
sub REG, X

generate:

neg X
add X, C

which uses one less reg

llvm-svn: 14213
2004-06-18 00:50:37 +00:00
Chris Lattner
a5750b975a Fold setcc instructions into select and branches that are not in the same BB as
the setcc.

llvm-svn: 14212
2004-06-18 00:29:22 +00:00
Brian Gaeke
b824469b44 Make storeRegToStackSlot slightly shorter.
Make copyRegToReg return 1 instead of -1.
Edit a comment in emitPrologue().

llvm-svn: 14211
2004-06-17 22:34:48 +00:00
Brian Gaeke
9a0dc64af6 Set the isBranch and isTerminator flags on branch instructions correctly.
Add a FIXME about the (currently unused) JMPL instructions.

llvm-svn: 14210
2004-06-17 22:34:29 +00:00
Brian Gaeke
c82f209e72 Emit stores correctly; don't fail an assertion.
llvm-svn: 14209
2004-06-17 22:34:19 +00:00
Brian Gaeke
d084a534a2 Support generating machine instructions for Phi nodes (based on x86, but with
modifications for 1 LLVM BB --> many MBBs).
Fix store operand order: make it always be Base, Offset, SrcReg (think
"[ Base + Offset ] = SrcReg").
Rewrite visitBranchInst() to be even dumber (but working) -- give up on
the branch fallthrough trick, for the time being.
Make visitSetCondInst() work.

llvm-svn: 14208
2004-06-17 22:34:08 +00:00
Brian Gaeke
af2408a4ee Recognize more branches.
llvm-svn: 14207
2004-06-17 22:33:57 +00:00
Chris Lattner
f815117481 Do not fold loads into instructions if it is used more than once. In particular
we do not want to fold the load in cases like this:

  X = load
    = add A, X
    = add B, X

llvm-svn: 14204
2004-06-17 22:15:25 +00:00
Brian Gaeke
7d711d517b Use addGlobalAddress and addMBB for call & branch targets instead of addPCDisp.
Abort if we see a PCRelativeDisp MachineOperand, to be safe. This matches
the X86 backend.

llvm-svn: 14202
2004-06-17 19:39:23 +00:00
Chris Lattner
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Chris Lattner
9bb0083d16 Remove support for llvm.isnan. Alkis wins :)
llvm-svn: 14189
2004-06-15 21:48:07 +00:00
Chris Lattner
d11493d8c4 Add basic support for the isunordered intrinsic. The isnan stuff still needs to go
llvm-svn: 14185
2004-06-15 21:36:44 +00:00
Brian Gaeke
0a7b268b1a Fix thinko in visitor... ShiftInsts should currently be delegated
to visitBinaryOperator.

llvm-svn: 14182
2004-06-15 21:09:46 +00:00
Brian Gaeke
5fe5e06bea I think we'll use the standard lowering passes for now.
llvm-svn: 14179
2004-06-15 20:37:12 +00:00
Brian Gaeke
d5f45ba4a1 Fix bug generating code for void call instructions: don't call
getReg() on void value.

llvm-svn: 14178
2004-06-15 20:06:32 +00:00
Brian Gaeke
79008f4648 Squash a warning from the Solaris assembler by aligning the stack
on a double-word boundary instead of a single-word boundary.

llvm-svn: 14177
2004-06-15 19:53:10 +00:00
Brian Gaeke
e02c780919 Allow special-casing of operand printing based on opcode. Print
non-register, non-immed. arguments to SETHI and OR using %hi() and
%lo() respectively.

llvm-svn: 14176
2004-06-15 19:52:59 +00:00
Brian Gaeke
b158cb6411 Support constant GEP expressions.
Support copying long constants to register pairs.
Support copying ConstantPointerNulls and ConstantPointerRefs to registers.

llvm-svn: 14175
2004-06-15 19:16:07 +00:00
Misha Brukman
130e02f232 Add file comment.
llvm-svn: 14172
2004-06-14 15:13:59 +00:00
Brian Gaeke
21e2dd53d8 Make -print-machineinstrs even stronger. You get to see the final code after
peepholing, and make it work the same way in the JIT as in LLC.

llvm-svn: 14170
2004-06-14 05:05:45 +00:00
Chris Lattner
3a8e675c03 By far, one of the most common uses of isnan is to make 'isunordered'
comparisons.  In an 'isunordered' predicate, which looks like this at
the LLVM level:

        %a = call bool %llvm.isnan(double %X)
        %b = call bool %llvm.isnan(double %Y)
        %COM = or bool %a, %b

We used to generate this code:

        fxch %ST(1)
        fucomip %ST(0), %ST(0)
        setp %AL
        fucomip %ST(0), %ST(0)
        setp %AH
        or %AL, %AH

With this patch, we generate this code:

        fucomip %ST(0), %ST(1)
        fstp %ST(0)
        setp %AL

Which should make alkis happy.  Tested as X86/compare_folding.llx:test1

llvm-svn: 14148
2004-06-11 05:33:49 +00:00
Chris Lattner
f78e3e7f63 Fix bug in previous checkin
llvm-svn: 14146
2004-06-11 05:22:44 +00:00
Chris Lattner
7d8093efb1 No really, these are dead now
llvm-svn: 14145
2004-06-11 04:50:14 +00:00
Chris Lattner
a8e603b719 Now that compare instructions aren't lumped in with the other twoargfp instructions,
we can get rid of the FpUCOM/FpUCOMi pseudo instructions, which makes stuff simpler
and faster.

llvm-svn: 14144
2004-06-11 04:49:02 +00:00
Chris Lattner
b050f778ca Introduce a new FP instruction type to separate the compare cases from the
twoarg cases.

llvm-svn: 14143
2004-06-11 04:41:24 +00:00
Chris Lattner
edb06042b9 Add direct support for the isnan intrinsic, implementing test/Regression/CodeGen/X86/isnan.llx
testcase

llvm-svn: 14141
2004-06-11 04:31:10 +00:00
Chris Lattner
4c8b57ea31 Add support for the setp instructions
llvm-svn: 14140
2004-06-11 04:30:06 +00:00
Chris Lattner
c66e996765 Split compare instruction handling OUT of handleTwoArgFP into handleCompareFP.
This makes the code much simpler, and the two cases really do belong apart.
Once we do it, it's pretty obvious how flawed the logic was for A != A case,
so I fixed it (fixing PR369).

This also uses freeStackSlotAfter instead of inserting an fxchg then
popStackAfter'ing in the case where there is a dead result (unlikely, but
possible), producing better code.

llvm-svn: 14139
2004-06-11 04:25:06 +00:00
Brian Gaeke
c5bb88c934 Turn loads of ConstantPointerNulls into loads of zero... don't spill
them into the constant pool.

llvm-svn: 14128
2004-06-11 02:03:48 +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
Brian Gaeke
9cf9c6e184 Encode %fsr correctly; don't fail an assertion.
llvm-svn: 14103
2004-06-09 21:54:59 +00:00
Brian Gaeke
badbc7476a Fix encoding of ST*FSR instructions.
llvm-svn: 14102
2004-06-09 21:54:58 +00:00
Brian Gaeke
8e446cf7a2 Fix assertion failure message to have the right method name.
llvm-svn: 14101
2004-06-09 20:44:42 +00:00
John Criswell
287e3fc88b Fix for PR#366. We use getClassB() so that we can handle cast instructions
that cast to bool.

llvm-svn: 14096
2004-06-09 15:18:51 +00:00
Brian Gaeke
91a3d0f55f Fix a minor bug in the map - since this pass adds a global symbol, it must be
accounted for in the map (at least, in its current format).

llvm-svn: 14075
2004-06-08 20:08:30 +00:00
Brian Gaeke
4b0b12c188 Add a TmpInstruction ctor that doesn't take a MCFI.
llvm-svn: 14073
2004-06-08 18:52:46 +00:00
Brian Gaeke
c6715bec89 Fix up some spacing & fix a typo in an assertion in cpValue2Value.
llvm-svn: 14027
2004-06-04 20:51:40 +00:00
Chris Lattner
c51b272047 This file is obsolete
llvm-svn: 14005
2004-06-04 00:15:21 +00:00
Brian Gaeke
4f0fc86456 Add new internal-global-symbol mapping info pass... may its life be short
and sweet.

llvm-svn: 13983
2004-06-03 05:03:37 +00:00
Brian Gaeke
e3a1c92896 Add new mapping info pass, when EmitMappingInfo is on.
llvm-svn: 13981
2004-06-03 05:03:01 +00:00
Brian Gaeke
ceb3e78152 Fix big mistake in my last checkin... the big question is, how did I ever
get this to link before?

llvm-svn: 13980
2004-06-03 05:03:00 +00:00
Brian Gaeke
a960c641e0 Add decl. for new mapping info pass factory method.
llvm-svn: 13979
2004-06-03 05:02:59 +00:00
Brian Gaeke
e3e792cefa Collapse together the abstract superclass TargetRegInfo and SparcV9RegInfo, its
only concrete implementation.

llvm-svn: 13977
2004-06-03 02:45:09 +00:00
Chris Lattner
42730da855 <alloca.h> on cygwin pulls in a ton of stuff (macros and function protos)
that we REALLY don't want in the CBE code.

With this fix, the CBE passes all of the MultiSource tests on cygwin that
it does on linux.  Yaay!

llvm-svn: 13975
2004-06-02 23:10:26 +00:00
Chris Lattner
74da010962 Adjust to new TM interface
llvm-svn: 13954
2004-06-02 05:56:04 +00:00
Chris Lattner
ccfec9c7fd Method has been inlined into all callers
llvm-svn: 13953
2004-06-02 05:55:48 +00:00
Chris Lattner
5ad9eaab1a Convert to the new TargetMachine interface.
llvm-svn: 13952
2004-06-02 05:55:25 +00:00
Chris Lattner
4e2777cb30 Stubs are no longer needed
llvm-svn: 13951
2004-06-02 05:53:52 +00:00