Skip to content

Commit 70cc5ea

Browse files
committed
Merge commit '4ec3e5bddf22' into llvmspirv_pulldown
Conflicts: libclc/clc/lib/generic/math/clc_sw_fma.cl libclc/libspirv/lib/generic/math/clc_hypot.cl libclc/libspirv/lib/generic/math/clc_pow.cl libclc/libspirv/lib/generic/math/frexp.inc libclc/libspirv/lib/generic/math/nan.cl libclc/libspirv/lib/generic/math/sincos_helpers.cl
2 parents c94a853 + 4ec3e5b commit 70cc5ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1977
-1971
lines changed

libclc/clc/include/clc/clc_as_type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define __clc_as_char8(x) __builtin_astype(x, char8)
4949
#define __clc_as_schar8(x) __builtin_astype(x, schar8)
5050
#define __clc_as_uchar8(x) __builtin_astype(x, uchar8)
51+
#define __clc_as_schar8(x) __builtin_astype(x, schar8)
5152
#define __clc_as_short8(x) __builtin_astype(x, short8)
5253
#define __clc_as_ushort8(x) __builtin_astype(x, ushort8)
5354
#define __clc_as_int8(x) __builtin_astype(x, int8)

libclc/libspirv/include/libspirv/relational.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef CLC_RELATIONAL
22
#define CLC_RELATIONAL
33

4-
#include <as_type.h>
4+
#include <clc/clc_as_type.h>
55

