Compare commits

...

11 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
06265a0195 Merging r226058:
------------------------------------------------------------------------
r226058 | dexonsmith | 2015-01-14 15:11:51 -0800 (Wed, 14 Jan 2015) | 1 line

IR: Fix comment spelling, NFC
------------------------------------------------------------------------

llvm-svn: 226095
2015-01-15 04:04:53 +00:00
Duncan P. N. Exon Smith
9282c9fdd1 Merging r226048:
------------------------------------------------------------------------
r226048 | dexonsmith | 2015-01-14 14:27:36 -0800 (Wed, 14 Jan 2015) | 17 lines

IR: Move MDLocation into place

This commit moves `MDLocation`, finishing off PR21433.  There's an
accompanying clang commit for frontend testcases.  I'll attach the
testcase upgrade script I used to PR21433 to help out-of-tree
frontends/backends.

This changes the schema for `DebugLoc` and `DILocation` from:

    !{i32 3, i32 7, !7, !8}

to:

    !MDLocation(line: 3, column: 7, scope: !7, inlinedAt: !8)

Note that empty fields (line/column: 0 and inlinedAt: null) don't get
printed by the assembly writer.
------------------------------------------------------------------------

llvm-svn: 226094
2015-01-15 04:04:08 +00:00
Duncan P. N. Exon Smith
aa9a09be68 Merging r226049:
------------------------------------------------------------------------
r226049 | dexonsmith | 2015-01-14 14:28:03 -0800 (Wed, 14 Jan 2015) | 3 lines

IR: Move MDLocation into place (clang testcases)

Update testcases to match LLVM change in r226048.
------------------------------------------------------------------------

llvm-svn: 226093
2015-01-15 04:03:26 +00:00
Duncan P. N. Exon Smith
606bf7532a Merging r226046:
------------------------------------------------------------------------
r226046 | dexonsmith | 2015-01-14 14:14:26 -0800 (Wed, 14 Jan 2015) | 3 lines

IR: Always print MDLocation line

Print `MDLocation`'s `line` field even when it's 0.
------------------------------------------------------------------------

llvm-svn: 226092
2015-01-15 03:59:43 +00:00
Duncan P. N. Exon Smith
c65f934680 Merging r226044:
------------------------------------------------------------------------
r226044 | dexonsmith | 2015-01-14 13:58:17 -0800 (Wed, 14 Jan 2015) | 15 lines

IR: Drop metadata references more aggressively during teardown

Sometimes teardown happens before the debug info graph is complete
(e.g., when clang throws an error).  In that case, `MDNode`s will still
have RAUW, so deleting constants that the `MDNode`s point at will be
relatively expensive -- it'll cause re-uniquing all up the chain (what
I've been referring to as "teardown madness").

So, drop references *before* deleting constants.  We need to drop a few
more references now: the metadata side of the metadata/value bridges
needs to be dropped off the cliff along with the rest of it (previously,
the bridges were cleaned before we did anything with the `MDNode`s).

There's no real functionality change here -- state before and after
`LLVMContextImpl::~LLVMContextImpl()` is unchanged -- so no testcase.
------------------------------------------------------------------------

llvm-svn: 226091
2015-01-15 03:59:09 +00:00
Duncan P. N. Exon Smith
aa90c32d65 Merging r226029:
------------------------------------------------------------------------
r226029 | dexonsmith | 2015-01-14 11:56:10 -0800 (Wed, 14 Jan 2015) | 7 lines

IR: Fix a use-after-free in RAUW

