1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

95 Commits

Author SHA1 Message Date
Mon P Wang
6792115592 Added CONVERT_RNDSAT (conversion with rounding and saturation) SDNode to
support targets that support these conversions. Users should avoid using
this node as the current targets don't generating code for it.

llvm-svn: 59001
2008-11-10 20:54:11 +00:00
Bill Wendling
3fe9fef0da - Modify the stack protector algorithm so that the stack slot is allocated in
LLVM IR code and not in the selection DAG ISel. This is a cleaner solution.

- Fix the heuristic for determining if protectors are necessary. The previous
  one wasn't checking the proper type size.

llvm-svn: 58824
2008-11-07 01:23:58 +00:00
Bill Wendling
b6e2d60e7a - Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.
- Get rid of "HasStackProtector" in MachineFrameInfo.
- Modify intrinsics to tell which are doing what with memory.

llvm-svn: 58799
2008-11-06 07:23:03 +00:00
Bill Wendling
08905ed703 Implement the stack protector stack accesses via intrinsics:
- stackprotector_prologue creates a stack object and stores the guard there.

- stackprotector_epilogue reads the stack guard from the stack position created
  by stackprotector_prologue.

- The PrologEpilogInserter was changed to make sure that the stack guard is
  first on the stack frame.

llvm-svn: 58791
2008-11-06 02:29:10 +00:00
Mon P Wang
772a4e2594 Make llvm memory barrier available as an intrinsic
llvm-svn: 57750
2008-10-18 02:48:13 +00:00
Mon P Wang
ec4d25ea4b Fixed definition of llvm_anyptr_ty
llvm-svn: 57338
2008-10-10 01:41:18 +00:00
Andrew Lenharth
7a997d1cfd Note that ADDC and company don't actually expand yet (missing in legalize
llvm-svn: 57226
2008-10-07 02:10:26 +00:00
Anton Korobeynikov
33c69aaf24 Reapply 55899: First draft of EH support on x86/64-linux
Now with fix, which prevents subtle codegen bug to trigger on darwin.
No fix for bug though, it's still there.

