Commit Graph

436 Commits

Author SHA1 Message Date
Nate Begeman
1f4a132599 Don't hard code the offset of the saved R31 in functions with frame pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15990 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-22 08:09:17 +00:00
Nate Begeman
a96c4af7f1 Back out branchless SetCC code. While it helped a lot in some cases, it
hurt a lot in others.  Instead, improve branching version of SetCC and
Select instructions.  The old code will be in CVS should we ever need to
dig it up again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15979 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:42:14 +00:00
Chris Lattner
608034ec1a Switch from bytes to bits for alignment.
Also, change GPRC for PPC32 to align on 32-bit boundary instead of 64-bit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15975 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:14:40 +00:00
Chris Lattner
8edcd84653 Reduce uses of getRegClass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15968 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 19:51:17 +00:00
Chris Lattner
12585baf1a Fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15964 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 19:11:03 +00:00
Nate Begeman
c3306120cc Move XForm instructions over to the auto-generated asm writer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15962 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 05:56:39 +00:00
Nate Begeman
b65eadb7f5 remove some things from the todo list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15956 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 18:46:54 +00:00
Chris Lattner
f908888553 Do not register ppc64 yet, as it breaks the SparcV9 backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15955 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 18:09:18 +00:00
Nate Begeman
b47321ba2b Implement code to convert SetCC into straight line code where appropriate. Add necessary instructions for this transformation to the .td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15952 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 09:56:22 +00:00
Misha Brukman
43f20a56b2 Fix opcodes being printed in caps (the more general fix may be `AsmWriter')
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15932 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 21:56:12 +00:00
Misha Brukman
1601d9c1f0 Stack space for argument passing is 32 regardless of 32- vs. 64-bit arch.
Thanks to Nate Begeman for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15930 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 21:51:19 +00:00
Misha Brukman
983e92dc0d LR needs to be saved at 16-byte offset on a 64-bit arch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15929 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 21:36:14 +00:00
Misha Brukman
4debafbea4 On 64-bit PowerPC, pointers are 8 bytes, so parameter area offset is 48, not 24
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15928 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 21:34:05 +00:00
Misha Brukman
d2cbb871d0 This PHI has 4 additional operands, not 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15926 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 21:00:12 +00:00
Misha Brukman
95ab78af3c Use the appropriate 64-bit register description file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15922 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 19:36:57 +00:00
Misha Brukman
5e9867e71c Fix more remaining 32-bit vestiges of PowerPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15919 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 18:49:58 +00:00
Misha Brukman
cc55ad5fe9 Fix another vestige of the 32-bit PowerPC backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15918 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 16:50:30 +00:00
Misha Brukman
ab566eaa68 Correct character prepended to global symbols ('.'), use Mangler consistently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15917 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 16:33:56 +00:00
Misha Brukman
1c514ec89d * Eliminate global base register, r2 is used for that on AIX/PowerPC
* Fix bug from 32-bit PowerPC days of 2-register long split


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15916 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 16:29:25 +00:00
Misha Brukman
85aa4d0cc5 Wrap long lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15915 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 16:28:30 +00:00
Nate Begeman
1e67d4d7ba Convert casts that will have no effect into move instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15914 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 08:07:50 +00:00
Nate Begeman
81d265d692 Clean up floating point instruction selection.
Change int->float cast code to put conversion constants in constant pool.
Shorten code sequence for constant pool fp loads.
Remove LOADLoDirect/LOADLoIndirect psuedo instructions and tweak asmwriter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15913 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-19 05:20:54 +00:00
Chris Lattner
f746a7d09b Rename var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15897 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-18 02:22:55 +00:00
Misha Brukman
5069438763 This file is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15893 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 20:23:33 +00:00
Chris Lattner
69d485e646 Start using alignment output routines from AsmPrinter.
Changes to make this more similar to the X86 asmprinter

Fix overalignment of globals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15891 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 19:26:03 +00:00
Chris Lattner
5676310c5d Print comments with ;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15881 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 16:27:26 +00:00
Nate Begeman
07a73755d3 Re-fix hiding the Frame Pointer from the register allocator in functions
that have a frame pointer.  This change fixes Burg.  In addition, make
the necessary changes to floating point code gen and constant loading after
Chris Lattner's fixes to the asm writer.  These changes fix MallocBench/gs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15873 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 07:17:44 +00:00
Chris Lattner
79835d9f9f Use the emitGlobalConstant defined in AsmPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15869 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 06:37:12 +00:00
Chris Lattner
b462e47d2d New, more general, interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15866 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 06:07:43 +00:00
Misha Brukman
9e36843964 Rewrite targets/rules to generate files for just PowerPC or PPC{32,64}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15862 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:11:54 +00:00
Misha Brukman
8283ec7c1c Register classes are target-dependent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:10:31 +00:00
Misha Brukman
6316181ee0 #include <map> is not necessary here
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15860 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:09:39 +00:00
Misha Brukman
1dcddfefbd `PowerPC' is no longer a real target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15859 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:09:10 +00:00
Misha Brukman
f2f8cfb945 Move variables and methods which need PPC{32,64}* distinction to subclasses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15858 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:08:44 +00:00
Misha Brukman
66aa3e0e8b No need for an `is64bit' flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15857 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:06:47 +00:00
Misha Brukman
a2a27b3c85 PowerPCInstrInfo and PowerPCRegisterInfo have gone away; they are replaced
by 32- and 64-bit customized files, named appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15856 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:05:00 +00:00
Misha Brukman
08dde0ba85 Consistently name passed with 32 or 64 in their name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15855 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:02:58 +00:00
Misha Brukman
3d58b8f531 PowerPCRegisterInfo no longer takes a bool to differentiate 32 vs 64 bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15854 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:02:18 +00:00
Misha Brukman
db50bd3e7a The PowerPCInstrInfo class has gone away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15853 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 05:00:46 +00:00
Misha Brukman
363dd07320 PowerPCInstrInfo has gone away, PPC32 and PPC64 share opcodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15852 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 04:58:50 +00:00
Misha Brukman
adde6994ac PowerPC 32-/64-bit split: Part II, 64-bit customizations on PowerPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15851 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 04:57:37 +00:00
Misha Brukman
f2ccb77ee9 PowerPC 32-/64-bit split: Part I, PPC32* bit files, adapted from former PowerPC*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15850 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 04:55:41 +00:00
Chris Lattner
469ab79584 Print float constants as 4 byte values.
Also, fix endianness problems when cross compiling from little-endian host.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15847 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 02:48:44 +00:00
Chris Lattner
505e783d8c Make sure to put an _ prefix on all identifiers!
Also, add some (currently disabled) code to print float's as 32-bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15846 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 02:29:00 +00:00
Chris Lattner
416ca3384a More changes to make PPC32 and X86 more similar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15842 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 23:38:36 +00:00
Chris Lattner
36aacdb974 Minor changes to make the diff be nothing against the X86 version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15841 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 23:30:16 +00:00
Chris Lattner
a3840795a5 Finegrainify namespacification
Start using the AsmPrinter base class to factor out a bunch of code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15840 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 23:25:21 +00:00
Chris Lattner
b6482069f0 There is no need for a cast here
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15810 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 05:09:58 +00:00
Nate Begeman
746a49516c Update the current state of the world
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15809 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 05:06:43 +00:00
Nate Begeman
7e0fd576d3 Fix typo of the word 'implicit' I made resolving a CVS conflict. Whoops!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15808 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 02:12:49 +00:00
Nate Begeman
1cffdf0798 Fix frame pointer handling:
Reserve R0 in store/load from stack slot for building >32k offsets from SP
or FP.  This also requires we use R11 rather than R0 for holding the LR
value we want to save or restore.  Also, tell the register allocator not
to use R31 (our FP) in functions that have a frame pointer.  These changes
fix Burg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15807 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 01:52:12 +00:00
Nate Begeman
865075ed35 Fix mismatched adjust down/up of SP in functions that contain variable
sized allocas.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15806 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 01:50:22 +00:00
Chris Lattner
6ff3f83ef0 Insertion methods now return void instead of #instrs inserted. Also, use
more powerful forms of BuildMI to concisify the code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15782 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 22:15:56 +00:00
Chris Lattner
57f1b67c34 These methods no longer take a TargetRegisterClass* operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15774 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 21:56:44 +00:00
Alkis Evlogimenos
8c9b4de574 Make this compile on gc 3.4.1 (static_cast to non-const type was not
allowed).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15766 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 09:18:55 +00:00
Nate Begeman
f7bb8c0caa Add future optimization opportunity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15760 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 06:43:10 +00:00
Nate Begeman
43d64eae53 Fix float to int codepath by always allocating 8 bytes for the target of a double store; optimize cmplwi generation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15759 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 06:42:28 +00:00
Chris Lattner
08eceec98d Zimm16 is now dead. Its entry is not removed from the enum, to avoid having
to renumber everything.  Similar elimination should be applied to other
operand enum values that are only used to format printing in the .s file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15755 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 05:48:47 +00:00
Chris Lattner
0ea3171fbf Convert all of the DForm_6* operations, which makes all of the Zimm16 users
dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15754 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 05:46:14 +00:00
Chris Lattner
d15575d39f Reenable the CCRC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15752 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 05:31:15 +00:00
Chris Lattner
97b2a2e389 Convert the DForm_4 over to the asmprintergen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15751 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 05:20:16 +00:00
Nate Begeman
ad9c242605 Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15750 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 00:31:02 +00:00
Chris Lattner
7bb424fafc Print mflr using the asmwriter generator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15749 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-14 23:27:29 +00:00
Nate Begeman
ca068e861b Replace PowerPCPEI.cpp with target independant PrologEpilogInserter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15746 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-14 22:16:36 +00:00
Nate Begeman
ffde1de597 Add support for frame pointers, and large offsets from stack and frame pointers. Adopt elimination of MachineFunction& arg from eliminateFrameIndex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15745 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-14 22:13:58 +00:00
Nate Begeman
b0b8b93e58 Add indexed forms of load doubleword and load word algebraic for 64 bit targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15743 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-14 22:12:20 +00:00
Nate Begeman
6d1e2dfd86 Fix handling of FP constants with single precision, and loading of internal linkage function addresses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15742 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-14 22:11:38 +00:00
Nate Begeman
e59bf59ba5 Add initial support for using the generated asm writer. Also, fix FP constant printing to always print 8 byte intializers. Move printing of LinkOnce stubs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15741 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-14 22:09:10 +00:00
Nate Begeman
14d89d6810 Add generation of asm writer from tablegen files to Makefile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15740 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-14 22:06:38 +00:00
Nate Begeman
1c284ac5ec Remove an unneeded header and forward declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15722 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 09:33:17 +00:00
Nate Begeman
b73a711ed7 Fix siod by switching BoolTy to byte rather than int until CFE changes for
Darwin.  Also, change asm printer to output proper stubs for external
functions whose address is passed as an argument to aid in bugpointing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15721 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 09:32:01 +00:00
Nate Begeman
293d88ca8b Fix 177.mesa compilation, don't use floating point regs for base addresses!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15720 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 04:45:14 +00:00
Nate Begeman
8cfa427d9c Fix llc crasher compiling siod by giving BuildMI the correct number of arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15719 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 03:56:49 +00:00
Nate Begeman
5a104b0ec5 Longs are in one register on PowerPC 64; use appropriate instructions to operate on them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15711 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 02:20:47 +00:00
Nate Begeman
244e64ead2 Add some more 64 bit instructions we need for the PowerPC-64 ISel to the tablegen files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15710 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 02:19:26 +00:00
Misha Brukman
f5f70685b6 Disable PPC64 backend by default because LLC cannot choose automatically between
SparcV9 and PowerPC64 without target triples, since they are both 64-bit
big-endian targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15688 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-12 17:16:43 +00:00
Misha Brukman
a1b6ae9d7c * Correct 64-bit version: blr 1 (not 0)
* BuildMI() can build 0-param instructions (e.g., NOP)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15681 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-12 03:30:03 +00:00
Misha Brukman
e4d093c356 * Print out full names for non-GPR or -FPR registers
* BuildMI() really *does* handle 0 params!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15680 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-12 03:28:47 +00:00
Misha Brukman
cc6b01b1e6 * Pointers are 8 bytes, hence cLong type on 64-bit PPC
* Fix loading of GlobalValues


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15678 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-12 02:53:01 +00:00
Misha Brukman
8e63dcebcc Eliminate special-casing 14-bit immediate load/store opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15677 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-12 02:51:38 +00:00
Misha Brukman
c90f2963c4 Correctly print out ASCII literal strings on AIX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15674 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-12 01:01:13 +00:00
Misha Brukman
ef9468cfe5 Mark R2 as available for allocation on Darwin/PPC32, but not AIX/PPC64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15673 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-12 00:10:01 +00:00
Misha Brukman
1d3527edbf * Move AIX into the llvm namespace to be accessed from RegisterInfo
* Mark InstrInfo with 32 vs. 64 bit flag
* Enable the 64-bit isel and asm printer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15672 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 23:47:08 +00:00
Misha Brukman
a6ecd9ee47 Set the is64bit flag and propagate it to PowerPCRegisterInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15671 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 23:45:43 +00:00
Misha Brukman
dceb457607 * Set the is64bit boolean flag in PowerPCRegisterInfo
* Doubles are 8 bytes in 64-bit PowerPC, and use the general register class
* Use double-word loads and stores for restoring from/saving to stack
* Do not allocate R2 if compiling for AIX


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15670 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 23:44:55 +00:00
Misha Brukman
ca9309f22e 64-bit instruction selector and AIX-specific 64-bit asm printer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15669 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 23:42:15 +00:00
Misha Brukman
55eee3dc7a Fix names of 64-bit CMP*D* opcodes, add LWA and STD* opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15668 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 23:33:34 +00:00
Misha Brukman
f1f6cef161 Add support for 64-bit CMPDI, CMPLDI, and CMPLD opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15667 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 20:56:14 +00:00
Misha Brukman
96b6110685 Add doubleword load/store (64-bit only).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15665 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 15:54:36 +00:00
Misha Brukman
9582822341 Hyphenate ##-bit and remove first-person from comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15663 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 13:35:44 +00:00
Nate Begeman
7a4fe9be7e Clean up 32/64bit and Darwin/AIX split. Next steps: 64 bit ISel, AIX asm printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15662 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 07:40:04 +00:00
Chris Lattner
74a806cd3d Fix a case where constantexprs could leak into the PPC isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15661 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 07:34:50 +00:00
Nate Begeman
8d963e602b Fix 255.vortex by using getClassB instead of getClass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15648 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 03:30:55 +00:00
Misha Brukman
0145881cb9 Breaking up the PowerPC target into 32- and 64-bit subparts, Part III: the rest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15636 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 00:11:25 +00:00
Misha Brukman
c0f6420b96 Breaking up the PowerPC target into 32- and 64-bit subparts: Part II: 64-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15635 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 00:10:41 +00:00
Misha Brukman
3d9a6c2842 Breaking up the PowerPC target into 32- and 64-bit subparts, Part I: 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15634 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-11 00:09:42 +00:00
Misha Brukman
5b5708106e Renamed PPC32 (namespace for regs, opcodes) to PPC to include 64-bit targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15631 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-10 22:47:03 +00:00
Misha Brukman
698fbd5b94 * Fix file header to use tablegen emacs mode instead of c++
* Wrap long line to 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15630 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-10 21:24:44 +00:00
Nate Begeman
b64af918cb Fix casts of float to unsigned long
Replace STDX (store 64 bit int indexed) with STFDX (store double indexed)
Fix latent bug in indexed load generation
Generate indexed loads and stores in many more cases


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15626 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-10 20:42:36 +00:00
Misha Brukman
42efb87410 DForm 5/6 extended mneumonics take 3 arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15620 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-10 19:03:31 +00:00
Misha Brukman
a91f53634c Fix DForm_4: format is `op r, r, i'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15613 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-10 18:07:55 +00:00
Misha Brukman
b05daff7fa Stub definition of the PowerPC CodeEmitter class; this isn't functional (yet).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15600 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-09 23:03:59 +00:00
Misha Brukman
7103fba019 CodePrinter -> AsmPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15599 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-09 22:27:45 +00:00
Misha Brukman
8124020192 Remove ClassPrefix variable as it's no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15586 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-09 19:13:29 +00:00
Misha Brukman
929072eb04 Define a ClassPrefix for PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15580 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-09 17:46:26 +00:00
Misha Brukman
f588548a86 Generate a code emitter for PowerPC as well, this will be used in the JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15578 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-09 17:24:32 +00:00
Misha Brukman
4ad7d1bee7 Use instruction formats as defined in the PowerPC ISA manual
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15577 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-09 17:24:04 +00:00
Reid Spencer
524a60587d Fix stack size processing now that the return address isn't an implied
push onto the top of the stack like x86, which uses the local area
offset.  This will allow the removal of PowerPCPEI.cpp soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15573 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-09 01:24:32 +00:00
Chris Lattner
3ea934668b Changes commited for Nate Begeman:
Use a PowerPC specific prolog epilog inserter to control where spilled
callee save regs are placed on the stack.
Get rid of implicit return address stack slot, save return address reg
(LR) in appropriate slot
Improve code generated for functions that don't have calls or access
globals


Note from Chris: PowerPCPEI will eventually be eliminated, once the
functionality is merged into CodeGen/PrologEpilogInserter.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15536 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-06 06:58:50 +00:00
John Criswell
aaf10ab5a2 Added Louis Gerbarg. Louis is given credit in the CREDITS.TXT file, so I
assume Louis also holds copyright.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15534 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-05 23:46:27 +00:00
John Criswell
2c2ba762a3 Add additional copyright notice for the PowerPC backend.
Thanks Nate!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15531 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-05 20:36:00 +00:00
Misha Brukman
2f947865cb Simplify makefile by combining all TableGen dependencies into one variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15527 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-05 18:34:15 +00:00
Misha Brukman
dee0f9b94c Align dependencies so they don't hurt the eyes to look at them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15504 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 21:37:41 +00:00
Misha Brukman
7338ae5b88 Remove unused instruction classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15501 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 21:18:57 +00:00
Misha Brukman
db01356c15 Make tablegen targets depend on PowerPCInstrFormats.td as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15500 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 21:18:36 +00:00
Chris Lattner
6173cd9c16 getValues does not exist
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15495 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 17:29:14 +00:00
Misha Brukman
68f3459994 Remove unused opcodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15447 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-03 20:23:44 +00:00
Misha Brukman
37dcae63eb * Use simpler instruction templates to define instructions
* Fix several extended opcodes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15423 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-02 21:58:52 +00:00
Misha Brukman
c681a4e476 Replace patterns 0, 4, and 5 with simpler heirarchical definitions that use the
official PowerPC instruction format lingo: X- and D-form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15422 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-02 21:56:35 +00:00
Misha Brukman
28791dd17f Separate instruction formats from instruction definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15414 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-02 16:54:54 +00:00
Misha Brukman
88f8f9226f * Conditional save/restore of LR disabled as it's not quite correct
* sumarray2d fixed: large fixed-size alloca
* make is now compileable
* Re-organized tests to fit them under proper headings

Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15347 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-30 15:53:09 +00:00
Misha Brukman
a9c528f0aa Do not mark LR as callee-save: not quite correctly done. Patch: Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15346 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-30 15:51:51 +00:00
Misha Brukman
4ffddc5228 * Temporarily suspend LR save/restore optimization as it is not quite correct
* Implement large fixed-size allocas            Entire patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15345 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-30 15:50:45 +00:00
Chris Lattner
83660c5aed Minor corrections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15309 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 20:18:53 +00:00
Misha Brukman
8b88d906a2 Add notes on bug involving casting ulong -> double, thanks to Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15307 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:16:10 +00:00
Misha Brukman
a0af38c46a Simplify loading (un)signed constants to registers, patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15306 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:13:49 +00:00
Misha Brukman
b7697a6dd2 Remove an extra 8 byte distance penalty. Patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15305 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:13:07 +00:00
Misha Brukman
f63bc199c6 Find longs by type, not by their primitive size being 64. Patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15304 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:12:24 +00:00
Misha Brukman
8b29776d68 LI can only take signed values, so values > 32767 can only be loaded with ORI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15299 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 00:56:04 +00:00
Misha Brukman
b9b8ba58e7 Reorganize tests to place them in proper directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15298 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 00:55:12 +00:00
Misha Brukman
56d38c6ca1 UnitTests 2003-05-26-Shorts and 2003-07-09-LoadShorts have been fixed;
2003-05-22-VarSizeArray is broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15297 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 00:01:41 +00:00
Misha Brukman
af313fb188 Fix printing of immediate operands by looking at their operand types in
the TargetInstrInfo.  This fixes UnitTests 2003-05-26-Shorts and
2003-07-09-LoadShorts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15296 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 00:00:48 +00:00
Misha Brukman
8c02c1cbb8 Renamed files:
* PowerPCReg.td => PowerPCRegisterinfo.td
* PowerPCInstrs.td => PowerPCInstrInfo.td


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15295 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 23:29:16 +00:00
Misha Brukman
4ce5ce25e8 Branch selection support implemented by Nate Begeman for long branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15288 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:43:04 +00:00
Misha Brukman
ab96790f2c Correctly print out long branches, assert on finding pseudo instr COND_BRANCH
Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:40:39 +00:00
Misha Brukman
bd2c870539 Run the branch selection pass right before the asm printer.
Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15285 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:39:34 +00:00
Misha Brukman
596c23134b Remove empty unused method processFunctionBeforeFrameFinalized()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15284 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:38:40 +00:00
Misha Brukman
f228fa0580 Add COND_BRANCH pseudo instruction, patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15283 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:35:54 +00:00
Misha Brukman
fa20a6dfd7 Build COND_BRANCHes which may become long or short, decided by a later pass.
Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15282 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:35:23 +00:00
Misha Brukman
8aebe9f96c Moved definition of invertPPCBranchOpcode() into PowerPCInstrInfo class.
Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15281 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:34:11 +00:00
Misha Brukman
999d9cfde5 Add PowerPCBranchSelector to discover which are `long' branches.
Contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15280 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:33:06 +00:00
Misha Brukman
c91bc30436 Fixed saving/restoring LR unconditionally, only done as necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:17:48 +00:00
Misha Brukman
9a771d55fe Save and restore LR just like any other register and ONLY if we actually modify
it (due to calls or globals access).  We now compile `void empty(){}' to `blr'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15274 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:17:18 +00:00
Misha Brukman
e862f306fb LR is a 32-bit int reg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15273 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:15:32 +00:00
Misha Brukman
53f567817c MovePCtoLR (which is `bl' in disguise) modifies LR implicitly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15272 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:15:05 +00:00
Misha Brukman
08cc7b30bb Register LR is callee-saved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15271 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:14:34 +00:00
Misha Brukman
435c785803 Add IMPLICIT_DEF of LR for branch-and-link instrs (calls and global accesses)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15270 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:13:58 +00:00
Misha Brukman
ab640a5728 Do not store the stack pointer if the stack size is 0.
Also, convert C-style comments to C++ and make sure code wraps at 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15245 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 22:00:26 +00:00
Misha Brukman
3ada3e3f82 ADDI can take several forms, including:
addi r1, r2, 0
  addi r1, <frame index #n>, 0

so we must check for the second parameter being a register for this instruction
to be considered a reg-to-reg copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15244 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:50:38 +00:00
Misha Brukman
8790d47453 assert() on MachineInstr properties instead of checking them dynamically
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15243 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:35:58 +00:00
Misha Brukman
774a297c83 * Recognize `addi r1, r2, 0' a move instruction
* List formats of instructions currently recognized as moves


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15242 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:29:00 +00:00
Misha Brukman
b097f216b0 * Rewrote casts
* Implemented GEP folding
* Dynamically output global address stuff once per function
* Fix casting fp<->short/byte

Patch contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15237 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:13:24 +00:00
Misha Brukman
cf8d244394 Increment the label number in runOnFunction() rather than while printing out
some instruction.  Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15236 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:28:33 +00:00
Misha Brukman
bb966a4a59 More notes on bugs, unimplemented features, and suggested code improvements.
Written by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15235 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:23:55 +00:00
Misha Brukman
3c616b45e7 Fix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15234 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:22:52 +00:00
Misha Brukman
1be339ac4c Running list of bugs, unimplemented features, currently broken tests, until we
have a nightly tester set up for PowerPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15147 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 22:37:22 +00:00
Misha Brukman
4722544855 Eliminate spurious empty space; make code easier to page through.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15146 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 22:35:49 +00:00
Misha Brukman
1245c35935 Simplify boolean test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15145 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 21:43:26 +00:00
Misha Brukman
b160d1f9f7 Implement casting a floating point to 32-bit unsigned value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15143 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 20:32:59 +00:00
Misha Brukman
e2eceb5c73 * Codegen of GEPs dramatically improved by folding multiplies and adds
* Function pointers implemented correctly using appropriate stubs

Contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15133 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 16:08:20 +00:00
Misha Brukman
9accb24c89 Bool alignment on MacOSX/PowerPC is 4 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15122 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 01:11:46 +00:00
Misha Brukman
4c14f33844 * Change class of BoolTy back to cInt
* Fix indentation back to 2 spaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15121 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 01:11:19 +00:00
Misha Brukman
2ed17cadb4 * Change bool from cInt to cByte (for now)
* Don't allow negative immediates to users of unsigned immediates
* Fix long compares
* Support <const int>, op as a potential immediate candidate
* Fix sign extension of short and byte loads
* Fix and improve integer casts
* Fix passing of doubles as vararg functions

Patch contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15109 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-22 15:58:04 +00:00
Misha Brukman
a31f1f7cb2 * Add the lost fix to define the second reg of a 2-reg representation of longs
* Fix opcode RLWNM -> RLWINM since it uses an immediate const shift value


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 20:30:18 +00:00
Misha Brukman
17a9000ac8 * Speed up canUseAsImmediateForOpcode() by comparing Operand before
dyn_cast<>ing and checking Constant's value
* Convert tabs to spaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15086 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 20:22:06 +00:00
Misha Brukman
97a296f743 * Fix printing of signed immediate values (Nate Begeman)
* Fix printing of `zeroinitializer'
* Fix printing of `linkonce' globals, complete with stubs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 20:11:11 +00:00
Misha Brukman
1013ef5228 * Fix printing of signed immediate values
* Generation of opcodes that take 16 bit immediates
* Rewrote multiply to be correct for 64 bit values
* Rewrote all the long handling to be correct for PowerPC
* Fix visitSelectInst() to define the upper register of the pair of regs
  representing a long value

Patch contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15083 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 20:09:08 +00:00
Misha Brukman
e0380e0c42 Use addSImm() instead of addImm() for stack offsets, which may be negative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15081 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 19:36:57 +00:00
Misha Brukman
53d9a48855 Add SUBI instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15077 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 15:53:04 +00:00
Misha Brukman
cd2273f4a7 Shorts are aligned to 2 bytes, bools to 1 byte (in structs).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 20:59:57 +00:00
Misha Brukman
bf417a6d46 Treat external variables similarly to those with weak linkage: load indirect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15047 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 20:43:05 +00:00
Misha Brukman
86ddcf9d4f Differentiate between global and weak symbol loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15037 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 15:52:25 +00:00
Misha Brukman
ec6319a00c * Differentiate between global and weak symbol loads
* Fix functions that take more than 32 bytes of args
* Alignment of doubles in structs is 4 bytes, not 8
* Fix passing long args: rN = hi, rN+1 = lo
* Rewrite signed divide
* Rewrite Intrinsic::returnaddress

Patch courtesy of Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15036 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 15:51:37 +00:00
Misha Brukman
e48178e8a6 Differentiate between global and weak symbol loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15035 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 15:45:27 +00:00
Misha Brukman
5c4544160f Double alignment in structs is 4 bytes, not 8. Patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15034 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 15:43:25 +00:00
Misha Brukman
d43b9fd1ae Fix stack frame layout in prologue/epilogue. Patch courtesy of Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15026 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 02:23:09 +00:00
Misha Brukman
ba1c1da36a Move handing of GlobalValues from getReg() to copyConstantToRegister(), this
will avoid extra register-to-register copies.  Thanks to Chris for the idea.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15019 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:59:38 +00:00
Misha Brukman
61114619bc * Fn args passed in registers are now recorded as used by the call instruction
`-> asm printer updated to not print out those registers with the call instr

All of Shootout tests now work.  Great thanks to Nate Begeman for the patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15015 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:42:19 +00:00
Misha Brukman
7e898c3e04 * cFP class split into cFP32 and cFP64
* Fn args passed in registers are now recorded as used by the call instruction
`-> asm printer updated to not print out those registers with the call instr
* Stack frame layout in prolog/epilog fixed, spills and vararg fns now work
* float/double to signed int codegen now correct
* various single precision float codegen bugs fixed
* const integer multiply codegen fixed
* select and setcc blocks inserted into the correct place in machine CFG
* load of integer constant code optimized

All of Shootout tests now work.  Great thanks to Nate Begeman for the patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15014 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:41:46 +00:00
Chris Lattner
a51e4f6301 Fix infinite loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14971 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 18:45:01 +00:00
Chris Lattner
67910e1eb0 CPR Fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14961 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 07:29:35 +00:00
Misha Brukman
a57b76fece We don't really need to #include IPO.h into this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14911 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 18:37:46 +00:00
Misha Brukman
bebde759e5 * Use LI(S) to copy constants into registers intead of ADDI(S) as the latter is
a funky way to "use" R0 for a 0-valued operand
* Add IMPLICIT_DEFs for incoming function arguments via registers to help the
  register allocator not clobber those registers
* Implement comparisons with longs
* Teach emitSelectOperation() to fold the SetCC operation

Patch contributed by Nate Begeman


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14901 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 21:06:24 +00:00
Misha Brukman
af7f28cdac * Store all non-volatile int registers R13-31 on the stack, restore on exit
* Fix comment formatting


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14900 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:55:20 +00:00
Misha Brukman
be15f67af7 Fix code formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14899 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:54:25 +00:00
Misha Brukman
01d46e9c55 Implement PowerPCInstrInfo::isMoveInstr(), patch by Nate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14898 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:51:55 +00:00
Misha Brukman
6b4ea88e83 Add prototype for TargetInstrInfo::isMoveInstr()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14897 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:50:55 +00:00
Misha Brukman
86fd274790 * Enable allocation of registers r2-r10
* Allocate registers 13-31 backwards (to be able to store them all at once)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14896 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:35:20 +00:00
Misha Brukman
2bf5438931 Add IMPLICIT_DEFS pseudo-instruction; patch by: Nate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14895 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:33:41 +00:00
Misha Brukman
039ba763d1 The generated instruction selector isn't (yet) functional
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14894 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:31:13 +00:00
Misha Brukman
da2b13f694 * Output non-lazy linking stubs for external global variables
* Get rid of dead and #if 0'd code
* Minor for loop speed-up: save end iterator instead of querying every time


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14893 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:29:04 +00:00
Misha Brukman
6f14ad1ca0 Define double alignment as 8 bytes now that assert(DoubleAlignment == PointerSize)
has been eliminated


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14891 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 19:32:12 +00:00
Misha Brukman
29188c6ff6 * Add spaces between words and numbers in comments printed out for longs/floats
* Print out IMPLICIT_DEFS as comments in the assembly, patch by Nate Begeman


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14890 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 19:01:13 +00:00
Chris Lattner
81d54465d9 The powerpc is now gone. However it is now just known as the Skeleton target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14877 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 07:14:34 +00:00
Chris Lattner
017fdcb76d Revert stuff that I didn't mean to checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:33:38 +00:00
Chris Lattner
76e2df2645 Patches towards fixing PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14841 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:14:30 +00:00
Misha Brukman
5f8cce1348 Make sure MTSPR instruction is inserted into the BasicBlock
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14822 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 18:26:31 +00:00
Misha Brukman
32caa8de62 Don't define the same register twice when loading a ConstantPointerRef to a reg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14819 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 17:57:04 +00:00
Misha Brukman
8d442c2dc4 * Fix multiplication by powers of two and otherwise
* Clarify variable name (StoreInst SI instead of LI)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14818 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 15:29:51 +00:00
Misha Brukman
a596f8c3aa * Specify that FP arith options have 3 operands
* Correctly load FP constants from the constant pool, should be refactored


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14799 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 15:35:45 +00:00