1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 22:42:46 +02:00
Commit Graph

184 Commits

Author SHA1 Message Date
Chris Lattner
65c5f1b9e0 On 64-bit targets like ppc64, we should use .quad to output pointer directives,
not .long.

llvm-svn: 29157
2006-07-15 01:34:12 +00:00
Evan Cheng
6ec6e10b48 Add support to print 4-, 8-, and 16- byte constant literals in special
sections. e.g. On Darwin that would be .literal4 and .literal8.

llvm-svn: 28977
2006-06-29 00:26:09 +00:00
Jim Laskey
0dc7ed966c Was pointed out that structure alignment and type alignment are not the same
thing.  Doubles still need to be special cased.

llvm-svn: 28806
2006-06-15 19:37:14 +00:00
Jim Laskey
61655f779a Alignment of globals has not been quite right. Needed to drop the pointer type
to get the alignment of the element type.

llvm-svn: 28799
2006-06-15 13:10:58 +00:00
Evan Cheng
459add845e Assert. Rather than silently stop printing.
llvm-svn: 28794
2006-06-15 08:10:56 +00:00
Chris Lattner
8affee249a Fix an assert-on-inline-inline-asm bug.
llvm-svn: 28727
2006-06-08 18:00:47 +00:00
Chris Lattner
90527550c1 Remove dead var
llvm-svn: 28250
2006-05-12 17:50:35 +00:00
Owen Anderson
29e4d70aed Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.

llvm-svn: 28238
2006-05-12 06:33:49 +00:00
Chris Lattner
486e0660b7 Fix a regression in my patch from last night that broke the llvmgcc4 build on
ppc

llvm-svn: 28205
2006-05-09 16:41:59 +00:00
Chris Lattner
b7152b0b42 Implement MASM sections correctly, without a "has masm sections flag" and a bunch of special case code.
llvm-svn: 28194
2006-05-09 05:33:48 +00:00
Chris Lattner
28fe830b3b Oh yeah, there are two of these now, unify both.
llvm-svn: 28192
2006-05-09 05:24:50 +00:00
Chris Lattner
d2aea9851e Setting SwitchToSectionDirective properly in the MASM backend permits a bunch
of code to be unified.

llvm-svn: 28191
2006-05-09 05:23:12 +00:00
Chris Lattner
830bed591e Don't prefix section directives with a tab. Doing so causes blank lines to
be emitted to the .s file.

llvm-svn: 28189
2006-05-09 05:19:59 +00:00
Chris Lattner
baefeb1e09 Make the masm codepath work like the normal code path.
llvm-svn: 28188
2006-05-09 05:15:58 +00:00
Chris Lattner
6ede576b55 The MASM asmprinter has been fixed, these hacks are no longer needed.
llvm-svn: 28186
2006-05-09 05:13:34 +00:00
Chris Lattner
f45b6d5c08 Split SwitchSection into SwitchTo{Text|Data}Section methods.
llvm-svn: 28184
2006-05-09 04:59:56 +00:00
Jeff Cohen
248e133255 Fix some loose ends in MASM support.
llvm-svn: 28148
2006-05-06 21:27:14 +00:00
Chris Lattner
06cb36074a Indent multiline asm strings more nicely
llvm-svn: 28132
2006-05-05 21:47:05 +00:00
Owen Anderson
71bc529dfa Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.

llvm-svn: 28074
2006-05-03 01:29:57 +00:00
Nate Begeman
2a81b6be22 Print function number instead of name
llvm-svn: 28057
2006-05-02 17:36:46 +00:00
Nate Begeman
05174045df Extend printBasicBlockLabel a bit so that it can be used to print all
basic block labels, consolidating the code to do so in one place for each
target.

llvm-svn: 28050
2006-05-02 05:37:32 +00:00
Jeff Cohen
a35a8a5f9c De-virtualize SwitchSection.
llvm-svn: 28047
2006-05-02 03:58:45 +00:00
Jeff Cohen
b257253098 De-virtualize EmitZeroes.
llvm-svn: 28046
2006-05-02 03:46:13 +00:00
Jeff Cohen
ec0f5808a1 Make Intel syntax mode friendlier to Microsoft ML assembler (still needs more work).
llvm-svn: 28044
2006-05-02 01:16:28 +00:00
Chris Lattner
bce271e829 Format #APP lines a bit nicer
llvm-svn: 28026
2006-05-01 04:11:03 +00:00
Nate Begeman
7ed816f900 JumpTable support! What this represents is working asm and jit support for
x86 and ppc for 100% dense switch statements when relocations are non-PIC.
This support will be extended and enhanced in the coming days to support
PIC, and less dense forms of jump tables.

