Commit Graph

33 Commits

Author SHA1 Message Date
Chris Lattner 434ffe49a9 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 f0e9aef954 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 a6f835f5a0 Avoid emitting two tabs when switching to a named section
llvm-svn: 24646
2005-12-09 19:28:49 +00:00
Nate Begeman 41b1cdc771 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 f2991cee1f 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 08adbd13ff increment the function number in SetupMachineFunction
llvm-svn: 24461
2005-11-21 08:13:27 +00:00
Chris Lattner bb644e39c0 Adjust to capitalized asmprinter method names
llvm-svn: 24457
2005-11-21 07:51:36 +00:00
Chris Lattner 2ea5c99eca 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 bba9c372c1 Remove extraneous parents around constants when using a constant expr cast.
llvm-svn: 24357
2005-11-15 00:03:16 +00:00
Chris Lattner dd8eeed096 Teach emitAlignment to handle explicit alignment requests by globals.
llvm-svn: 24354
2005-11-14 19:00:06 +00:00
Chris Lattner c0a1eba0ab Get rid of casts by #including the right header
llvm-svn: 24275
2005-11-10 18:36:17 +00:00
Chris Lattner 747960d21e 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 55a6d9067b 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 b74c666186 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 88e2d2ee6b Handle 64-bit constant exprs on 64-bit targets.
llvm-svn: 22696
2005-08-08 04:26:32 +00:00
Duraid Madina 73c4dbae23 aCC and STLport complained about this, because they're like that
llvm-svn: 22053
2005-05-15 13:05:48 +00:00
Misha Brukman 835702a094 Remove trailing whitespace
llvm-svn: 21420
2005-04-21 22:36:52 +00:00
Duraid Madina 73a316d712 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 145569b076 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 c8770aa507 fix constant pointer outputing on 64 bit machines
llvm-svn: 20026
2005-02-04 13:47:16 +00:00
Chris Lattner 0b955fd2d5 Silence VS warnings
llvm-svn: 19388
2005-01-08 19:59:10 +00:00
Chris Lattner ebb54c55e1 Fix SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c, and hopefully
PR449

llvm-svn: 18306
2004-11-28 17:56:47 +00:00
Chris Lattner 61753bf847 Add support for undef
llvm-svn: 17055
2004-10-16 18:19:26 +00:00
Chris Lattner a88d667487 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 10262ab3f1 Rename var
llvm-svn: 15897
2004-08-18 02:22:55 +00:00
Chris Lattner ea75199996 Add support for targets without a .zero directive
llvm-svn: 15894
2004-08-17 21:38:40 +00:00
Chris Lattner 1d35c1673f Add support for alignment
llvm-svn: 15888
2004-08-17 19:14:29 +00:00
Chris Lattner da6beac0ff Use a designated comment character when printing comments.
llvm-svn: 15880
2004-08-17 16:27:05 +00:00
Chris Lattner 9fa0fc4d5e Add support for targets that have .quad, drop extra tab inserted
llvm-svn: 15870
2004-08-17 06:48:16 +00:00
Chris Lattner 8452a1f6df Implement emitGlobalConstant
llvm-svn: 15868
2004-08-17 06:36:49 +00:00
Chris Lattner 6d42cbd71a 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 07e78f177a Some asmwriters want an _ prefix
llvm-svn: 15845
2004-08-17 02:28:26 +00:00
Chris Lattner 6a8e0f511b Initial implementation of the asmprinter base class
llvm-svn: 15838
2004-08-16 23:15:22 +00:00