Commit Graph

262 Commits

Author SHA1 Message Date
Dan Gohman bd72cea737 Suppress the 128-bit integer typedef on 32-bit targets, because
it causes compile errors.

llvm-svn: 49122
2008-04-02 23:52:49 +00:00
Dan Gohman 39d8b26322 Partial CBackend support for 128-bit integers. This is needed
now that llvm-gcc is lowering appropriately-sized struct returns
to i128 on x86-64.

llvm-svn: 49109
2008-04-02 19:40:14 +00:00
Dan Gohman c60c67fc37 Add explicit keywords.
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Dan Gohman bdc24adaaf A quick nm audit turned up several fixed tables and objects that were
marked read-write. Use const so that they can be allocated in a
read-only segment.

llvm-svn: 48800
2008-03-25 21:45:14 +00:00
Chris Lattner 8a923e7c28 Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.

llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Andrew Lenharth dcabdb1b38 gcc likes things spelled correctly
llvm-svn: 47981
2008-03-05 23:41:37 +00:00
Devang Patel 9d91785987 s/isReturnStruct()/hasStructRetAttr()/g
llvm-svn: 47857
2008-03-03 21:46:28 +00:00
Chris Lattner c93b48caeb add support for lvsl, fixing PR1481
llvm-svn: 47825
2008-03-02 08:54:27 +00:00
Chris Lattner 8fb4c98284 add support for the sse.cmp.* intrinsics, which fixes sse.isamax with the CBE.
llvm-svn: 47824
2008-03-02 08:47:13 +00:00
Chris Lattner 9044719798 refactor intrinsic handling code out into its own method.
llvm-svn: 47823
2008-03-02 08:29:41 +00:00
Chris Lattner 2541f1dac6 fix printing of undef vectors, this fixes "simple" and "build" in UnitTests/Vector.
Now they all pass.

llvm-svn: 47820
2008-03-02 08:14:45 +00:00
Chris Lattner 4c058b39e4 insertelement got the wrong operands.
llvm-svn: 47819
2008-03-02 08:10:16 +00:00
Chris Lattner 051709436e Several changes:
* Simplify handling of byval, making it easier to understand and more 
    consistent.  This fixes PR2065.
  * Clean up and simplify handling of GEPs.  I can actually understand it now!
  * Implement support for GEP'ing into vectors, this fixes
    SingleSource/UnitTests/Vector/build2 among others.

llvm-svn: 47818
2008-03-02 08:07:24 +00:00
Chris Lattner 9140fba6ad Fix a bug I introduced in constant array and constant vector handling.
llvm-svn: 47816
2008-03-02 05:46:57 +00:00
Chris Lattner 7295bc15a0 implement shufflevector.
llvm-svn: 47815
2008-03-02 05:41:07 +00:00
Chris Lattner 689d830b6d implement extractelement.
llvm-svn: 47812
2008-03-02 03:57:08 +00:00
Chris Lattner d9cc003b0d implement insertelement.
llvm-svn: 47811
2008-03-02 03:52:39 +00:00
Chris Lattner 92d929c21d respect isSigned for vector types, fixing sdiv of vectors etc.
llvm-svn: 47810
2008-03-02 03:41:23 +00:00
Chris Lattner fe1083be61 print the attribute in the right place, this fixes function returning vectors.
llvm-svn: 47809
2008-03-02 03:39:43 +00:00
Chris Lattner d861066d15 vector types are simple types. This fixes div/rem of vectors.
llvm-svn: 47807
2008-03-02 03:33:31 +00:00
Chris Lattner b104be599a Print vector types appropriately. This gets basic vector code working
(PR1126)

llvm-svn: 47806
2008-03-02 03:29:50 +00:00
Chris Lattner c8d974a323 rename PT -> VT for VectorTypes.
llvm-svn: 47805
2008-03-02 03:18:46 +00:00
Chris Lattner 895aef4720 Print i32/i64 integer constants as 1u instead of ((unsigned int)1).
Use dyn_cast better.

llvm-svn: 47804
2008-03-02 03:16:38 +00:00
Lauro Ramos Venancio 9781aee03c Avoid collisions in value names.
llvm-svn: 47725
2008-02-28 20:26:04 +00:00
Dale Johannesen 09f410b6d7 Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.