llvm-svn: 55955
2008-09-08 21:12:47 +00:00
Bill Wendling
4cc4caab72 Reverting r55898 to r55909. One of these patches was causing an ICE during the full bootstrap on Darwin:
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/xgcc
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/bin/
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/lib/
-isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/include
-isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/sys-include
-O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc.src/gcc
-I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include
-I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include
-I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber
-I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include
-I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include
-DSHARED -m64 -DL_negdi2 -c ../../llvm-gcc.src/gcc/libgcc2.c -o
libgcc/x86_64/_negdi2_s.o
Assertion failed: (TargetRegisterInfo::isVirtualRegister(regA) &&
TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical
register live information"), function runOnMachineFunction, file
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/lib/CodeGen/TwoAddressInstructionPass.cpp,
line 311.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/xgcc
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/bin/
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/lib/
-isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/include
-isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.4.0/sys-include
-O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc.src/gcc
-I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include
-I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include
-I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber
-I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include
-I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include
-DSHARED -m64 -DL_lshrdi3 -c ../../llvm-gcc.src/gcc/libgcc2.c -o
libgcc/x86_64/_lshrdi3_s.o
../../llvm-gcc.src/gcc/unwind-dw2.c:1527: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
{standard input}:unknown:Undefined local symbol LBB21_11
{standard input}:unknown:Undefined local symbol LBB21_12
{standard input}:unknown:Undefined local symbol LBB21_13
{standard input}:unknown:Undefined local symbol LBB21_8

llvm-svn: 55928
2008-09-08 17:59:12 +00:00
Anton Korobeynikov
8528e4dc99 First draft of EH support on x86/64-linux
llvm-svn: 55899
2008-09-08 14:21:53 +00:00
Dale Johannesen
79477af98a Mark math lib intrinsics readonly, on the grounds
that they read the rounding mode.  This is conservatively
correct, which they weren't before.  We can do more
optimization on these if we actually model the rounding
mode.

llvm-svn: 55860
2008-09-05 21:49:30 +00:00
Dale Johannesen
9e4d101fab Add intrinsics for log, log2, log10, exp, exp2.
No functional change (and no FE change to generate them).

llvm-svn: 55753
2008-09-04 00:47:13 +00:00
Mon P Wang
fb483982f5 Added support for overloading intrinsics (atomics) based on pointers
to different address spaces.  This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32

llvm-svn: 54195
2008-07-30 04:36:53 +00:00
Mon P Wang
7d89d61387 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub

llvm-svn: 52706
2008-06-25 08:15:39 +00:00
Evan Cheng
d27948e716 - Add "Commutative" property to intrinsics. This allows tblgen to generate the commuted variants for dagisel matching code.
- Mark lots of X86 intrinsics as "Commutative" to allow load folding.

llvm-svn: 52353
2008-06-16 20:29:38 +00:00
Andrew Lenharth
327c3e7559 add missing atomic intrinsic from gcc
llvm-svn: 52270
2008-06-14 05:48:15 +00:00
Mon P Wang
84a269e023 Added addition atomic instrinsics and, or, xor, min, and max.
llvm-svn: 50663
2008-05-05 19:05:59 +00:00
Evan Cheng
acb7d77409 Fix 80 column violations.
llvm-svn: 47877
2008-03-04 03:19:19 +00:00
Andrew Lenharth
db9cd46f5d Atomic op support. If any gcc test uses __sync builtins, it might start failing on archs that haven't implemented them yet
llvm-svn: 47430
2008-02-21 06:45:13 +00:00
Andrew Lenharth
c178981b85 llvm.memory.barrier, and impl for x86 and alpha
llvm-svn: 47204
2008-02-16 01:24:58 +00:00
Anton Korobeynikov
08ea121968 For PR1839: add initial support for __builtin_trap. llvm-gcc part is missed
as well as PPC codegen

llvm-svn: 46001
2008-01-15 07:02:33 +00:00
Chris Lattner
7a9b0bf0eb remove attribution from a variety of miscellaneous files.
llvm-svn: 45425
2007-12-29 22:59:10 +00:00
Scott Michel
871b3a4fd4 More stuff for CellSPU -- this should be enough to get an error-free
compilation (no files missing). Test cases remain to be checked in.

llvm-svn: 44598
2007-12-05 02:01:41 +00:00
Anton Korobeynikov
b6c3255d80 Implement necessary bits for flt_rounds gcc builtin.
Codegen bits and llvm-gcc support will follow.

llvm-svn: 44182
2007-11-15 23:25:33 +00:00
Lauro Ramos Venancio
d8f2190c19 [ARM] Implement __builtin_thread_pointer.
llvm-svn: 43892
2007-11-08 17:20:05 +00:00
Chris Lattner
3d6151bcd1 Model stacksave and stackrestore as both writing memory, since we
don't model their dependences on allocas correctly.  This fixes
PR1745.

llvm-svn: 43442
2007-10-29 05:47:52 +00:00
Dan Gohman
ab5c3ed0d1 Add intrinsics for sin, cos, and pow. These use llvm_anyfloat_ty, and so
may be overloaded with vector types. And add a testcase for codegen for
these.

llvm-svn: 42885
2007-10-12 00:01:22 +00:00
Dan Gohman
a2ec0a3c2c Mark the prefetch intrinsic as IntrWriteArgMem, instead of the
default of IntrWriteMem, to at least indicate that it doesn't
"capture" the argument pointer.

llvm-svn: 42768
2007-10-08 21:15:07 +00:00
Dale Johannesen
a4e3643cb3 Rewrite sqrt and powi to use anyfloat. By popular demand.
llvm-svn: 42537
2007-10-02 17:43:59 +00:00
Dale Johannesen
e61886cee4 Add sqrt and powi intrinsics for long double.
llvm-svn: 42423
2007-09-28 01:08:20 +00:00
Tanya Lattner
e8c1cb789d Adding support for __builtin_annotation with an intrinsic called llvm.annotation. This is similar to llvm.var.annotation but is applied to expressions.
llvm-svn: 42211
2007-09-21 22:59:12 +00:00
Duncan Sands
c358890f73 Fold the adjust_trampoline intrinsic into
init_trampoline.  There is now only one
trampoline intrinsic.

llvm-svn: 41841
2007-09-11 14:10:23 +00:00
Anton Korobeynikov
899c0c9c8d Split eh.select / eh.typeid.for intrinsics into i32/i64 versions. This is needed, because they just "mark" register
liveins and we let frontend solve type issue, not lowering code :)