llvm-svn: 27947
2006-04-22 18:53:45 +00:00
Jim Laskey
91d5ce2531 Use "llvm.metadata" section for debug globals. Filter out these globals in the
asm printer.

llvm-svn: 26599
2006-03-07 22:00:35 +00:00
Evan Cheng
7d66f13ccf Move #include "llvm/CodeGen/AsmPrinter.h" to top since it's the interface.
llvm-svn: 26493
2006-03-03 02:04:29 +00:00
Evan Cheng
e99e63bfc8 Don't print llvm constant in assmebly file. Assembler won't like comments that
span multiple lines.

llvm-svn: 26463
2006-03-01 22:18:09 +00:00
Chris Lattner
e2b0023f4e Use the PrintAsmMemoryOperand to print addressing modes.
llvm-svn: 26364
2006-02-24 20:21:58 +00:00
Chris Lattner
22356863a0 Pass all the flags to the asm printer, not just the # operands.
llvm-svn: 26362
2006-02-24 19:50:58 +00:00
Chris Lattner
b4951fbe82 Record all of the expanded registers in the DAG and machine instr, fixing
several bugs in inline asm expanded operands.

llvm-svn: 26332
2006-02-23 19:21:04 +00:00
Chris Lattner
c81f375f21 Adjust to MachineConstantPool interface change: instead of keeping a
value/alignment pair for each constant, keep a value/offset pair.

llvm-svn: 26078
2006-02-09 04:46:04 +00:00
Chris Lattner
1111a4b76d rename fields of constant pool entries
llvm-svn: 26076
2006-02-09 04:22:52 +00:00
Chris Lattner
837a816470 Simplify code, alignment must be specified now.
llvm-svn: 26074
2006-02-09 02:26:04 +00:00
Chris Lattner
6556f15ad8 Add support for assembler directives that wrap inline asm
llvm-svn: 26065
2006-02-08 23:41:56 +00:00
Chris Lattner
35a536d1f4 Add support for modifier characters to operand printers
llvm-svn: 26021
2006-02-06 22:17:23 +00:00
Chris Lattner
4efafdb7f4 make sure that global doubles are aligned to 8 bytes
llvm-svn: 25981
2006-02-05 01:46:49 +00:00
Chris Lattner
d2c4e9151e Implement the AsmPrinter::getPreferredAlignmentLog method.
llvm-svn: 25978
2006-02-05 01:29:18 +00:00
Chris Lattner
41a35db65f Implement smart printing of inline asm strings, handling variants and
substituted operands.  For this testcase:

int %test(int %A, int %B) {
  %C = call int asm "xyz $0, $1, $2", "=r,r,r"(int %A, int %B)
  ret int %C
}

we now emit:

_test:
        or r2, r3, r3
        or r3, r4, r4
        xyz r2, r2, r3  ;; look here
        or r3, r2, r2
        blr

... note the substituted operands. :)

llvm-svn: 25886
2006-02-01 22:41:11 +00:00
Chris Lattner
5549a10792 adjust to changes in InlineAsm interface. Fix a few minor bugs.
llvm-svn: 25865
2006-02-01 01:28:23 +00:00
Evan Cheng
f115c17f23 Allow the specification of explicit alignments for constant pool entries.
llvm-svn: 25855
2006-01-31 22:23:14 +00:00
Chris Lattner
ce37ba3417 Print the most trivial inline asms.
llvm-svn: 25822
2006-01-30 23:00:08 +00:00
Chris Lattner
09d8aa244e Stub out a method
llvm-svn: 25676
2006-01-27 02:10:10 +00:00
Jim Laskey
583aae3110 Set up MachineDebugInfo to scan for debug information form "llvm.db"g globals.
Global Variable information is now pulled from "llvm.dbg.globals"