Happened pretty commonly during `LLVMContext` teardown when `clang -g`
hit an error.  This fixes the use-after-free.  Next I'll clean up
teardown so that it's not RAUW'ing when metadata-tracked values are
deleted (only really causes a problem if the graph is mid-construction
when teardown starts, but it's still unnecessary work).
------------------------------------------------------------------------

llvm-svn: 226090
2015-01-15 03:58:02 +00:00
Hans Wennborg
95a463338f Merging r226023:
------------------------------------------------------------------------
r226023 | majnemer | 2015-01-14 11:26:56 -0800 (Wed, 14 Jan 2015) | 3 lines

InstCombine: Don't take A-B<0 into A<B if A-B has other uses

This fixes PR22226.
------------------------------------------------------------------------

llvm-svn: 226059
2015-01-14 23:14:47 +00:00
Hans Wennborg
9d1ac80433 Merging r226008:
------------------------------------------------------------------------
r226008 | hans | 2015-01-14 10:14:00 -0800 (Wed, 14 Jan 2015) | 1 line

Update cxx_dr_status.html after 3.6 branch
------------------------------------------------------------------------

llvm-svn: 226050
2015-01-14 22:31:21 +00:00
Hans Wennborg
95bd6d067a Change version from 3.6.0svn to 3.6.0
llvm-svn: 226021
2015-01-14 19:03:19 +00:00
Hans Wennborg
e1673fae1e Change version from 3.6.0svn to 3.6.0
llvm-svn: 226020
2015-01-14 19:02:46 +00:00
Hans Wennborg
3f28812d7a Creating release_36 branch off revision 225991
llvm-svn: 226002
llvm-svn: 226001
llvm-svn: 226000
llvm-svn: 225999
llvm-svn: 225998
llvm-svn: 225997
llvm-svn: 225996
llvm-svn: 225995
llvm-svn: 225993
llvm-svn: 225992
2015-01-14 16:44:14 +00:00
3026 changed files with 1798 additions and 630329 deletions

View File

@@ -6,5 +6,5 @@ void foo() {
int p = 0; // line #5: CHECK: {{call.*llvm.dbg.declare.*%p.*\!dbg }}[[variable_p:![0-9]+]]
}
// Now match the line number records:
// CHECK: {{^}}[[variable_l]]{{ = !{i32 5,}}
// CHECK: {{^}}[[variable_p]]{{ = !{i32 6,}}
// CHECK: {{^}}[[variable_l]] = !MDLocation(line: 5,
// CHECK: {{^}}[[variable_p]] = !MDLocation(line: 6,

View File

@@ -9,8 +9,8 @@
int main()
{
// CHECK: [[ASSIGNMENT]] = !{i32 [[@LINE+2]],
// CHECK: [[BLOCK_ENTRY]] = !{i32 [[@LINE+1]],
// CHECK: [[ASSIGNMENT]] = !MDLocation(line: [[@LINE+2]],
// CHECK: [[BLOCK_ENTRY]] = !MDLocation(line: [[@LINE+1]],
int (^blockptr)(void) = ^(void) {
return 0;
};

View File

@@ -13,4 +13,4 @@ void func(char c, char* d)
}
// CHECK: ret void, !dbg [[LINE:.*]]
// CHECK: [[LINE]] = !{i32 6,
// CHECK: [[LINE]] = !MDLocation(line: 6,

View File

@@ -8,4 +8,4 @@ int foo(int a, int b) { int c = a + b;
}
// Without column information we wouldn't change locations for b.
// CHECK: i32 4, i32 20,
// CHECK: !MDLocation(line: 4, column: 20,

View File

@@ -7,8 +7,8 @@
// CHECK: ret void, !dbg [[F2_LINE:![0-9]*]]
// CHECK: [[F1:![0-9]*]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [f1]
// CHECK: [[F2:![0-9]*]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [f2]
// CHECK: [[F1_LINE]] = {{.*}}, [[F1]], null}
// CHECK: [[F2_LINE]] = {{.*}}, [[F2]], null}
// CHECK: [[F1_LINE]] = !MDLocation({{.*}}, scope: [[F1]])
// CHECK: [[F2_LINE]] = !MDLocation({{.*}}, scope: [[F2]])
void f1() {
}

View File

@@ -11,7 +11,7 @@
void foo(char c)
{
int i;
// CHECK: ![[CONV]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[CONV]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
i = c;
// CHECK: ![[RET]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}

View File

@@ -8,7 +8,7 @@ extern bool b;
// CHECK: call {{.*}}, !dbg [[DTOR_CALL2_LOC:![0-9]*]]
// CHECK: [[FUN1:.*]] = {{.*}}; [ DW_TAG_subprogram ] {{.*}} [def] [fun1]
// CHECK: [[FUN2:.*]] = {{.*}}; [ DW_TAG_subprogram ] {{.*}} [def] [fun2]
// CHECK: [[DTOR_CALL1_LOC]] = !{i32 [[@LINE+1]], i32 0, [[FUN1]], null}
// CHECK: [[DTOR_CALL1_LOC]] = !MDLocation(line: [[@LINE+1]], scope: [[FUN1]])
void fun1() { b && (C(), 1); }
// CHECK: [[DTOR_CALL2_LOC]] = !{i32 [[@LINE+1]], i32 0, [[FUN2]], null}
// CHECK: [[DTOR_CALL2_LOC]] = !MDLocation(line: [[@LINE+1]], scope: [[FUN2]])
bool fun2() { return (C(), b) && 0; }

View File

@@ -118,5 +118,5 @@ int main(int argc, char **argv) {
// CHECK: !"_ZTS1D", {{.*}}, [[D_FUNC_DECL:![0-9]*]], {{![0-9]*}}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func]
// CHECK: [[D_FUNC_DECL]] = !{!"0x2e\00func\00{{.*}}\000\00{{[0-9]+}}"{{.*}}, !"_ZTS1D", {{.*}}, null} ; [ DW_TAG_subprogram ] {{.*}} [func]
// CHECK: ![[EXCEPTLOC]] = !{i32 84,
// CHECK: ![[RETLOC]] = !{i32 83,
// CHECK: ![[EXCEPTLOC]] = !MDLocation(line: 84,
// CHECK: ![[RETLOC]] = !MDLocation(line: 83,

View File

@@ -34,5 +34,5 @@ int main(void) {}
// CHECK-NOT: __cxx_global_var_init
// CHECK: store i32 %[[C2]], i32* @_ZL1k, align 4, !dbg
//
// CHECK: ![[LINE]] = !{i32 13, i32
// CHECK: ![[LINE2]] = !{i32 15, i32
// CHECK: ![[LINE]] = !MDLocation(line: 13,
// CHECK: ![[LINE2]] = !MDLocation(line: 15,

View File

@@ -48,8 +48,8 @@ int main() {
// CHECK: br label
// CHECK: br label {{.*}}, !dbg [[DBG4:!.*]]
// CHECK: [[DBG1]] = !{i32 100, i32 0, !{{.*}}, null}
// CHECK: [[DBG2]] = !{i32 200, i32 0, !{{.*}}, null}
// CHECK: [[DBG3]] = !{i32 300, i32 0, !{{.*}}, null}
// CHECK: [[DBG4]] = !{i32 401, i32 0, !{{.*}}, null}
// CHECK: [[DBG1]] = !MDLocation(line: 100, scope: !{{.*}})
// CHECK: [[DBG2]] = !MDLocation(line: 200, scope: !{{.*}})
// CHECK: [[DBG3]] = !MDLocation(line: 300, scope: !{{.*}})
// CHECK: [[DBG4]] = !MDLocation(line: 401, scope: !{{.*}})
}

View File

@@ -166,22 +166,22 @@ void f13() {
F13_IMPL;
}
// CHECK: [[DBG_F1]] = !{i32 100,
// CHECK: [[DBG_FOO_VALUE]] = !{i32 200,
// CHECK: [[DBG_FOO_REF]] = !{i32 202,
// CHECK: [[DBG_FOO_COMPLEX]] = !{i32 204,
// CHECK: [[DBG_F2]] = !{i32 300,
// CHECK: [[DBG_F3]] = !{i32 400,
// CHECK: [[DBG_F4]] = !{i32 500,
// CHECK: [[DBG_F5]] = !{i32 600,
// CHECK: [[DBG_F6]] = !{i32 700,
// CHECK: [[DBG_F7]] = !{i32 800,
// CHECK: [[DBG_F8]] = !{i32 900,
// CHECK: [[DBG_F9]] = !{i32 1000,
// CHECK: [[DBG_F10_ICMP]] = !{i32 1100,
// CHECK: [[DBG_F10_STORE]] = !{i32 1100,
// CHECK: [[DBG_GLBL_CTOR_B]] = !{i32 1500,
// CHECK: [[DBG_GLBL_DTOR_B]] = !{i32 1500,
// CHECK: [[DBG_F11]] = !{i32 1200,
// CHECK: [[DBG_F12]] = !{i32 1300,
// CHECK: [[DBG_F13]] = !{i32 1400,
// CHECK: [[DBG_F1]] = !MDLocation(line: 100,
// CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200,
// CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202,
// CHECK: [[DBG_FOO_COMPLEX]] = !MDLocation(line: 204,
// CHECK: [[DBG_F2]] = !MDLocation(line: 300,
// CHECK: [[DBG_F3]] = !MDLocation(line: 400,
// CHECK: [[DBG_F4]] = !MDLocation(line: 500,
// CHECK: [[DBG_F5]] = !MDLocation(line: 600,
// CHECK: [[DBG_F6]] = !MDLocation(line: 700,
// CHECK: [[DBG_F7]] = !MDLocation(line: 800,
// CHECK: [[DBG_F8]] = !MDLocation(line: 900,
// CHECK: [[DBG_F9]] = !MDLocation(line: 1000,
// CHECK: [[DBG_F10_ICMP]] = !MDLocation(line: 1100,
// CHECK: [[DBG_F10_STORE]] = !MDLocation(line: 1100,
// CHECK: [[DBG_GLBL_CTOR_B]] = !MDLocation(line: 1500,
// CHECK: [[DBG_GLBL_DTOR_B]] = !MDLocation(line: 1500,
// CHECK: [[DBG_F11]] = !MDLocation(line: 1200,
// CHECK: [[DBG_F12]] = !MDLocation(line: 1300,
// CHECK: [[DBG_F13]] = !MDLocation(line: 1400,

View File

@@ -19,4 +19,4 @@ template struct AB<int>;
// CHECK-LABEL: define
// CHECK: [[THUNK_VEC_DEL_DTOR:![0-9]*]] = {{.*}} @"\01??_E?$AB@H@@W3AEPAXI@Z", {{.*}}; [ DW_TAG_subprogram ]
// CHECK: [[THUNK_LOC]] = !{i32 15, i32 0, [[THUNK_VEC_DEL_DTOR]], null}
// CHECK: [[THUNK_LOC]] = !MDLocation(line: 15, scope: [[THUNK_VEC_DEL_DTOR]])

View File

@@ -19,4 +19,4 @@ void foo() {
}
}
// Check there is a line number entry for line 19 where b1 is destructed.
// CHECK: !{i32 19, i32 0, !
// CHECK: !MDLocation(line: 19,

View File

@@ -7,7 +7,7 @@
// CHECK: define internal void @_GLOBAL__sub_I_globalinit_loc.cpp
// CHECK: !dbg ![[DBG:.*]]
// CHECK: !"0x2e\00\00\00_GLOBAL__sub_I_globalinit_loc.cpp\000\00{{.*}}\000", {{.*}} ; [ DW_TAG_subprogram ] [line 0] [local] [def]
// CHECK: ![[DBG]] = !{i32 0, i32 0,
// CHECK: ![[DBG]] = !MDLocation(line: 0,
# 99 "someheader.h"
class A {
public:

View File

@@ -24,15 +24,15 @@ int foo()
C c;
c.i = 42;
// This breakpoint should be at/before the cleanup code.
// CHECK: ![[CLEANUP]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[CLEANUP]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
return 0;
// CHECK: ![[RET]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}
void bar()
{
if (!foo())
// CHECK: {{.*}} = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: {{.*}} = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
return;
if (foo()) {
@@ -40,21 +40,21 @@ void bar()
c.i = foo();
}
// Clang creates only a single ret instruction. Make sure it is at a useful line.
// CHECK: ![[RETBAR]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RETBAR]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}
void baz()
{
if (!foo())
// CHECK: ![[SCOPE1:.*]] = !{!"0xb\00[[@LINE-1]]\00{{.*}}", {{.*}} ; [ DW_TAG_lexical_block ]
// CHECK: {{.*}} = !{i32 [[@LINE+1]], i32 0, ![[SCOPE1]], null}
// CHECK: {{.*}} = !MDLocation(line: [[@LINE+1]], scope: ![[SCOPE1]])
return;
if (foo()) {
// no cleanup
// CHECK: {{.*}} = !{i32 [[@LINE+2]], i32 0, ![[SCOPE2:.*]], null}
// CHECK: {{.*}} = !MDLocation(line: [[@LINE+2]], scope: ![[SCOPE2:.*]])
// CHECK: ![[SCOPE2]] = !{!"0xb\00[[@LINE-3]]\00{{.*}}", {{.*}} ; [ DW_TAG_lexical_block ]
return;
}
// CHECK: ![[RETBAZ]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RETBAZ]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}

View File

@@ -12,10 +12,10 @@
// CHECK-NEXT: cleanup, !dbg ![[DBG3:.*]]
// CHECK-DAG: ![[CURRENT_ADDR]] = {{.*}} [current_address]
// CHECK-DAG: ![[FOUND_IT]] = {{.*}} [found_it]
// CHECK-DAG: ![[DBG1]] = !{i32 256,
// CHECK-DAG: ![[DBG2]] = !{i32 257,
// CHECK-DAG: ![[DBG3]] = !{i32 268,
// CHECK-DAG: ![[DBG4]] = !{i32 256,
// CHECK-DAG: ![[DBG1]] = !MDLocation(line: 256,
// CHECK-DAG: ![[DBG2]] = !MDLocation(line: 257,
// CHECK-DAG: ![[DBG3]] = !MDLocation(line: 268,
// CHECK-DAG: ![[DBG4]] = !MDLocation(line: 256,
typedef unsigned long long uint64_t;
template<class _Tp> class shared_ptr {
public:

View File

@@ -7,7 +7,7 @@
// CHECK: [[HPP:.*]] = !{!"./template.hpp",
// CHECK: [[SP:.*]] = !{!"0x2e\00{{.*}}", [[HPP]],{{.*}}[ DW_TAG_subprogram ] [line 22] [def] [bar]
// We shouldn't need a lexical block for this function.
// CHECK: [[DBG]] = !{i32 23, i32 0, [[SP]], null}
// CHECK: [[DBG]] = !MDLocation(line: 23, scope: [[SP]])
# 1 "./template.h" 1

View File

@@ -4,7 +4,7 @@
// CHECK: ret i32
// CHECK: landingpad {{.*}}
// CHECK-NEXT: !dbg ![[LPAD:[0-9]+]]
// CHECK: ![[LPAD]] = !{i32 24, i32 0, !{{.*}}, null}
// CHECK: ![[LPAD]] = !MDLocation(line: 24, scope: !{{.*}})
# 1 "/usr/include/c++/4.2.1/vector" 1 3
typedef long unsigned int __darwin_size_t;

View File

@@ -32,8 +32,8 @@ NSRect NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h);
// CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC:[0-9]+]]
// CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC]]
// CHECK: ret {{.*}} !dbg ![[ARC]]
// CHECK: ![[RET]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
return path;
// CHECK: ![[ARC]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[ARC]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}
@end

View File

@@ -57,52 +57,52 @@ typedef signed char BOOL;
// CHECK: ![[TESTNOSIDEEFFECT:.*]] = {{.*}}[ DW_TAG_subprogram ] [line [[@LINE+1]]] [local] [def] [-[AppDelegate testNoSideEffect:]]
- (int)testNoSideEffect:(NSString *)foo {
int x = 1;
// CHECK: ![[ARC1]] = !{i32 [[@LINE+1]], i32 0, ![[TESTNOSIDEEFFECT]], null}
// CHECK: ![[ARC1]] = !MDLocation(line: [[@LINE+1]], scope: ![[TESTNOSIDEEFFECT]])
return 1; // Return expression
// CHECK: ![[RET1]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET1]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
} // Cleanup + Ret
- (int)testNoCleanup {
// CHECK: ![[RET2]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET2]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
return 1;
}
- (int)testSideEffect:(NSString *)foo {
// CHECK: ![[MSG3]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[MSG3]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
return [self testNoSideEffect :foo];
// CHECK: ![[RET3]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET3]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}
- (int)testMultiline:(NSString *)foo {
// CHECK: ![[MSG4]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[MSG4]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
int r = [self testSideEffect :foo];
// CHECK: ![[EXP4]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[EXP4]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
return r;
// CHECK: ![[RET4]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET4]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}
- (void)testVoid:(NSString *)foo {
// CHECK: ![[ARC5]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[ARC5]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
return;
// CHECK: ![[RET5]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET5]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}
- (void)testVoidNoReturn:(NSString *)foo {
// CHECK: ![[MSG6]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[MSG6]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
[self testVoid :foo];
// CHECK: ![[RET6]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET6]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
}
- (int)testNoCleanupSideEffect {
// CHECK: ![[MSG7]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[MSG7]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
[self testVoid :@"foo"];
// CHECK: ![[RET7]] = !{i32 [[@LINE+1]], i32 0, !{{.*}}, null}
// CHECK: ![[RET7]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}})
return 1;
}
- (void)testCleanupVoid:(BOOL)skip withDelegate: (AppDelegate *) delegate {
static BOOL skip_all;
// CHECK: ![[SKIP1]] = !{i32 [[@LINE+1]], i32 0,
// CHECK: ![[SKIP1]] = !MDLocation(line: [[@LINE+1]], scope:
if (!skip_all) {
if (!skip) {
return;
@@ -112,8 +112,8 @@ typedef signed char BOOL;
[delegate testVoid :s];
}
}
// CHECK: ![[RET8]] = !{i32 [[@LINE+2]], i32 0,
// CHECK: ![[ARC8]] = !{i32 [[@LINE+1]], i32 0,
// CHECK: ![[RET8]] = !MDLocation(line: [[@LINE+2]], scope:
// CHECK: ![[ARC8]] = !MDLocation(line: [[@LINE+1]], scope:
}

View File

@@ -22,10 +22,10 @@
// CHECK-NOT: ret
// CHECK: load {{.*}}, !dbg ![[DESTROY_LINE:[0-9]+]]
// CHECK-DAG: [[DBG_LINE]] = !{i32 0, i32 0, ![[COPY_SP:[0-9]+]], null}
// CHECK-DAG: [[COPY_LINE]] = !{i32 0, i32 0, ![[COPY_SP:[0-9]+]], null}
// CHECK-DAG: [[DBG_LINE]] = !MDLocation(line: 0, scope: ![[COPY_SP:[0-9]+]])
// CHECK-DAG: [[COPY_LINE]] = !MDLocation(line: 0, scope: ![[COPY_SP:[0-9]+]])
// CHECK-DAG: [[COPY_SP]] = {{.*}}[ DW_TAG_subprogram ]{{.*}}[__copy_helper_block_]
// CHECK-DAG: [[DESTROY_LINE]] = !{i32 0, i32 0, ![[DESTROY_SP:[0-9]+]], null}
// CHECK-DAG: [[DESTROY_LINE]] = !MDLocation(line: 0, scope: ![[DESTROY_SP:[0-9]+]])
// CHECK-DAG: [[DESTROY_SP]] = {{.*}}[ DW_TAG_subprogram ]{{.*}}[__destroy_helper_block_]
typedef unsigned int NSUInteger;

View File

@@ -20,8 +20,8 @@
//
// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+4]]] [local] [def] [-[I p1]]
// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+3]]] [local] [def] [-[I setP1:]]
// CHECK: ![[DBG1]] = !{i32 [[@LINE+2]],
// CHECK: ![[DBG2]] = !{i32 [[@LINE+1]],
// CHECK: ![[DBG1]] = !MDLocation(line: [[@LINE+2]],
// CHECK: ![[DBG2]] = !MDLocation(line: [[@LINE+1]],
@property int p1;
@end

View File

@@ -26,5 +26,5 @@ void f1() {
}
@end
// CHECK: [[DBG_F1]] = !{i32 100,
// CHECK: [[DBG_TNSO]] = !{i32 200,
// CHECK: [[DBG_F1]] = !MDLocation(line: 100,
// CHECK: [[DBG_TNSO]] = !MDLocation(line: 200,

View File

@@ -6103,7 +6103,7 @@ and <I>POD class</I></td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1048">1048</a></td>
<td>CD3</td>
<td><TT>auto</TT> deduction and lambda return type deduction.</td>
<td class="svn" align="center">SVN</td>
<td class="full" align="center">Clang 3.6</td>
</tr>
<tr class="open" id="1049">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1049">1049</a></td>
@@ -9919,7 +9919,7 @@ and <I>POD class</I></td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1684">1684</a></td>
<td>C++14</td>
<td>Static <TT>constexpr</TT> member functions for non-literal classes</td>
<td class="svn" align="center">SVN</td>
<td class="full" align="center">Clang 3.6</td>
</tr>
<tr id="1685">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#1685">1685</a></td>
@@ -11161,7 +11161,7 @@ and <I>POD class</I></td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1891">1891</a></td>
<td>DR</td>
<td>Move constructor/assignment for closure class</td>
<td class="svn" align="center">SVN</td>
<td class="full" align="center">Clang 3.6</td>
</tr>
<tr id="1892">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1892">1892</a></td>

View File

@@ -102,10 +102,10 @@ def availability(issue):
if status == 'unknown':
avail = 'Unknown'
avail_style = ' class="none"'
elif status == '3.6':
elif status == '3.7':
avail = 'SVN'
avail_style = ' class="svn"'
elif status in ('3.1', '3.2', '3.3', '3.4', '3.5'):
elif status in ('3.1', '3.2', '3.3', '3.4', '3.5', '3.6'):
avail = 'Clang %s' % status
avail_style = ' class="full"'
elif status == 'yes':

View File

@@ -1,19 +0,0 @@
-*- rst -*-
This is a collection of tests to check debugging information generated by
compiler. This test suite can be checked out inside clang/test folder. This
will enable 'make test' for clang to pick up these tests. Typically, test
cases included here includes debugger commands and intended debugger output
as comments in source file using DEBUGGER: and CHECK: as prefixes respectively.
For example::
define i32 @f1(i32 %i) nounwind ssp {
; DEBUGGER: break f1
; DEBUGGER: r
; DEBUGGER: p i
; CHECK: $1 = 42
entry:
}
is a testcase where the debugger is asked to break at function 'f1' and
print value of argument 'i'. The expected value of 'i' is 42 in this case.

View File

@@ -1,32 +0,0 @@
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out
// Radar 8945514
// DEBUGGER: break 22
// DEBUGGER: r
// DEBUGGER: p v
// CHECK: ${{[0-9]+}} =
// CHECK: Data ={{.*}} 0x0{{(0*)}}
// CHECK: Kind = 2142
class SVal {
public:
~SVal() {}
const void* Data;
unsigned Kind;
};
void bar(SVal &v) {}
class A {
public:
void foo(SVal v) { bar(v); }
};
int main() {
SVal v;
v.Data = 0;
v.Kind = 2142;
A a;
a.foo(v);
return 0;
}

View File

@@ -1,32 +0,0 @@
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
// RUN: %test_debuginfo %s %t.out
// REQUIRES: system-darwin
// DEBUGGER: break 24
// DEBUGGER: r
// DEBUGGER: p result
// CHECK: ${{[0-9]}} = 42
void doBlock(void (^block)(void))
{
block();
}
int I(int n)
{
__block int result;
int i = 2;
doBlock(^{
result = n;
});
return result + i; /* Check value of 'result' */
}
int main (int argc, const char * argv[]) {
return I(42);
}

View File

@@ -1,43 +0,0 @@
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
// RUN: %test_debuginfo %s %t.out
// REQUIRES: system-darwin
// Radar 9279956
// DEBUGGER: break 31
// DEBUGGER: r
// DEBUGGER: p m2
// CHECK: ${{[0-9]}} = 1
// DEBUGGER: p dbTransaction
// CHECK: ${{[0-9]}} = 0
// DEBUGGER: p master
// CHECK: ${{[0-9]}} = 0
#include <Cocoa/Cocoa.h>
extern void foo(void(^)(void));
@interface A:NSObject @end
@implementation A
- (void) helper {
int master = 0;
__block int m2 = 0;
__block int dbTransaction = 0;
int (^x)(void) = ^(void) { (void) self;
(void) master;
(void) dbTransaction;
m2++;
return m2;
};
master = x();
}
@end
void foo(void(^x)(void)) {}
int main() {
A *a = [A alloc];
[a helper];
return 0;
}

View File

@@ -1,25 +0,0 @@
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out
// DEBUGGER: break 14
// DEBUGGER: r
// DEBUGGER: p *this
// CHECK-NEXT-NOT: Cannot access memory at address
class A {
public:
A() : zero(0), data(42)
{
}
private:
int zero;
int data;
};
int main() {
A a;
return 0;
}

View File

@@ -1,41 +0,0 @@
// This test case checks debug info during register moves for an argument.
// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 -mllvm -fast-isel=false %s -c -o %t.o
// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out
//
// Radar 8412415
struct _mtx
{
long unsigned int ptr;
int waiters;
struct {
int tag;
int pad;
} mtxi;
};
int foobar(struct _mtx *mutex) {
int r = 1;
int l = 0;
int j = 0;
do {
if (mutex->waiters) {
r = 2;
}
j = bar(r, l);
++l;
} while (l < j);
return r + j;
}
int bar(int i, int j) {
return i + j;
}
int main() {
struct _mtx m;
m.waiters = 0;
return foobar(&m);
}

View File

@@ -1,31 +0,0 @@
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
// RUN: %test_debuginfo %s %t.out
//
// REQUIRES: system-darwin
// Radar 8757124
// DEBUGGER: break 25
// DEBUGGER: r
// DEBUGGER: po thing
// CHECK: aaa
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *things = [NSArray arrayWithObjects:@"one", @"two", @"three" , nil];
for (NSString *thing in things) {
NSLog (@"%@", thing);
}
things = [NSArray arrayWithObjects:@"aaa", @"bbb", @"ccc" , nil];
for (NSString *thing in things) {
NSLog (@"%@", thing);
}
[pool release];
return 0;
}

View File

@@ -1,27 +0,0 @@
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %test_debuginfo %s %t.o
// Radar 9168773
// DEBUGGER: ptype A
// Work around a gdb bug where it believes that a class is a
// struct if there aren't any methods - even though it's tagged
// as a class.
// CHECK: type = {{struct|class}} A {
// CHECK-NEXT: {{(public:){0,1}}}
// CHECK-NEXT: int MyData;
// CHECK-NEXT: }
class A;
class B {
public:
void foo(const A *p);
};
B iEntry;
class A {
public:
int MyData;
};
A irp;

View File

@@ -1,153 +0,0 @@
#!/bin/env python
"""
A gdb-compatible frontend for lldb that implements just enough
commands to run the tests in the debuginfo-tests repository with lldb.
"""
# ----------------------------------------------------------------------
# Auto-detect lldb python module.
import commands, platform, os, sys
try:
# Just try for LLDB in case PYTHONPATH is already correctly setup.
import lldb
except ImportError:
lldb_python_dirs = list()
# lldb is not in the PYTHONPATH, try some defaults for the current platform.
platform_system = platform.system()
if platform_system == 'Darwin':
# On Darwin, try the currently selected Xcode directory
xcode_dir = commands.getoutput("xcode-select --print-path")
if xcode_dir:
lldb_python_dirs.append(os.path.realpath(xcode_dir +
'/../SharedFrameworks/LLDB.framework/Resources/Python'))
lldb_python_dirs.append(xcode_dir +
'/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
lldb_python_dirs.append(
'/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
success = False
for lldb_python_dir in lldb_python_dirs:
if os.path.exists(lldb_python_dir):
if not (sys.path.__contains__(lldb_python_dir)):
sys.path.append(lldb_python_dir)
try:
import lldb
except ImportError:
pass
else:
print 'imported lldb from: "%s"' % (lldb_python_dir)
success = True
break
if not success:
print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly"
sys.exit(1)
# ----------------------------------------------------------------------
# Command line option handling.
import argparse
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--quiet', '-q', action="store_true", help='ignored')
parser.add_argument('-batch', action="store_true",
help='exit after processing comand line')
parser.add_argument('-n', action="store_true", help='ignore .lldb file')
parser.add_argument('-x', dest='script', type=file, help='execute commands from file')
parser.add_argument("target", help="the program to debug")
args = parser.parse_args()
# Create a new debugger instance.
debugger = lldb.SBDebugger.Create()
debugger.SkipLLDBInitFiles(args.n)
# Don't return from lldb function calls until the process stops.
debugger.SetAsync(False)
# Create a target from a file and arch.
arch = os.popen("file "+args.target).read().split()[-1]
target = debugger.CreateTargetWithFileAndArch(args.target, arch)
if not target:
print "Could not create target", args.target
sys.exit(1)
if not args.script:
print "Interactive mode is not implemented."
sys.exit(1)
import re
for command in args.script:
# Strip newline and whitespaces and split into words.
cmd = command[:-1].strip().split()
if not cmd:
continue
print '> %s'% command[:-1]
try:
if re.match('^r|(run)$', cmd[0]):
error = lldb.SBError()
launchinfo = lldb.SBLaunchInfo([])
launchinfo.SetWorkingDirectory(os.getcwd())
process = target.Launch(launchinfo, error)
print error
if not process or error.fail:
state = process.GetState()
print "State = %d" % state
print """
ERROR: Could not launch process.
NOTE: There are several reasons why this may happen:
* Root needs to run "DevToolsSecurity --enable".
* Older versions of lldb cannot launch more than one process simultaneously.
"""
sys.exit(1)
elif re.match('^b|(break)$', cmd[0]) and len(cmd) == 2:
if re.match('[0-9]+', cmd[1]):
# b line
mainfile = target.FindFunctions('main')[0].compile_unit.file
print target.BreakpointCreateByLocation(mainfile, int(cmd[1]))
else:
# b file:line
file, line = cmd[1].split(':')
print target.BreakpointCreateByLocation(file, int(line))
elif re.match('^ptype$', cmd[0]) and len(cmd) == 2:
# GDB's ptype has multiple incarnations depending on its
# argument (global variable, function, type). The definition
# here is for looking up the signature of a function and only
# if that fails it looks for a type with that name.
# Type lookup in LLDB would be "image lookup --type".
for elem in target.FindFunctions(cmd[1]):
print elem.function.type
continue
print target.FindFirstType(cmd[1])
elif re.match('^po$', cmd[0]) and len(cmd) > 1:
try:
opts = lldb.SBExpressionOptions()
opts.SetFetchDynamicValue(True)
opts.SetCoerceResultToId(True)
print target.EvaluateExpression(' '.join(cmd[1:]), opts)
except:
# FIXME: This is a fallback path for the lab.llvm.org
# buildbot running OS X 10.7; it should be removed.
thread = process.GetThreadAtIndex(0)
frame = thread.GetFrameAtIndex(0)
print frame.EvaluateExpression(' '.join(cmd[1:]))
elif re.match('^p|(print)$', cmd[0]) and len(cmd) > 1:
thread = process.GetThreadAtIndex(0)
frame = thread.GetFrameAtIndex(0)
print frame.EvaluateExpression(' '.join(cmd[1:]))
elif re.match('^q|(quit)$', cmd[0]):
sys.exit(0)
else:
print debugger.HandleCommand(' '.join(cmd))
except SystemExit:
lldb.SBDebugger_Terminate()
raise
except:
print 'Could not handle the command "%s"' % ' '.join(cmd)

View File

@@ -1,21 +0,0 @@
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %test_debuginfo %s %t.o
// Radar 9440721
// If debug info for my_number() is emitted outside function foo's scope
// then a debugger may not be able to handle it. At least one version of
// gdb crashes in such cases.
// DEBUGGER: ptype foo
// CHECK: int (void)
int foo() {
struct Local {
static int my_number() {
return 42;
}
};
int i = 0;
i = Local::my_number();
return i + 1;
}

View File

@@ -1,71 +0,0 @@
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out
// Radar 8775834
// DEBUGGER: break 62
// DEBUGGER: r
// DEBUGGER: p a
// CHECK: ${{[0-9]+}} =
// LLDB does not print artificial members.
// CHECK: {{(_vptr\$A =)?.*}}m_int = 12
class A
{
public:
A (int i=0);
A (const A& rhs);
const A&
operator= (const A& rhs);
virtual ~A() {}
int get_int();
protected:
int m_int;
};
A::A (int i) :
m_int(i)
{
}
A::A (const A& rhs) :
m_int (rhs.m_int)
{
}
const A &
A::operator =(const A& rhs)
{
m_int = rhs.m_int;
return *this;
}
int A::get_int()
{
return m_int;
}
class B
{
public:
B () {}
A AInstance();
};
A
B::AInstance()
{
A a(12);
return a;
}
int main (int argc, char const *argv[])
{
B b;
int return_val = b.AInstance().get_int();
A a(b.AInstance());
return return_val;
}

View File

@@ -1,39 +0,0 @@
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c
// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out
// RUN: %test_debuginfo %s %t.out
// FIXME: LLDB finds the wrong symbol for "C". rdar://problem/14933867
// XFAIL: darwin
// DEBUGGER: delete breakpoints
// DEBUGGER: break static-member.cpp:33
// DEBUGGER: r
// DEBUGGER: ptype C
// CHECK: {{struct|class}} C {
// CHECK: static const int a;
// CHECK-NEXT: static int b;
// CHECK-NEXT: static int c;
// CHECK-NEXT: int d;
// CHECK-NEXT: }
// DEBUGGER: p C::a
// CHECK: ${{[0-9]}} = 4
// DEBUGGER: p C::c
// CHECK: ${{[0-9]}} = 15
// PR14471, PR14734
class C {
public:
const static int a = 4;
static int b;
static int c;
int d;
};
int C::c = 15;
const int C::a;
int main() {
C instance_C;
return C::a;
}

View File

@@ -1,36 +0,0 @@
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c
// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out
// RUN: %test_debuginfo %s %t.out
// DEBUGGER: delete breakpoints
// DEBUGGER: break static-member.cpp:33
// DEBUGGER: r
// DEBUGGER: ptype MyClass
// CHECK: {{struct|class}} MyClass {
// CHECK: static const int a;
// CHECK-NEXT: static int b;
// CHECK-NEXT: static int c;
// CHECK-NEXT: int d;
// CHECK-NEXT: }
// DEBUGGER: p MyClass::a
// CHECK: ${{[0-9]}} = 4
// DEBUGGER: p MyClass::c
// CHECK: ${{[0-9]}} = 15
// PR14471, PR14734
class MyClass {
public:
const static int a = 4;
static int b;
static int c;
int d;
};
int MyClass::c = 15;
const int MyClass::a;
int main() {
MyClass instance_MyClass;
return MyClass::a;
}

View File

@@ -1,2 +0,0 @@
N: Peter Collingbourne
E: peter@pcc.me.uk

View File

@@ -1,64 +0,0 @@
==============================================================================
libclc License
==============================================================================
The libclc library is dual licensed under both the University of Illinois
"BSD-Like" license and the MIT license. As a user of this code you may choose
to use it under either license. As a contributor, you agree to allow your code
to be used under both.
Full text of the relevant licenses is included below.
==============================================================================
Copyright (c) 2011-2014 by the contributors listed in CREDITS.TXT
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* The names of the contributors may not be used to endorse or promote
products derived from this Software without specific prior written
permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
==============================================================================
Copyright (c) 2011-2014 by the contributors listed in CREDITS.TXT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,52 +0,0 @@
libclc
------
libclc is an open source, BSD licensed implementation of the library
requirements of the OpenCL C programming language, as specified by the
OpenCL 1.1 Specification. The following sections of the specification
impose library requirements:
* 6.1: Supported Data Types
* 6.2.3: Explicit Conversions
* 6.2.4.2: Reinterpreting Types Using as_type() and as_typen()
* 6.9: Preprocessor Directives and Macros
* 6.11: Built-in Functions
* 9.3: Double Precision Floating-Point
* 9.4: 64-bit Atomics
* 9.5: Writing to 3D image memory objects
* 9.6: Half Precision Floating-Point
libclc is intended to be used with the Clang compiler's OpenCL frontend.
libclc is designed to be portable and extensible. To this end, it provides
generic implementations of most library requirements, allowing the target
to override the generic implementation at the granularity of individual
functions.
libclc currently only supports the PTX target, but support for more
targets is welcome.
Compiling and installing with Make
----------------------------------
$ ./configure.py --with-llvm-config=/path/to/llvm-config && make
$ make install
Note you can use the DESTDIR Makefile variable to do staged installs.
$ make install DESTDIR=/path/for/staged/install
Compiling and installing with Ninja
-----------------------------------
$ ./configure.py -g ninja --with-llvm-config=/path/to/llvm-config && ninja
$ ninja install
Note you can use the DESTDIR environment variable to do staged installs.
$ DESTDIR=/path/for/staged/install ninja install
Website
-------
http://www.pcc.me.uk/~peter/libclc/

View File

@@ -1,100 +0,0 @@
import ninja_syntax
import os
# Simple meta-build system.
class Make(object):
def __init__(self):
self.output = open(self.output_filename(), 'w')
self.rules = {}
self.rule_text = ''
self.all_targets = []
self.default_targets = []
self.clean_files = []
self.distclean_files = []
self.output.write("""all::
ifndef VERBOSE
Verb = @
endif
""")
def output_filename(self):
return 'Makefile'
def rule(self, name, command, description=None, depfile=None,
generator=False):
self.rules[name] = {'command': command, 'description': description,
'depfile': depfile, 'generator': generator}
def build(self, output, rule, inputs=[], implicit=[], order_only=[]):
inputs = self._as_list(inputs)
implicit = self._as_list(implicit)
order_only = self._as_list(order_only)
output_dir = os.path.dirname(output)
if output_dir != '' and not os.path.isdir(output_dir):
os.makedirs(output_dir)
dollar_in = ' '.join(inputs)
subst = lambda text: text.replace('$in', dollar_in).replace('$out', output)
deps = ' '.join(inputs + implicit)
if order_only:
deps += ' | '
deps += ' '.join(order_only)
self.output.write('%s: %s\n' % (output, deps))
r = self.rules[rule]
command = subst(r['command'])
if r['description']:
desc = subst(r['description'])
self.output.write('\t@echo %s\n\t$(Verb) %s\n' % (desc, command))
else:
self.output.write('\t%s\n' % command)
if r['depfile']:
depfile = subst(r['depfile'])
self.output.write('-include '+depfile+'\n')
self.output.write('\n')
self.all_targets.append(output)
if r['generator']:
self.distclean_files.append(output)
if r['depfile']:
self.distclean_files.append(depfile)
else:
self.clean_files.append(output)
if r['depfile']:
self.distclean_files.append(depfile)
def _as_list(self, input):
if isinstance(input, list):
return input
return [input]
def default(self, paths):
self.default_targets += self._as_list(paths)
def finish(self):
self.output.write('all:: %s\n\n' % ' '.join(self.default_targets or self.all_targets))
self.output.write('clean: \n\trm -f %s\n\n' % ' '.join(self.clean_files))
self.output.write('distclean: clean\n\trm -f %s\n' % ' '.join(self.distclean_files))
class Ninja(ninja_syntax.Writer):
def __init__(self):
ninja_syntax.Writer.__init__(self, open(self.output_filename(), 'w'))
def output_filename(self):
return 'build.ninja'
def finish(self):
pass
def from_name(name):
if name == 'make':
return Make()
if name == 'ninja':
return Ninja()
raise LookupError, 'unknown generator: %s; supported generators are make and ninja' % name

View File

@@ -1,118 +0,0 @@
#!/usr/bin/python
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that already
use Python.
"""
import textwrap
import re
class Writer(object):
def __init__(self, output, width=78):
self.output = output
self.width = width
def newline(self):
self.output.write('\n')
def comment(self, text):
for line in textwrap.wrap(text, self.width - 2):
self.output.write('# ' + line + '\n')
def variable(self, key, value, indent=0):
if value is None:
return
if isinstance(value, list):
value = ' '.join(value)
self._line('%s = %s' % (key, value), indent)
def rule(self, name, command, description=None, depfile=None,
generator=False):
self._line('rule %s' % name)
self.variable('command', escape(command), indent=1)
if description:
self.variable('description', description, indent=1)
if depfile:
self.variable('depfile', depfile, indent=1)
if generator:
self.variable('generator', '1', indent=1)
def build(self, outputs, rule, inputs=None, implicit=None, order_only=None,
variables=None):
outputs = self._as_list(outputs)
all_inputs = self._as_list(inputs)[:]
if implicit:
all_inputs.append('|')
all_inputs.extend(self._as_list(implicit))
if order_only:
all_inputs.append('||')
all_inputs.extend(self._as_list(order_only))
self._line('build %s: %s %s' % (' '.join(outputs),
rule,
' '.join(all_inputs)))
if variables:
for key, val in variables:
self.variable(key, val, indent=1)
return outputs
def include(self, path):
self._line('include %s' % path)
def subninja(self, path):
self._line('subninja %s' % path)
def default(self, paths):
self._line('default %s' % ' '.join(self._as_list(paths)))
def _line(self, text, indent=0):
"""Write 'text' word-wrapped at self.width characters."""
leading_space = ' ' * indent
while len(text) > self.width:
# The text is too wide; wrap if possible.
# Find the rightmost space that would obey our width constraint.
available_space = self.width - len(leading_space) - len(' $')
space = text.rfind(' ', 0, available_space)
if space < 0:
# No such space; just use the first space we can find.
space = text.find(' ', available_space)
if space < 0:
# Give up on breaking.
break
self.output.write(leading_space + text[0:space] + ' $\n')
text = text[space+1:]
# Subsequent lines are continuations, so indent them.
leading_space = ' ' * (indent+2)
self.output.write(leading_space + text + '\n')
def _as_list(self, input):
if input is None:
return []
if isinstance(input, list):
return input
return [input]
def escape(string):
"""Escape a string such that Makefile and shell variables are
correctly escaped for use in a Ninja file.
"""
assert '\n' not in string, 'Ninja syntax does not allow newlines'
# We only have one special metacharacter: '$'.
# We should leave $in and $out untouched.
# Just look for makefile/shell style substitutions
return re.sub(r'(\$[{(][a-z_]+[})])',
r'$\1',
string,
flags=re.IGNORECASE)

View File

@@ -1,3 +0,0 @@
#!/bin/sh
clang -target nvptx--nvidiacl -Iptx-nvidiacl/include -Igeneric/include -Xclang -mlink-bitcode-file -Xclang nvptx--nvidiacl/lib/builtins.bc -include clc/clc.h -Dcl_clang_storage_class_specifiers -Dcl_khr_fp64 "$@"

View File

@@ -1,252 +0,0 @@
#!/usr/bin/python
def c_compiler_rule(b, name, description, compiler, flags):
command = "%s -MMD -MF $out.d %s -c -o $out $in" % (compiler, flags)
b.rule(name, command, description + " $out", depfile="$out.d")
version_major = 0;
version_minor = 1;
version_patch = 0;
from optparse import OptionParser
import os
import string
from subprocess import *
import sys
srcdir = os.path.dirname(sys.argv[0])
sys.path.insert(0, os.path.join(srcdir, 'build'))
import metabuild
p = OptionParser()
p.add_option('--with-llvm-config', metavar='PATH',
help='use given llvm-config script')
p.add_option('--with-cxx-compiler', metavar='PATH',
help='use given C++ compiler')
p.add_option('--prefix', metavar='PATH',
help='install to given prefix')
p.add_option('--libexecdir', metavar='PATH',
help='install *.bc to given dir')
p.add_option('--includedir', metavar='PATH',
help='install include files to given dir')
p.add_option('--pkgconfigdir', metavar='PATH',
help='install clc.pc to given dir')
p.add_option('-g', metavar='GENERATOR', default='make',
help='use given generator (default: make)')
(options, args) = p.parse_args()
llvm_config_exe = options.with_llvm_config or "llvm-config"
prefix = options.prefix
if not prefix:
prefix = '/usr/local'
libexecdir = options.libexecdir
if not libexecdir:
libexecdir = os.path.join(prefix, 'lib/clc')
includedir = options.includedir
if not includedir:
includedir = os.path.join(prefix, 'include')
pkgconfigdir = options.pkgconfigdir
if not pkgconfigdir:
pkgconfigdir = os.path.join(prefix, 'share/pkgconfig')
def llvm_config(args):
try:
proc = Popen([llvm_config_exe] + args, stdout=PIPE)
return proc.communicate()[0].rstrip().replace('\n', ' ')
except OSError:
print "Error executing llvm-config."
print "Please ensure that llvm-config is in your $PATH, or use --with-llvm-config."
sys.exit(1)
llvm_version = string.split(string.replace(llvm_config(['--version']), 'svn', ''), '.')
if (int(llvm_version[0]) != 3 and int(llvm_version[1]) != 6):
print "libclc requires LLVM 3.6"
sys.exit(1)
llvm_system_libs = llvm_config(['--system-libs'])
llvm_bindir = llvm_config(['--bindir'])
llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' ' + \
llvm_system_libs + ' ' + \
llvm_config(['--ldflags'])
llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti'
llvm_libdir = llvm_config(['--libdir'])
llvm_clang = os.path.join(llvm_bindir, 'clang')
llvm_link = os.path.join(llvm_bindir, 'llvm-link')
llvm_opt = os.path.join(llvm_bindir, 'opt')
cxx_compiler = options.with_cxx_compiler
if not cxx_compiler:
cxx_compiler = os.path.join(llvm_bindir, 'clang++')
available_targets = {
'r600--' : { 'devices' :
[{'gpu' : 'cedar', 'aliases' : ['palm', 'sumo', 'sumo2', 'redwood', 'juniper']},
{'gpu' : 'cypress', 'aliases' : ['hemlock']},
{'gpu' : 'barts', 'aliases' : ['turks', 'caicos']},
{'gpu' : 'cayman', 'aliases' : ['aruba']}]},
'amdgcn--': { 'devices' :
[{'gpu' : 'tahiti', 'aliases' : ['pitcairn', 'verde', 'oland', 'hainan', 'bonaire', 'kabini', 'kaveri', 'hawaii','mullins']}]},
'nvptx--' : { 'devices' : [{'gpu' : '', 'aliases' : []}]},
'nvptx64--' : { 'devices' : [{'gpu' : '', 'aliases' : []}] },
'nvptx--nvidiacl' : { 'devices' : [{'gpu' : '', 'aliases' : []}] },
'nvptx64--nvidiacl' : { 'devices' : [{'gpu' : '', 'aliases' : []}] }
}
default_targets = ['nvptx--nvidiacl', 'nvptx64--nvidiacl', 'r600--', 'amdgcn--']
targets = args
if not targets:
targets = default_targets
b = metabuild.from_name(options.g)
b.rule("LLVM_AS", "%s -o $out $in" % os.path.join(llvm_bindir, "llvm-as"),
'LLVM-AS $out')
b.rule("LLVM_LINK", command = llvm_link + " -o $out $in",
description = 'LLVM-LINK $out')
b.rule("OPT", command = llvm_opt + " -O3 -o $out $in",
description = 'OPT $out')
c_compiler_rule(b, "LLVM_TOOL_CXX", 'CXX', cxx_compiler, llvm_cxxflags)
b.rule("LLVM_TOOL_LINK", cxx_compiler + " -o $out $in %s" % llvm_core_libs + " -Wl,-rpath %s" % llvm_libdir, 'LINK $out')
prepare_builtins = os.path.join('utils', 'prepare-builtins')
b.build(os.path.join('utils', 'prepare-builtins.o'), "LLVM_TOOL_CXX",
os.path.join(srcdir, 'utils', 'prepare-builtins.cpp'))
b.build(prepare_builtins, "LLVM_TOOL_LINK",
os.path.join('utils', 'prepare-builtins.o'))
b.rule("PREPARE_BUILTINS", "%s -o $out $in" % prepare_builtins,
'PREPARE-BUILTINS $out')
b.rule("PYTHON_GEN", "python < $in > $out", "PYTHON_GEN $out")
b.build('generic/lib/convert.cl', "PYTHON_GEN", ['generic/lib/gen_convert.py'])
manifest_deps = set([sys.argv[0], os.path.join(srcdir, 'build', 'metabuild.py'),
os.path.join(srcdir, 'build', 'ninja_syntax.py')])
install_files_bc = []
install_deps = []
# Create libclc.pc
clc = open('libclc.pc', 'w')
clc.write('includedir=%(inc)s\nlibexecdir=%(lib)s\n\nName: libclc\nDescription: Library requirements of the OpenCL C programming language\nVersion: %(maj)s.%(min)s.%(pat)s\nCflags: -I${includedir}\nLibs: -L${libexecdir}' %
{'inc': includedir, 'lib': libexecdir, 'maj': version_major, 'min': version_minor, 'pat': version_patch})
clc.close()
for target in targets:
(t_arch, t_vendor, t_os) = target.split('-')
archs = [t_arch]
if t_arch == 'nvptx' or t_arch == 'nvptx64':
archs.append('ptx')
archs.append('generic')
subdirs = []
for arch in archs:
subdirs.append("%s-%s-%s" % (arch, t_vendor, t_os))
subdirs.append("%s-%s" % (arch, t_os))
subdirs.append(arch)
if arch == 'amdgcn':
subdirs.append('r600')
incdirs = filter(os.path.isdir,
[os.path.join(srcdir, subdir, 'include') for subdir in subdirs])
libdirs = filter(lambda d: os.path.isfile(os.path.join(d, 'SOURCES')),
[os.path.join(srcdir, subdir, 'lib') for subdir in subdirs])
clang_cl_includes = ' '.join(["-I%s" % incdir for incdir in incdirs])
for device in available_targets[target]['devices']:
# The rule for building a .bc file for the specified architecture using clang.
clang_bc_flags = "-target %s -I`dirname $in` %s " \
"-fno-builtin " \
"-Dcl_clang_storage_class_specifiers " \
"-Dcl_khr_fp64 " \
"-Dcles_khr_int64 " \
"-D__CLC_INTERNAL " \
"-emit-llvm" % (target, clang_cl_includes)
if device['gpu'] != '':
clang_bc_flags += ' -mcpu=' + device['gpu']
clang_bc_rule = "CLANG_CL_BC_" + target + "_" + device['gpu']
c_compiler_rule(b, clang_bc_rule, "LLVM-CC", llvm_clang, clang_bc_flags)
objects = []
sources_seen = set()
if device['gpu'] == '':
full_target_name = target
obj_suffix = ''
else:
full_target_name = device['gpu'] + '-' + target
obj_suffix = '.' + device['gpu']
for libdir in libdirs:
subdir_list_file = os.path.join(libdir, 'SOURCES')
manifest_deps.add(subdir_list_file)
override_list_file = os.path.join(libdir, 'OVERRIDES')
# Add target overrides
if os.path.exists(override_list_file):
for override in open(override_list_file).readlines():
override = override.rstrip()
sources_seen.add(override)
for src in open(subdir_list_file).readlines():
src = src.rstrip()
if src not in sources_seen:
sources_seen.add(src)
obj = os.path.join(target, 'lib', src + obj_suffix + '.bc')
objects.append(obj)
src_file = os.path.join(libdir, src)
ext = os.path.splitext(src)[1]
if ext == '.ll':
b.build(obj, 'LLVM_AS', src_file)
else:
b.build(obj, clang_bc_rule, src_file)
builtins_link_bc = os.path.join(target, 'lib', 'builtins.link' + obj_suffix + '.bc')
builtins_opt_bc = os.path.join(target, 'lib', 'builtins.opt' + obj_suffix + '.bc')
builtins_bc = os.path.join('built_libs', full_target_name + '.bc')
b.build(builtins_link_bc, "LLVM_LINK", objects)
b.build(builtins_opt_bc, "OPT", builtins_link_bc)
b.build(builtins_bc, "PREPARE_BUILTINS", builtins_opt_bc, prepare_builtins)
install_files_bc.append((builtins_bc, builtins_bc))
install_deps.append(builtins_bc)
for alias in device['aliases']:
# Ninja cannot have multiple rules with same name so append suffix
ruleName = "CREATE_ALIAS_{0}_for_{1}".format(alias, device['gpu'])
b.rule(ruleName, "ln -fs %s $out" % os.path.basename(builtins_bc)
,"CREATE-ALIAS $out")
alias_file = os.path.join('built_libs', alias + '-' + target + '.bc')
b.build(alias_file, ruleName, builtins_bc)
install_files_bc.append((alias_file, alias_file))
install_deps.append(alias_file)
b.default(builtins_bc)
install_cmd = ' && '.join(['mkdir -p ${DESTDIR}/%(dst)s && cp -r %(src)s ${DESTDIR}/%(dst)s' %
{'src': file,
'dst': libexecdir}
for (file, dest) in install_files_bc])
install_cmd = ' && '.join(['%(old)s && mkdir -p ${DESTDIR}/%(dst)s && cp -r %(srcdir)s/generic/include/clc ${DESTDIR}/%(dst)s' %
{'old': install_cmd,
'dst': includedir,
'srcdir': srcdir}])
install_cmd = ' && '.join(['%(old)s && mkdir -p ${DESTDIR}/%(dst)s && cp -r libclc.pc ${DESTDIR}/%(dst)s' %
{'old': install_cmd,
'dst': pkgconfigdir}])
b.rule('install', command = install_cmd, description = 'INSTALL')
b.build('install', 'install', install_deps)
b.rule("configure", command = ' '.join(sys.argv), description = 'CONFIGURE',
generator = True)
b.build(b.output_filename(), 'configure', list(manifest_deps))
b.finish()

View File

@@ -1,68 +0,0 @@
#define as_char(x) __builtin_astype(x, char)
#define as_uchar(x) __builtin_astype(x, uchar)
#define as_short(x) __builtin_astype(x, short)
#define as_ushort(x) __builtin_astype(x, ushort)
#define as_int(x) __builtin_astype(x, int)
#define as_uint(x) __builtin_astype(x, uint)
#define as_long(x) __builtin_astype(x, long)
#define as_ulong(x) __builtin_astype(x, ulong)
#define as_float(x) __builtin_astype(x, float)
#define as_char2(x) __builtin_astype(x, char2)
#define as_uchar2(x) __builtin_astype(x, uchar2)
#define as_short2(x) __builtin_astype(x, short2)
#define as_ushort2(x) __builtin_astype(x, ushort2)
#define as_int2(x) __builtin_astype(x, int2)
#define as_uint2(x) __builtin_astype(x, uint2)
#define as_long2(x) __builtin_astype(x, long2)
#define as_ulong2(x) __builtin_astype(x, ulong2)
#define as_float2(x) __builtin_astype(x, float2)
#define as_char3(x) __builtin_astype(x, char3)
#define as_uchar3(x) __builtin_astype(x, uchar3)
#define as_short3(x) __builtin_astype(x, short3)
#define as_ushort3(x) __builtin_astype(x, ushort3)
#define as_int3(x) __builtin_astype(x, int3)
#define as_uint3(x) __builtin_astype(x, uint3)
#define as_long3(x) __builtin_astype(x, long3)
#define as_ulong3(x) __builtin_astype(x, ulong3)
#define as_float3(x) __builtin_astype(x, float3)
#define as_char4(x) __builtin_astype(x, char4)
#define as_uchar4(x) __builtin_astype(x, uchar4)
#define as_short4(x) __builtin_astype(x, short4)
#define as_ushort4(x) __builtin_astype(x, ushort4)
#define as_int4(x) __builtin_astype(x, int4)
#define as_uint4(x) __builtin_astype(x, uint4)
#define as_long4(x) __builtin_astype(x, long4)
#define as_ulong4(x) __builtin_astype(x, ulong4)
#define as_float4(x) __builtin_astype(x, float4)
#define as_char8(x) __builtin_astype(x, char8)
#define as_uchar8(x) __builtin_astype(x, uchar8)
#define as_short8(x) __builtin_astype(x, short8)
#define as_ushort8(x) __builtin_astype(x, ushort8)
#define as_int8(x) __builtin_astype(x, int8)
#define as_uint8(x) __builtin_astype(x, uint8)
#define as_long8(x) __builtin_astype(x, long8)
#define as_ulong8(x) __builtin_astype(x, ulong8)
#define as_float8(x) __builtin_astype(x, float8)
#define as_char16(x) __builtin_astype(x, char16)
#define as_uchar16(x) __builtin_astype(x, uchar16)
#define as_short16(x) __builtin_astype(x, short16)
#define as_ushort16(x) __builtin_astype(x, ushort16)
#define as_int16(x) __builtin_astype(x, int16)
#define as_uint16(x) __builtin_astype(x, uint16)
#define as_long16(x) __builtin_astype(x, long16)
#define as_ulong16(x) __builtin_astype(x, ulong16)
#define as_float16(x) __builtin_astype(x, float16)
#ifdef cl_khr_fp64
#define as_double(x) __builtin_astype(x, double)
#define as_double2(x) __builtin_astype(x, double2)
#define as_double3(x) __builtin_astype(x, double3)
#define as_double4(x) __builtin_astype(x, double4)
#define as_double8(x) __builtin_astype(x, double8)
#define as_double16(x) __builtin_astype(x, double16)
#endif

View File

@@ -1,15 +0,0 @@
#define __CLC_DST_ADDR_SPACE local
#define __CLC_SRC_ADDR_SPACE global
#define __CLC_BODY <clc/async/async_work_group_copy.inc>
#include <clc/async/gentype.inc>
#undef __CLC_DST_ADDR_SPACE
#undef __CLC_SRC_ADDR_SPACE
#undef __CLC_BODY
#define __CLC_DST_ADDR_SPACE global
#define __CLC_SRC_ADDR_SPACE local
#define __CLC_BODY <clc/async/async_work_group_copy.inc>
#include <clc/async/gentype.inc>
#undef __CLC_DST_ADDR_SPACE
#undef __CLC_SRC_ADDR_SPACE
#undef __CLC_BODY

View File

@@ -1,5 +0,0 @@
_CLC_OVERLOAD _CLC_DECL event_t async_work_group_copy(
__CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
size_t num_gentypes,
event_t event);

View File

@@ -1,15 +0,0 @@
#define __CLC_DST_ADDR_SPACE local
#define __CLC_SRC_ADDR_SPACE global
#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
#include <clc/async/gentype.inc>
#undef __CLC_DST_ADDR_SPACE
#undef __CLC_SRC_ADDR_SPACE
#undef __CLC_BODY
#define __CLC_DST_ADDR_SPACE global
#define __CLC_SRC_ADDR_SPACE local
#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
#include <clc/async/gentype.inc>
#undef __CLC_DST_ADDR_SPACE
#undef __CLC_SRC_ADDR_SPACE
#undef __CLC_BODY

View File

@@ -1,6 +0,0 @@
_CLC_OVERLOAD _CLC_DECL event_t async_work_group_strided_copy(
__CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
size_t num_gentypes,
size_t stride,
event_t event);

View File

@@ -1,204 +0,0 @@
#define __CLC_GENTYPE char
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE char2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE char4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE char8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE char16
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uchar
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uchar2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uchar4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uchar8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uchar16
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE short
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE short2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE short4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE short8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE short16
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ushort
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ushort2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ushort4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ushort8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ushort16
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE int
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE int2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE int4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE int8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE int16
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uint
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uint2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uint4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uint8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE uint16
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE float
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE float2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE float4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE float8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE float16
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE long
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE long2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE long4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE long8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE long16
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ulong
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ulong2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ulong4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ulong8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE ulong16
#include __CLC_BODY
#undef __CLC_GENTYPE
#ifdef cl_khr_fp64
#define __CLC_GENTYPE double
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE double2
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE double4
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE double8
#include __CLC_BODY
#undef __CLC_GENTYPE
#define __CLC_GENTYPE double16
#include __CLC_BODY
#undef __CLC_GENTYPE
#endif

View File

@@ -1,3 +0,0 @@
#define __CLC_BODY <clc/async/prefetch.inc>
#include <clc/async/gentype.inc>
#undef __CLC_BODY

View File

@@ -1 +0,0 @@
_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes);

View File

@@ -1 +0,0 @@
void wait_group_events(int num_events, event_t *event_list);

View File

@@ -1,5 +0,0 @@
#define __CLC_FUNCTION atomic_add
#include <clc/atomic/atomic_decl.inc>
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

View File

@@ -1,5 +0,0 @@
#define __CLC_FUNCTION atomic_and
#include <clc/atomic/atomic_decl.inc>
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

View File

@@ -1,15 +0,0 @@
#define __CLC_FUNCTION atomic_cmpxchg
#define __CLC_DECLARE_ATOMIC_3_ARG(ADDRSPACE, TYPE) \
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE, TYPE);
#define __CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(TYPE) \
__CLC_DECLARE_ATOMIC_3_ARG(global, TYPE) \
__CLC_DECLARE_ATOMIC_3_ARG(local, TYPE)
__CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(int)
__CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(uint)
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC_3_ARG
#undef __CLC_DECLARE_ATOMIC_ADDRESS_SPACE_3_ARG

View File

@@ -1 +0,0 @@
#define atomic_dec(p) atomic_sub(p, 1)

View File

@@ -1,10 +0,0 @@
#define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE) \
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE);
#define __CLC_DECLARE_ATOMIC_ADDRSPACE(TYPE) \
__CLC_DECLARE_ATOMIC(global, TYPE) \
__CLC_DECLARE_ATOMIC(local, TYPE)
__CLC_DECLARE_ATOMIC_ADDRSPACE(int)
__CLC_DECLARE_ATOMIC_ADDRSPACE(uint)

View File

@@ -1 +0,0 @@
#define atomic_inc(p) atomic_add(p, 1)

View File

@@ -1,5 +0,0 @@
#define __CLC_FUNCTION atomic_max
#include <clc/atomic/atomic_decl.inc>
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

View File

@@ -1,5 +0,0 @@
#define __CLC_FUNCTION atomic_min
#include <clc/atomic/atomic_decl.inc>
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

View File

@@ -1,5 +0,0 @@
#define __CLC_FUNCTION atomic_or
#include <clc/atomic/atomic_decl.inc>
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

View File

@@ -1,5 +0,0 @@
#define __CLC_FUNCTION atomic_sub
#include <clc/atomic/atomic_decl.inc>
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

View File

@@ -1,6 +0,0 @@
#define __CLC_FUNCTION atomic_xchg
#include <clc/atomic/atomic_decl.inc>
__CLC_DECLARE_ATOMIC_ADDRSPACE(float);
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

View File

@@ -1,5 +0,0 @@
#define __CLC_FUNCTION atomic_xor
#include <clc/atomic/atomic_decl.inc>
#undef __CLC_FUNCTION
#undef __CLC_DECLARE_ATOMIC
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_add(global int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(global unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(global int *p, int cmp, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(global unsigned int *p, unsigned int cmp, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_dec(global int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(global unsigned int *p);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_inc(global int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(global unsigned int *p);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_sub(global int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(global unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_xchg(global int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(global unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_and(global int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_and(global unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_max(global int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_max(global unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_min(global int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_min(global unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_or(global int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_or(global unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_xor(global int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_xor(global unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_add(local int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(local unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(local int *p, int cmp, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(local unsigned int *p, unsigned int cmp, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_dec(local int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(local unsigned int *p);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_inc(local int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(local unsigned int *p);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_sub(local int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(local unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_xchg(local int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(local unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_and(local int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_and(local unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_max(local int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_max(local unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_min(local int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_min(local unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_or(local int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_or(local unsigned int *p, unsigned int val);

View File

@@ -1,2 +0,0 @@
_CLC_OVERLOAD _CLC_DECL int atom_xor(local int *p, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_xor(local unsigned int *p, unsigned int val);

View File

@@ -1,195 +0,0 @@
#ifndef cl_clang_storage_class_specifiers
#error Implementation requires cl_clang_storage_class_specifiers extension!
#endif
#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
/* Function Attributes */
#include <clc/clcfunc.h>
/* 6.1 Supported Data Types */
#include <clc/clctypes.h>
/* 6.2.3 Explicit Conversions */
#include <clc/convert.h>
/* 6.2.4.2 Reinterpreting Types Using as_type() and as_typen() */
#include <clc/as_type.h>
/* 6.9 Preprocessor Directives and Macros */
#include <clc/clcversion.h>
/* 6.11.1 Work-Item Functions */
#include <clc/workitem/get_global_size.h>
#include <clc/workitem/get_global_id.h>
#include <clc/workitem/get_local_size.h>
#include <clc/workitem/get_local_id.h>
#include <clc/workitem/get_num_groups.h>
#include <clc/workitem/get_group_id.h>
/* 6.11.2 Math Functions */
#include <clc/math/acos.h>
#include <clc/math/asin.h>
#include <clc/math/atan.h>
#include <clc/math/atan2.h>
#include <clc/math/copysign.h>
#include <clc/math/cos.h>
#include <clc/math/ceil.h>
#include <clc/math/exp.h>
#include <clc/math/exp10.h>
#include <clc/math/exp2.h>
#include <clc/math/fabs.h>
#include <clc/math/floor.h>
#include <clc/math/fma.h>
#include <clc/math/fmax.h>
#include <clc/math/fmin.h>
#include <clc/math/fmod.h>
#include <clc/math/hypot.h>
#include <clc/math/log.h>
#include <clc/math/log1p.h>
#include <clc/math/log2.h>
#include <clc/math/mad.h>
#include <clc/math/mix.h>
#include <clc/math/nextafter.h>
#include <clc/math/pow.h>
#include <clc/math/pown.h>
#include <clc/math/rint.h>
#include <clc/math/round.h>
#include <clc/math/sin.h>
#include <clc/math/sincos.h>
#include <clc/math/sqrt.h>
#include <clc/math/tan.h>
#include <clc/math/trunc.h>
#include <clc/math/native_cos.h>
#include <clc/math/native_divide.h>
#include <clc/math/native_exp.h>
#include <clc/math/native_exp10.h>
#include <clc/math/native_exp2.h>
#include <clc/math/native_log.h>
#include <clc/math/native_log2.h>
#include <clc/math/native_powr.h>
#include <clc/math/native_sin.h>
#include <clc/math/native_sqrt.h>
#include <clc/math/rsqrt.h>
/* 6.11.2.1 Floating-point macros */
#include <clc/float/definitions.h>
/* 6.11.3 Integer Functions */
#include <clc/integer/abs.h>
#include <clc/integer/abs_diff.h>
#include <clc/integer/add_sat.h>
#include <clc/integer/clz.h>
#include <clc/integer/hadd.h>
#include <clc/integer/mad24.h>
#include <clc/integer/mad_hi.h>
#include <clc/integer/mad_sat.h>
#include <clc/integer/mul24.h>
#include <clc/integer/mul_hi.h>
#include <clc/integer/rhadd.h>
#include <clc/integer/rotate.h>
#include <clc/integer/sub_sat.h>
#include <clc/integer/upsample.h>
/* 6.11.3 Integer Definitions */
#include <clc/integer/definitions.h>
/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
#include <clc/shared/clamp.h>
#include <clc/shared/max.h>
#include <clc/shared/min.h>
#include <clc/shared/vload.h>
#include <clc/shared/vstore.h>
/* 6.11.4 Common Functions */
#include <clc/common/sign.h>
/* 6.11.5 Geometric Functions */
#include <clc/geometric/cross.h>
#include <clc/geometric/dot.h>
#include <clc/geometric/length.h>
#include <clc/geometric/normalize.h>
/* 6.11.6 Relational Functions */
#include <clc/relational/all.h>
#include <clc/relational/any.h>
#include <clc/relational/bitselect.h>
#include <clc/relational/isequal.h>
#include <clc/relational/isfinite.h>
#include <clc/relational/isgreater.h>
#include <clc/relational/isgreaterequal.h>
#include <clc/relational/isinf.h>
#include <clc/relational/isless.h>
#include <clc/relational/islessequal.h>
#include <clc/relational/islessgreater.h>
#include <clc/relational/isnan.h>
#include <clc/relational/isnormal.h>
#include <clc/relational/isnotequal.h>
#include <clc/relational/isordered.h>
#include <clc/relational/isunordered.h>
#include <clc/relational/select.h>
#include <clc/relational/signbit.h>
/* 6.11.8 Synchronization Functions */
#include <clc/synchronization/cl_mem_fence_flags.h>
#include <clc/synchronization/barrier.h>
/* 6.11.10 Async Copy and Prefetch Functions */
#include <clc/async/async_work_group_copy.h>
#include <clc/async/async_work_group_strided_copy.h>
#include <clc/async/prefetch.h>
#include <clc/async/wait_group_events.h>
/* 6.11.11 Atomic Functions */
#include <clc/atomic/atomic_add.h>
#include <clc/atomic/atomic_and.h>
#include <clc/atomic/atomic_cmpxchg.h>
#include <clc/atomic/atomic_dec.h>
#include <clc/atomic/atomic_inc.h>
#include <clc/atomic/atomic_max.h>
#include <clc/atomic/atomic_min.h>
#include <clc/atomic/atomic_or.h>
#include <clc/atomic/atomic_sub.h>
#include <clc/atomic/atomic_xchg.h>
#include <clc/atomic/atomic_xor.h>
/* cl_khr_global_int32_base_atomics Extension Functions */
#include <clc/cl_khr_global_int32_base_atomics/atom_add.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_dec.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_inc.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_sub.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_xchg.h>
/* cl_khr_global_int32_extended_atomics Extension Functions */
#include <clc/cl_khr_global_int32_extended_atomics/atom_and.h>
#include <clc/cl_khr_global_int32_extended_atomics/atom_max.h>
#include <clc/cl_khr_global_int32_extended_atomics/atom_min.h>
#include <clc/cl_khr_global_int32_extended_atomics/atom_or.h>
#include <clc/cl_khr_global_int32_extended_atomics/atom_xor.h>
/* cl_khr_local_int32_base_atomics Extension Functions */
#include <clc/cl_khr_local_int32_base_atomics/atom_add.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_dec.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_inc.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_sub.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_xchg.h>
/* cl_khr_local_int32_extended_atomics Extension Functions */
#include <clc/cl_khr_local_int32_extended_atomics/atom_and.h>
#include <clc/cl_khr_local_int32_extended_atomics/atom_max.h>
#include <clc/cl_khr_local_int32_extended_atomics/atom_min.h>
#include <clc/cl_khr_local_int32_extended_atomics/atom_or.h>
#include <clc/cl_khr_local_int32_extended_atomics/atom_xor.h>
/* libclc internal defintions */
#ifdef __CLC_INTERNAL
#include <math/clc_nextafter.h>
#endif
#pragma OPENCL EXTENSION all : disable

View File

@@ -1,4 +0,0 @@
#define _CLC_OVERLOAD __attribute__((overloadable))
#define _CLC_DECL
#define _CLC_DEF __attribute__((always_inline))
#define _CLC_INLINE __attribute__((always_inline)) inline

View File

@@ -1,89 +0,0 @@
/* 6.1.1 Built-in Scalar Data Types */
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#define __stdint_join3(a,b,c) a ## b ## c
#define __intn_t(n) __stdint_join3(__INT, n, _TYPE__)
#define __uintn_t(n) __stdint_join3(unsigned __INT, n, _TYPE__)
typedef __intn_t(__INTPTR_WIDTH__) intptr_t;
typedef __uintn_t(__INTPTR_WIDTH__) uintptr_t;
#undef __uintn_t
#undef __intn_t
#undef __stdint_join3
/* 6.1.2 Built-in Vector Data Types */
typedef __attribute__((ext_vector_type(2))) char char2;
typedef __attribute__((ext_vector_type(3))) char char3;
typedef __attribute__((ext_vector_type(4))) char char4;
typedef __attribute__((ext_vector_type(8))) char char8;
typedef __attribute__((ext_vector_type(16))) char char16;
typedef __attribute__((ext_vector_type(2))) uchar uchar2;
typedef __attribute__((ext_vector_type(3))) uchar uchar3;
typedef __attribute__((ext_vector_type(4))) uchar uchar4;
typedef __attribute__((ext_vector_type(8))) uchar uchar8;
typedef __attribute__((ext_vector_type(16))) uchar uchar16;
typedef __attribute__((ext_vector_type(2))) short short2;
typedef __attribute__((ext_vector_type(3))) short short3;
typedef __attribute__((ext_vector_type(4))) short short4;
typedef __attribute__((ext_vector_type(8))) short short8;
typedef __attribute__((ext_vector_type(16))) short short16;
typedef __attribute__((ext_vector_type(2))) ushort ushort2;
typedef __attribute__((ext_vector_type(3))) ushort ushort3;
typedef __attribute__((ext_vector_type(4))) ushort ushort4;
typedef __attribute__((ext_vector_type(8))) ushort ushort8;
typedef __attribute__((ext_vector_type(16))) ushort ushort16;
typedef __attribute__((ext_vector_type(2))) int int2;
typedef __attribute__((ext_vector_type(3))) int int3;
typedef __attribute__((ext_vector_type(4))) int int4;
typedef __attribute__((ext_vector_type(8))) int int8;
typedef __attribute__((ext_vector_type(16))) int int16;
typedef __attribute__((ext_vector_type(2))) uint uint2;
typedef __attribute__((ext_vector_type(3))) uint uint3;
typedef __attribute__((ext_vector_type(4))) uint uint4;
typedef __attribute__((ext_vector_type(8))) uint uint8;
typedef __attribute__((ext_vector_type(16))) uint uint16;
typedef __attribute__((ext_vector_type(2))) long long2;
typedef __attribute__((ext_vector_type(3))) long long3;
typedef __attribute__((ext_vector_type(4))) long long4;
typedef __attribute__((ext_vector_type(8))) long long8;
typedef __attribute__((ext_vector_type(16))) long long16;
typedef __attribute__((ext_vector_type(2))) ulong ulong2;
typedef __attribute__((ext_vector_type(3))) ulong ulong3;
typedef __attribute__((ext_vector_type(4))) ulong ulong4;
typedef __attribute__((ext_vector_type(8))) ulong ulong8;
typedef __attribute__((ext_vector_type(16))) ulong ulong16;
typedef __attribute__((ext_vector_type(2))) float float2;
typedef __attribute__((ext_vector_type(3))) float float3;
typedef __attribute__((ext_vector_type(4))) float float4;
typedef __attribute__((ext_vector_type(8))) float float8;
typedef __attribute__((ext_vector_type(16))) float float16;
/* 9.3 Double Precision Floating-Point */
#ifdef cl_khr_fp64
typedef __attribute__((ext_vector_type(2))) double double2;
typedef __attribute__((ext_vector_type(3))) double double3;
typedef __attribute__((ext_vector_type(4))) double double4;
typedef __attribute__((ext_vector_type(8))) double double8;
typedef __attribute__((ext_vector_type(16))) double double16;
#endif
#define NULL ((void *)0)

View File

@@ -1,8 +0,0 @@
#if __OPENCL_VERSION__ >= 110
#define CLC_VERSION_1_0 100
#define CLC_VERSION_1_1 110
#endif
#if __OPENCL_VERSION__ >= 120
#define CLC_VERSION_1_2 120
#endif

View File

@@ -1,5 +0,0 @@
#define __CLC_FUNCTION sign
#define __CLC_BODY <clc/math/unary_decl.inc>
#include <clc/math/gentype.inc>
#undef __CLC_FUNCTION
#undef __CLC_BODY

View File

@@ -1,60 +0,0 @@
#define _CLC_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \
_CLC_OVERLOAD _CLC_DECL TO_TYPE convert_##TO_TYPE##SUFFIX(FROM_TYPE x);
#define _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \
_CLC_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \
_CLC_CONVERT_DECL(FROM_TYPE##2, TO_TYPE##2, SUFFIX) \
_CLC_CONVERT_DECL(FROM_TYPE##3, TO_TYPE##3, SUFFIX) \
_CLC_CONVERT_DECL(FROM_TYPE##4, TO_TYPE##4, SUFFIX) \
_CLC_CONVERT_DECL(FROM_TYPE##8, TO_TYPE##8, SUFFIX) \
_CLC_CONVERT_DECL(FROM_TYPE##16, TO_TYPE##16, SUFFIX)
#define _CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, char, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, uchar, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, int, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, uint, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, short, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, ushort, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, long, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, ulong, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, float, SUFFIX)
#ifdef cl_khr_fp64
#define _CLC_VECTOR_CONVERT_FROM(FROM_TYPE, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX) \
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, double, SUFFIX)
#else
#define _CLC_VECTOR_CONVERT_FROM(FROM_TYPE, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX)
#endif
#define _CLC_VECTOR_CONVERT_TO1(SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(char, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(uchar, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(int, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(uint, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(short, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(ushort, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(long, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(ulong, SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(float, SUFFIX)
#ifdef cl_khr_fp64
#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
_CLC_VECTOR_CONVERT_TO1(SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(double, SUFFIX)
#else
#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
_CLC_VECTOR_CONVERT_TO1(SUFFIX)
#endif
#define _CLC_VECTOR_CONVERT_TO_SUFFIX(ROUND) \
_CLC_VECTOR_CONVERT_TO(_sat##ROUND) \
_CLC_VECTOR_CONVERT_TO(ROUND)
_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtn)
_CLC_VECTOR_CONVERT_TO_SUFFIX(_rte)
_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtz)
_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtp)
_CLC_VECTOR_CONVERT_TO_SUFFIX()

View File

@@ -1,74 +0,0 @@
#define MAXFLOAT 0x1.fffffep127f
#define HUGE_VALF __builtin_huge_valf()
#define INFINITY __builtin_inff()
#define NAN __builtin_nanf("")
#define FLT_DIG 6
#define FLT_MANT_DIG 24
#define FLT_MAX_10_EXP +38
#define FLT_MAX_EXP +128
#define FLT_MIN_10_EXP -37
#define FLT_MIN_EXP -125
#define FLT_RADIX 2
#define FLT_MAX MAXFLOAT
#define FLT_MIN 0x1.0p-126f
#define FLT_EPSILON 0x1.0p-23f
#define M_E_F 0x1.5bf0a8p+1f
#define M_LOG2E_F 0x1.715476p+0f
#define M_LOG10E_F 0x1.bcb7b2p-2f
#define M_LN2_F 0x1.62e430p-1f
#define M_LN10_F 0x1.26bb1cp+1f
#define M_PI_F 0x1.921fb6p+1f
#define M_PI_2_F 0x1.921fb6p+0f
#define M_PI_4_F 0x1.921fb6p-1f
#define M_1_PI_F 0x1.45f306p-2f
#define M_2_PI_F 0x1.45f306p-1f
#define M_2_SQRTPI_F 0x1.20dd76p+0f
#define M_SQRT2_F 0x1.6a09e6p+0f
#define M_SQRT1_2_F 0x1.6a09e6p-1f
#ifdef cl_khr_fp64
#define HUGE_VAL __builtin_huge_val()
#define DBL_DIG 15
#define DBL_MANT_DIG 53
#define DBL_MAX_10_EXP +308
#define DBL_MAX_EXP +1024
#define DBL_MIN_10_EXP -307
#define DBL_MIN_EXP -1021
#define DBL_MAX 0x1.fffffffffffffp1023
#define DBL_MIN 0x1.0p-1022
#define DBL_EPSILON 0x1.0p-52
#define M_E 0x1.5bf0a8b145769p+1
#define M_LOG2E 0x1.71547652b82fep+0
#define M_LOG10E 0x1.bcb7b1526e50ep-2
#define M_LN2 0x1.62e42fefa39efp-1
#define M_LN10 0x1.26bb1bbb55516p+1
#define M_PI 0x1.921fb54442d18p+1
#define M_PI_2 0x1.921fb54442d18p+0
#define M_PI_4 0x1.921fb54442d18p-1
#define M_1_PI 0x1.45f306dc9c883p-2
#define M_2_PI 0x1.45f306dc9c883p-1
#define M_2_SQRTPI 0x1.20dd750429b6dp+0
#define M_SQRT2 0x1.6a09e667f3bcdp+0
#define M_SQRT1_2 0x1.6a09e667f3bcdp-1
#endif
#ifdef cl_khr_fp16
#if __OPENCL_VERSION__ >= 120
#define HALF_DIG 3
#define HALF_MANT_DIG 11
#define HALF_MAX_10_EXP +4
#define HALF_MAX_EXP +16
#define HALF_MIN_10_EXP -4
#define HALF_MIN_EXP -13
#endif
#endif

View File

@@ -1,7 +0,0 @@
_CLC_OVERLOAD _CLC_DECL float3 cross(float3 p0, float3 p1);
_CLC_OVERLOAD _CLC_DECL float4 cross(float4 p0, float4 p1);
#ifdef cl_khr_fp64
_CLC_OVERLOAD _CLC_DECL double3 cross(double3 p0, double3 p1);
_CLC_OVERLOAD _CLC_DECL double4 cross(double4 p0, double4 p1);
#endif

View File

@@ -1,2 +0,0 @@
#define __CLC_BODY <clc/geometric/distance.inc>
#include <clc/geometric/floatn.inc>

View File

@@ -1,2 +0,0 @@
#define __CLC_BODY <clc/geometric/dot.inc>
#include <clc/geometric/floatn.inc>

View File

@@ -1 +0,0 @@
_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT dot(__CLC_FLOATN p0, __CLC_FLOATN p1);

View File

@@ -1,45 +0,0 @@
#define __CLC_FLOAT float
#define __CLC_FLOATN float
#include __CLC_BODY
#undef __CLC_FLOATN
#define __CLC_FLOATN float2
#include __CLC_BODY
#undef __CLC_FLOATN
#define __CLC_FLOATN float3
#include __CLC_BODY
#undef __CLC_FLOATN
#define __CLC_FLOATN float4
#include __CLC_BODY
#undef __CLC_FLOATN
#undef __CLC_FLOAT
#ifdef cl_khr_fp64
#define __CLC_FLOAT double
#define __CLC_FLOATN double
#include __CLC_BODY
#undef __CLC_FLOATN
#define __CLC_FLOATN double2
#include __CLC_BODY
#undef __CLC_FLOATN
#define __CLC_FLOATN double3
#include __CLC_BODY
#undef __CLC_FLOATN
#define __CLC_FLOATN double4
#include __CLC_BODY
#undef __CLC_FLOATN
#undef __CLC_FLOAT
#endif
#undef __CLC_BODY

Some files were not shown because too many files have changed in this diff Show More