llvm-svn: 41763
2007-09-07 11:39:35 +00:00
Dan Gohman
b499ea1cf6 Add MVT::fAny for overloading intrinsics on floating-point types.
llvm-svn: 41128
2007-08-16 21:57:19 +00:00
Chandler Carruth
00e56b0e81 This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.

llvm-svn: 40807
2007-08-04 01:51:18 +00:00
Duncan Sands
e8bb2c6d32 Support for trampolines, except for X86 codegen which is
still under discussion.

llvm-svn: 40549
2007-07-27 12:58:54 +00:00
Anton Korobeynikov
5635277c36 Long live the exception handling!
This patch fills the last necessary bits to enable exceptions
handling in LLVM. Currently only on x86-32/linux.

In fact, this patch adds necessary intrinsics (and their lowering) which
represent really weird target-specific gcc builtins used inside unwinder.

After corresponding llvm-gcc patch will land (easy) exceptions should be
more or less workable. However, exceptions handling support should not be 
thought as 'finished': I expect many small and not so small glitches
everywhere.

llvm-svn: 39855
2007-07-14 14:06:15 +00:00
Duncan Sands
4441eff1ac Extend eh.selector to support both catches and filters.
Drop the eh.filter intrinsic.

llvm-svn: 37875
2007-07-04 20:52:51 +00:00
Tanya Lattner
fedfcab2ab Modify annotate intrinsic to take 2 additional args: file and line number.
Fix up Annotate attribute test case.
Fix DebugFilename.c test case to look for right file name.

llvm-svn: 37632
2007-06-18 22:23:39 +00:00
Tanya Lattner
203b1ae094 Add local var annotation intrinsic.
llvm-svn: 37603
2007-06-15 20:50:54 +00:00
Reid Spencer
82da0eb67c For PR1284:
Implement the "part_set" intrinsic.

llvm-svn: 35938
2007-04-12 02:48:46 +00:00
Reid Spencer
85e4416d26 Drop the "bit" prefix for the part.select intrinsic.
llvm-svn: 35854
2007-04-10 02:52:46 +00:00
Reid Spencer
6eb55df794 Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Reid Spencer
419396d2fe For PR1297:
Implement bswap, ctpop, ctlz, and cttz utilizing the new overloaded
intrinsic feature of tblgen. By defining llvm_int_ty to have an ValueType
of iAny, any intrinsic using that type becomes an overloaded intrinsic.
This signals that a) any integer type could be used for that argument and
b) the intrinsic needs a suffix to match each such argument for the
actual intrinsic.

llvm-svn: 35544
2007-04-01 07:30:57 +00:00
Bill Wendling
a42484728c Add support for the v1i64 type. This makes better code for this:
#include <mmintrin.h>

extern __m64 C;

void baz(__v2si *A, __v2si *B)
{
  *A = C;
  _mm_empty();
}

We get this:

_baz:
        call "L1$pb"
"L1$pb":
        popl %eax
        movl L_C$non_lazy_ptr-"L1$pb"(%eax), %eax
        movq (%eax), %mm0
        movl 4(%esp), %eax
        movq %mm0, (%eax)
        emms
        ret

GCC gives us this:

_baz:
        pushl   %ebx
        call    L3
"L00000000001$pb":
L3:
        popl    %ebx
        subl    $8, %esp
        movl    L_C$non_lazy_ptr-"L00000000001$pb"(%ebx), %eax
        movl    (%eax), %edx
        movl    4(%eax), %ecx
        movl    16(%esp), %eax
        movl    %edx, (%eax)
        movl    %ecx, 4(%eax)
        emms
        addl    $8, %esp
        popl    %ebx
        ret

llvm-svn: 35351
2007-03-26 07:53:08 +00:00
Bill Wendling
5fef3fd7e7 Added "padd*" support for MMX. Added MMX move stuff to X86InstrInfo so that
moves, loads, etc. are recognized.

llvm-svn: 35031
2007-03-08 22:09:11 +00:00
Jim Laskey
88c98a4128 Add eh filter intrinsic.
llvm-svn: 34801
2007-03-01 20:23:39 +00:00
Jim Laskey
1fea0fa316 Provide a more meaningful name.
llvm-svn: 34751
2007-02-28 18:37:50 +00:00
Jim Laskey
c13cc1eac7 Add new intrinsics for eh support.
llvm-svn: 34471
2007-02-21 22:35:57 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00