llvm-svn: 25655
2006-01-26 20:21:46 +00:00
Chris Lattner
d09c95f83c rename method
llvm-svn: 25572
2006-01-24 04:16:34 +00:00
Chris Lattner
ba1b666382 Print file-scope inline asm blocks at the start of the output file.
llvm-svn: 25565
2006-01-23 23:47:53 +00:00
Chris Lattner
c9d03f7b02 If using __main, emit global ctor/dtor list like any other global
llvm-svn: 25251
2006-01-12 19:17:23 +00:00
Jim Laskey
61138e28ff Applied some recommend changes from sabre. The dominate one beginning "let the
pass manager do it's thing."  Fixes crash when compiling -g files and suppresses
dwarf statements if no debug info is present.

llvm-svn: 25100
2006-01-04 22:28:25 +00:00
Jim Laskey
62b29812a6 Tie dwarf generation to darwin assembler.
llvm-svn: 25093
2006-01-04 13:52:30 +00:00
Duraid Madina
32783dc8d0 add these so I can be less naughty
llvm-svn: 25034
2005-12-28 06:29:02 +00:00
Chris Lattner
e62133e3c6 Don't emit a null terminator, nor anything after it, to the ctor/dtor list
llvm-svn: 24887
2005-12-21 01:17:37 +00:00
Chris Lattner
d27892a194 Add a couple more fields, move ctor init list to .cpp file, add support
for emitting the ctor/dtor list for common targets.

llvm-svn: 24694
2005-12-13 06:32:10 +00:00
Chris Lattner
3b6d02d4fc Avoid emitting two tabs when switching to a named section
llvm-svn: 24646
2005-12-09 19:28:49 +00:00
Nate Begeman
6c1b8712c5 Teach the SelectionDAG ISel how to turn ConstantPacked values into
constant nodes with vector types.  Also teach the asm printer how to print
ConstantPacked constant pool entries.  This allows us to generate altivec
code such as the following, which adds a vector constantto a packed float.

LCPI1_0:  <4 x float> < float 0.0e+0, float 0.0e+0, float 0.0e+0, float 1.0e+0 >
        .space  4
        .space  4
        .space  4
        .long   1065353216      ; float 1
        .text
        .align  4
        .globl  _foo
_foo:
        lis r2, ha16(LCPI1_0)
        la r2, lo16(LCPI1_0)(r2)
        li r4, 0
        lvx v0, r4, r2
        lvx v1, r4, r3
        vaddfp v0, v1, v0
        stvx v0, r4, r3
        blr

For the llvm code:

void %foo(<4 x float> * %a) {
entry:
  %tmp1 = load <4 x float> * %a;
  %tmp2 = add <4 x float> %tmp1, < float 0.0, float 0.0, float 0.0, float 1.0 >
  store <4 x float> %tmp2, <4 x float> *%a
  ret void
}

llvm-svn: 24616
2005-12-06 06:18:55 +00:00
Chris Lattner
3820bdc84c Allow target to customize directive used to switch to arbitrary section in SwitchSection,
add generic constant pool emitter

llvm-svn: 24464
2005-11-21 08:25:09 +00:00
Chris Lattner
3ad9bee9a4 increment the function number in SetupMachineFunction
llvm-svn: 24461
2005-11-21 08:13:27 +00:00
Chris Lattner
4c1efb2a29 Adjust to capitalized asmprinter method names
llvm-svn: 24457
2005-11-21 07:51:36 +00:00
Chris Lattner
f78eca1416 Add section switching to common code generator code. Add a couple of
asserts.

llvm-svn: 24445
2005-11-21 07:06:27 +00:00
Chris Lattner
5d9032c0e9 Remove extraneous parents around constants when using a constant expr cast.
llvm-svn: 24357
2005-11-15 00:03:16 +00:00
Chris Lattner
389e3bfb0c Teach emitAlignment to handle explicit alignment requests by globals.
llvm-svn: 24354
2005-11-14 19:00:06 +00:00
Chris Lattner
4868465cb6 Get rid of casts by #including the right header
llvm-svn: 24275
2005-11-10 18:36:17 +00:00
Chris Lattner
aa86c10fe6 Compile C strings to:
l1__2E_str_1:                           ; '.str_1'
        .asciz  "foo"

not:

        .align  0
l1__2E_str_1:                           ; '.str_1'
        .asciz  "foo"