66
/*
77
* Contains relational macros that have to return 1 for scalar and -1 for vector
@@ -16,34 +16,34 @@
1616

1717
#define _CLC_DEFINE_RELATIONAL_UNARY_VEC2(RET_TYPE, FUNCTION, ARG_TYPE) \
1818
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \
19-
return as_##RET_TYPE( \
19+
return __clc_as_##RET_TYPE( \
2020
((RET_TYPE){FUNCTION(x.lo), FUNCTION(x.hi)} != (RET_TYPE)0)); \
2121
}
2222

2323
#define _CLC_DEFINE_RELATIONAL_UNARY_VEC3(RET_TYPE, FUNCTION, ARG_TYPE) \
2424
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \
25-
return as_##RET_TYPE(((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), \
26-
FUNCTION(x.s2)} != (RET_TYPE)0)); \
25+
return __clc_as_##RET_TYPE(((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), \
26+
FUNCTION(x.s2)} != (RET_TYPE)0)); \
2727
}
2828

2929
#define _CLC_DEFINE_RELATIONAL_UNARY_VEC4(RET_TYPE, FUNCTION, ARG_TYPE) \
3030
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \
31-
return as_##RET_TYPE( \
31+
return __clc_as_##RET_TYPE( \
3232
((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2), \
3333
FUNCTION(x.s3)} != (RET_TYPE)0)); \
3434
}
3535

3636
#define _CLC_DEFINE_RELATIONAL_UNARY_VEC8(RET_TYPE, FUNCTION, ARG_TYPE) \
3737
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \
38-
return as_##RET_TYPE( \
38+
return __clc_as_##RET_TYPE( \
3939
((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2), \
4040
FUNCTION(x.s3), FUNCTION(x.s4), FUNCTION(x.s5), \
4141
FUNCTION(x.s6), FUNCTION(x.s7)} != (RET_TYPE)0)); \
4242
}
4343

4444
#define _CLC_DEFINE_RELATIONAL_UNARY_VEC16(RET_TYPE, FUNCTION, ARG_TYPE) \
4545
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \
46-
return as_##RET_TYPE( \
46+
return __clc_as_##RET_TYPE( \
4747
((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2), \
4848
FUNCTION(x.s3), FUNCTION(x.s4), FUNCTION(x.s5), \
4949
FUNCTION(x.s6), FUNCTION(x.s7), FUNCTION(x.s8), \
@@ -74,30 +74,31 @@
7474
#define _CLC_DEFINE_RELATIONAL_BINARY_VEC(RET_TYPE, FUNCTION, ARG0_TYPE, \
7575
ARG1_TYPE) \
7676
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \
77-
return as_##RET_TYPE( \
77+
return __clc_as_##RET_TYPE( \
7878
(RET_TYPE)((RET_TYPE){FUNCTION(x.lo, y.lo), FUNCTION(x.hi, y.hi)} != \
7979
(RET_TYPE)0)); \
8080
}
8181

8282
#define _CLC_DEFINE_RELATIONAL_BINARY_VEC2(RET_TYPE, FUNCTION, ARG0_TYPE, \
8383
ARG1_TYPE) \
8484
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \
85-
return as_##RET_TYPE(((RET_TYPE){FUNCTION(x.lo, y.lo), \
86-
FUNCTION(x.hi, y.hi)} != (RET_TYPE)0)); \
85+
return __clc_as_##RET_TYPE( \
86+
((RET_TYPE){FUNCTION(x.lo, y.lo), FUNCTION(x.hi, y.hi)} != \
87+
(RET_TYPE)0)); \
8788
}
8889

8990
#define _CLC_DEFINE_RELATIONAL_BINARY_VEC3(RET_TYPE, FUNCTION, ARG0_TYPE, \
9091
ARG1_TYPE) \
9192
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \
92-
return as_##RET_TYPE( \
93+
return __clc_as_##RET_TYPE( \
9394
((RET_TYPE){FUNCTION(x.s0, y.s0), FUNCTION(x.s1, y.s1), \
9495
FUNCTION(x.s2, y.s2)} != (RET_TYPE)0)); \
9596
}
9697

9798
#define _CLC_DEFINE_RELATIONAL_BINARY_VEC4(RET_TYPE, FUNCTION, ARG0_TYPE, \
9899
ARG1_TYPE) \
99100
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \
100-
return as_##RET_TYPE( \
101+
return __clc_as_##RET_TYPE( \
101102
((RET_TYPE){FUNCTION(x.s0, y.s0), FUNCTION(x.s1, y.s1), \
102103
FUNCTION(x.s2, y.s2), \
103104
FUNCTION(x.s3, y.s3)} != (RET_TYPE)0)); \
@@ -106,7 +107,7 @@
106107
#define _CLC_DEFINE_RELATIONAL_BINARY_VEC8(RET_TYPE, FUNCTION, ARG0_TYPE, \
107108
ARG1_TYPE) \
108109
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \
109-
return as_##RET_TYPE( \
110+
return __clc_as_##RET_TYPE( \
110111
((RET_TYPE){ \
111112
FUNCTION(x.s0, y.s0), FUNCTION(x.s1, y.s1), FUNCTION(x.s2, y.s2), \
112113
FUNCTION(x.s3, y.s3), FUNCTION(x.s4, y.s4), FUNCTION(x.s5, y.s5), \
@@ -116,7 +117,7 @@
116117
#define _CLC_DEFINE_RELATIONAL_BINARY_VEC16(RET_TYPE, FUNCTION, ARG0_TYPE, \
117118
ARG1_TYPE) \
118119
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \
119-
return as_##RET_TYPE( \
120+
return __clc_as_##RET_TYPE( \
120121
((RET_TYPE){ \
121122
FUNCTION(x.s0, y.s0), FUNCTION(x.s1, y.s1), FUNCTION(x.s2, y.s2), \
122123
FUNCTION(x.s3, y.s3), FUNCTION(x.s4, y.s4), FUNCTION(x.s5, y.s5), \

libclc/libspirv/include/libspirv/spirv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
/* Supported builtins */
4747
#include <libspirv/spirv_builtins.h>
4848

49-
/* Reinterpreting Types Using as_type() and as_typen() */
50-
#include <as_type.h>
49+
/* Reinterpreting Types Using __clc_as_type() and __clc_as_typen() */
50+
#include <clc/clc_as_type.h>
5151

5252
/* Preprocessor Directives and Macros */
5353
#include <macros.h>

libclc/libspirv/lib/amdgcn-amdhsa/images/image_common.cl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,42 @@
88
// https://github.com/ROCm/clr/tree/amd-staging/hipamd/include/hip/amd_detail/texture_fetch_functions.h
99
_CLC_CONST_AS const unsigned int SAMPLER_OBJECT_OFFSET_DWORD = 12;
1010