llvm-svn: 47504
2008-02-22 22:17:59 +00:00
Evan Cheng e43b6054b1 Temporarily backing out r47337. It breaks a number of CBE tests.
llvm-svn: 47385
2008-02-20 18:32:05 +00:00
Anton Korobeynikov 40d67c59d5 Remove bunch of gcc 4.3-related warnings from Target
llvm-svn: 47369
2008-02-20 11:22:39 +00:00
Andrew Lenharth 4aa9e208fa fix some byval problems in the cbe. Closes PR2065
llvm-svn: 47337
2008-02-19 19:47:54 +00:00
Andrew Lenharth fedcf477b5 I cannot find a libgcc function for this builtin. Therefor expanding it to a noop (which is how it use to be treated). If someone who knows the x86 backend better than me could tell me how to get a lock prefix on an instruction, that would be nice to complete x86 support.
llvm-svn: 47213
2008-02-16 14:46:26 +00:00
Lauro Ramos Venancio 192c07b727 CBackend: Implement unaligned load/store.
llvm-svn: 46646
2008-02-01 21:25:59 +00:00
Evan Cheng f755ff7be3 Indirect call with byval parameter requires a cast first.
llvm-svn: 45911
2008-01-12 18:53:07 +00:00
Chris Lattner 459dc52df4 Add support for NetBSD, patch by Krister Walfridsson!
llvm-svn: 45902
2008-01-12 06:46:09 +00:00
Evan Cheng b51d228e79 More cbe byval fixes.
llvm-svn: 45891
2008-01-11 23:10:11 +00:00
Evan Cheng ef5285ef88 Some C backend ByVal parameter attribute support. Not yet complete.
llvm-svn: 45864
2008-01-11 09:12:49 +00:00
Evan Cheng aaef8ce856 A couple of obvious off-by-one bugs.
llvm-svn: 45852
2008-01-11 03:07:46 +00:00
Gordon Henriksen 5180e85675 Enabling the target-independent garbage collection infrastructure by hooking it
up to the various compiler pipelines.

This doesn't actually add support for any GC algorithms, which means it 
temporarily breaks a few tests. To be fixed shortly.

llvm-svn: 45669
2008-01-07 01:30:38 +00:00
Chris Lattner f3ebc3f3d2 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner a087a8d2ce remove attribution from lib Makefiles.
llvm-svn: 45415
2007-12-29 20:09:26 +00:00
Anton Korobeynikov 1e8c1308bb Fix silly typo in the FP CEP handling.
llvm-svn: 45300
2007-12-21 23:33:44 +00:00
Duncan Sands 38ef3a8ec7 Rather than having special rules like "intrinsics cannot
throw exceptions", just mark intrinsics with the nounwind
attribute.  Likewise, mark intrinsics as readnone/readonly
and get rid of special aliasing logic (which didn't use
anything more than this anyway).

llvm-svn: 44544
2007-12-03 20:06:50 +00:00
Chris Lattner 246b7b2dbf Work around a GCC bug, producing this code:
unsigned char *llvm_cbe_X;
...
  llvm_cbe_X = 0; *((void**)&llvm_cbe_X) = __builtin_stack_save();

instead of:

  llvm_cbe_X = __builtin_stack_save();

See PR1809 for details.

llvm-svn: 44415
2007-11-28 21:26:17 +00:00
Duncan Sands ad0ea2d430 Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.

llvm-svn: 44359
2007-11-27 13:23:08 +00:00
Gordon Henriksen ef5d08f4ea Switching TargetMachineRegistry to use the new generic Registry.
llvm-svn: 43094
2007-10-17 21:28:48 +00:00
Dale Johannesen 207bd4d90e Handle PPC long double in CBackend.
llvm-svn: 42972
2007-10-15 01:05:37 +00:00
Dale Johannesen 4d4e77af8e Rewrite sqrt and powi to use anyfloat. By popular demand.
llvm-svn: 42537
2007-10-02 17:43:59 +00:00
Dale Johannesen 34aa41c475 Make temporaries explicit to avoid premature
destruction of compiler-created ones.

llvm-svn: 42383
2007-09-26 23:20:33 +00:00
Chris Lattner e48195e0f3 Fix PR1679, by printing GEP indices as signed values instead of unsigned.
llvm-svn: 42239
2007-09-22 20:16:48 +00:00
Dale Johannesen 7511e6b622 Implement x86 long double (uses host long double,
so only works on x86 target).

llvm-svn: 42019
2007-09-17 00:38:27 +00:00
Chris Lattner 4f230451e1 Fix PR1666, SPASS with the CBE and 254.gap with the CBE.
GCC optimizes away things like ptr < NULL  to false.  To "fix" this,
have the CBE emit casts of pointers to intptr_t when doing relational
pointer comparisons.

llvm-svn: 41983
2007-09-15 06:51:03 +00:00
Dale Johannesen 98d3a08d8f Remove the assumption that FP's are either float or
double from some of the many places in the optimizers
it appears, and do something reasonable with x86
long double.
Make APInt::dump() public, remove newline, use it to
dump ConstantSDNode's.
Allow APFloats in FoldingSet.
Expand X86 backend handling of long doubles (conversions
to/from int, mostly).

llvm-svn: 41967
2007-09-14 22:26:36 +00:00