llvm-svn: 24273
2005-11-10 18:09:27 +00:00
Chris Lattner
88c7013f18 add support for .asciz, and enable it by default. If your target assemblerdoesn't support .asciz, just set AscizDirective to null in your asmprinter.
This compiles C strings to:

l1__2E_str_1:                           ; '.str_1'
        .asciz  "foo"

instead of:

l1__2E_str_1:                           ; '.str_1'
        .ascii  "foo\000"

llvm-svn: 24272
2005-11-10 18:06:33 +00:00
Jim Laskey
61e3d7bca5 Culling out use of unions for converting FP to bits and vice versa.
llvm-svn: 22838
2005-08-17 19:34:49 +00:00
Chris Lattner
e7f14fb39d Handle 64-bit constant exprs on 64-bit targets.
llvm-svn: 22696
2005-08-08 04:26:32 +00:00
Duraid Madina
f4ca48c89e aCC and STLport complained about this, because they're like that
llvm-svn: 22053
2005-05-15 13:05:48 +00:00
Misha Brukman
774e55c446 Remove trailing whitespace
llvm-svn: 21420
2005-04-21 22:36:52 +00:00
Duraid Madina
3a10f491f0 add support for prefix/suffix strings to go around GlobalValue(s)
(which may or be function pointers) in the asmprinter. For the moment,
this changes nothing, except the IA64 backend which can use this to write:

  data8.ua  @fptr(blah__blah__mangled_function_name)

  (by setting FunctionAddrPrefix/Suffix to "@fptr(" / ")")

llvm-svn: 21024
2005-04-02 12:21:51 +00:00
Chris Lattner
43b14db4d9 Print GEP offsets as signed values instead of unsigned values. On X86, this
prints:

getelementptr (int* %A, int -1)

as: "(A) - 4" instead of "(A) + 18446744073709551612", which makes the
assembler much happier.

This fixes test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll,
and Benchmarks/Prolangs-C/cdecl with LLC on X86.

llvm-svn: 20183
2005-02-14 21:40:26 +00:00
Andrew Lenharth
d2d24eee40 fix constant pointer outputing on 64 bit machines
llvm-svn: 20026
2005-02-04 13:47:16 +00:00
Chris Lattner
c23687789e Silence VS warnings
llvm-svn: 19388
2005-01-08 19:59:10 +00:00
Chris Lattner
c3750aa2a3 Fix SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c, and hopefully
PR449

llvm-svn: 18306
2004-11-28 17:56:47 +00:00
Chris Lattner
8d479b62ad Add support for undef
llvm-svn: 17055
2004-10-16 18:19:26 +00:00
Chris Lattner
05d5a44c02 Do not use .xword and friends to emit zeros on V9. Apparently there are issues
with emitting .xwords when not on an 8-byte boundary (.xword 0 is not the
same as 8 .byte 0's).  Because we do not know when or when we are not aligned,
just emit bytes like the old V9 asmprinter did.

llvm-svn: 16006
2004-08-24 00:26:11 +00:00
Chris Lattner
8c5096d223 Rename var
llvm-svn: 15897
2004-08-18 02:22:55 +00:00
Chris Lattner
d8c7f4bf3c Add support for targets without a .zero directive
llvm-svn: 15894
2004-08-17 21:38:40 +00:00
Chris Lattner
659175521b Add support for alignment
llvm-svn: 15888
2004-08-17 19:14:29 +00:00
Chris Lattner
b8703980b4 Use a designated comment character when printing comments.
llvm-svn: 15880
2004-08-17 16:27:05 +00:00
Chris Lattner
bf03260147 Add support for targets that have .quad, drop extra tab inserted
llvm-svn: 15870
2004-08-17 06:48:16 +00:00
Chris Lattner
e47c31e25e Implement emitGlobalConstant
llvm-svn: 15868
2004-08-17 06:36:49 +00:00
Chris Lattner
1362ba130b We now allow targets to use any prefix they want for global symbols. Lets
hear it for ".".

llvm-svn: 15863
2004-08-17 06:06:19 +00:00
Chris Lattner
460d80e77d Some asmwriters want an _ prefix
llvm-svn: 15845
2004-08-17 02:28:26 +00:00
Chris Lattner
aac51aa3d8 Initial implementation of the asmprinter base class
llvm-svn: 15838
2004-08-16 23:15:22 +00:00