11-
// Using the builtin as_type() and as_typen() functions to reinterpret types.
11+
// Using __clc_as_type() and __clc_as_typen() functions to reinterpret types.
1212
// The restriction being is that element "type"s need to be of the same size.
1313
#define _CLC_DEFINE_BUILTIN_CAST_VEC4_TO_VEC3(vec4_elem_t, to_t) \
1414
_CLC_DEF to_t##3 __clc_cast_from_##vec4_elem_t##4_to_##to_t##3( \
1515
vec4_elem_t##4 from) { \
16-
vec4_elem_t##3 casted = as_##vec4_elem_t##3(from); \
17-
return as_##to_t##3(casted); \
16+
vec4_elem_t##3 casted = __clc_as_##vec4_elem_t##3(from); \
17+
return __clc_as_##to_t##3(casted); \
1818
}
1919
#define _CLC_DEFINE_BUILTIN_CAST_VEC4_TO_VEC2(vec4_elem_t, to_t) \
2020
_CLC_DEF to_t##2 __clc_cast_from_##vec4_elem_t##4_to_##to_t##2( \
2121
vec4_elem_t##4 from) { \
22-
vec4_elem_t##4 casted = as_##vec4_elem_t##4(from); \
23-
return as_##to_t##2((vec4_elem_t##2)(casted.x, casted.y)); \
22+
vec4_elem_t##4 casted = __clc_as_##vec4_elem_t##4(from); \
23+
return __clc_as_##to_t##2((vec4_elem_t##2)(casted.x, casted.y)); \
2424
}
2525
#define _CLC_DEFINE_BUILTIN_CAST_VEC4_TO_SCALAR(vec4_elem_t, to_t) \
2626
_CLC_DEF to_t __clc_cast_from_##vec4_elem_t##4_to_##to_t( \
2727
vec4_elem_t##4 from) { \
28-
vec4_elem_t##4 casted = as_##vec4_elem_t##4(from); \
29-
return as_##to_t(casted.x); \
28+
vec4_elem_t##4 casted = __clc_as_##vec4_elem_t##4(from); \
29+
return __clc_as_##to_t(casted.x); \
3030
}
3131
#define _CLC_DEFINE_BUILTIN_CAST_VEC3_TO_VEC4(from_t, vec4_elem_t) \
3232
_CLC_DEF vec4_elem_t##4 __clc_cast_from_##from_t##3_to_##vec4_elem_t##4( \
3333
from_t##3 from) { \
34-
vec4_elem_t##3 casted = as_##vec4_elem_t##3(from); \
35-
return as_##vec4_elem_t##4(casted); \
34+
vec4_elem_t##3 casted = __clc_as_##vec4_elem_t##3(from); \
35+
return __clc_as_##vec4_elem_t##4(casted); \
3636
}
3737
#define _CLC_DEFINE_BUILTIN_CAST_VEC2_TO_VEC4(from_t, vec4_elem_t) \
3838
_CLC_DEF vec4_elem_t##4 __clc_cast_from_##from_t##2_to_##vec4_elem_t##4( \
3939
from_t##2 from) { \
40-
vec4_elem_t##2 casted = as_##vec4_elem_t##2(from); \
40+
vec4_elem_t##2 casted = __clc_as_##vec4_elem_t##2(from); \
4141
return (vec4_elem_t##4)(casted.x, casted.y, 0, 0); \
4242
}
4343
#define _CLC_DEFINE_BUILTIN_CAST_SCALAR_TO_VEC4(from_t, vec4_elem_t) \
4444
_CLC_DEF vec4_elem_t##4 __clc_cast_from_##from_t##_to_##vec4_elem_t##4( \
4545
from_t from) { \
46-
vec4_elem_t casted = as_##vec4_elem_t(from); \
46+
vec4_elem_t casted = __clc_as_##vec4_elem_t(from); \
4747
return (vec4_elem_t##4)(casted, 0, 0, 0); \
4848
}
4949

libclc/libspirv/lib/amdgcn-amdhsa/images/image_common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define CLC_SPIRV_IMAGE_COMMON
33

44
#include <clc/clc.h>
5+
#include <clc/clc_as_type.h>
56

67
#ifdef cl_khr_fp16
78
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
@@ -32,7 +33,7 @@ extern _CLC_CONST_AS const unsigned int SAMPLER_OBJECT_OFFSET_DWORD;
3233

3334
// Helpers for casting between two builtin vector types and/or scalar types.
3435

35-
// Using the builtin as_type() and as_typen() functions to reinterpret types.
36+
// Using __clc_as_type() and __clc_as_typen() functions to reinterpret types.
3637
// The restriction being is that element "type"s need to be of the same size.
3738
#define _CLC_DECLARE_BUILTIN_CAST_VEC4_TO_VEC3(vec4_elem_t, to_t) \
3839
_CLC_DECL to_t##3 __clc_cast_from_##vec4_elem_t##4_to_##to_t##3( \

0 commit comments

Comments
 (0)