Skip to content

Commit 5cfe41e

Browse files
Krebrov001igcbot
authored andcommitted
Changes in code.
1 parent 42255de commit 5cfe41e

File tree

2 files changed

+151
-55
lines changed

2 files changed

+151
-55
lines changed

IGC/BiFModule/Languages/OpenCL/PreRelease/IBiF_Bit_Instructions.cl

Lines changed: 103 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -48,68 +48,116 @@ SPDX-License-Identifier: MIT
4848
GEN_DEFINITIONS_BFI_ALL_WIDTHS(FUNC, OP, int, i32, int) \
4949
GEN_DEFINITIONS_BFI_ALL_WIDTHS(FUNC, OP, long, i64, long)
5050

51-
#define GEN_DEFINITION_BFE( FUNC, OP, TYPE1, TYPE2, ABBR_TYPE1, ABBR_TYPE2 ) \
52-
INLINE TYPE1 OVERLOADABLE FUNC( TYPE1 base, TYPE2 offset, TYPE2 count ) { \
53-
return __builtin_spirv_##OP##_##ABBR_TYPE1##_##ABBR_TYPE2##_##ABBR_TYPE2(base, offset, count); \
51+
#define GEN_DEFINITION_BFE( FUNC, OP, TYPE1, TYPE2, TYPE3, ABBR_TYPE1, ABBR_TYPE3 ) \
52+
INLINE TYPE1 OVERLOADABLE FUNC( TYPE2 base, TYPE3 offset, TYPE3 count ) { \
53+
return __builtin_spirv_##OP##_##ABBR_TYPE1##_##ABBR_TYPE3##_##ABBR_TYPE3( as_##TYPE1(base), offset, count); \
5454
}
5555

56-
#define GEN_VECTOR_DEFINITION_BFE( FUNC, OP, TYPE1, TYPE2, ABBR_TYPE1, ABBR_TYPE2, VEC_SIZE) \
57-
INLINE TYPE1##VEC_SIZE OVERLOADABLE FUNC( TYPE1##VEC_SIZE base, TYPE2##VEC_SIZE offset, TYPE2##VEC_SIZE count ) { \
58-
return __builtin_spirv_##OP##_v##VEC_SIZE##ABBR_TYPE1##_v##VEC_SIZE##ABBR_TYPE2##_v##VEC_SIZE##ABBR_TYPE2 \
59-
(base, offset, count); \
56+
#define GEN_VECTOR_DEFINITION_BFE( FUNC, OP, TYPE1, TYPE2, TYPE3, ABBR_TYPE1, ABBR_TYPE3, VEC_SIZE) \
57+
INLINE TYPE1##VEC_SIZE OVERLOADABLE FUNC( TYPE2##VEC_SIZE base, TYPE3##VEC_SIZE offset, TYPE3##VEC_SIZE count ) { \
58+
return __builtin_spirv_##OP##_v##VEC_SIZE##ABBR_TYPE1##_v##VEC_SIZE##ABBR_TYPE3##_v##VEC_SIZE##ABBR_TYPE3 \
59+
( as_##TYPE1##VEC_SIZE(base), offset, count); \
6060
}
6161

6262
#define GEN_DEFINITIONS_UBFE( FUNC, OP ) \
63-
GEN_DEFINITION_BFE( FUNC, OP, uchar, uint, i8, i32 ) \
64-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uint, i8, i32, 2) \
65-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uint, i8, i32, 3) \
66-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uint, i8, i32, 4) \
67-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uint, i8, i32, 8) \
68-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uint, i8, i32, 16) \
69-
GEN_DEFINITION_BFE( FUNC, OP, ushort, uint, i16, i32 ) \
70-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, uint, i16, i32, 2) \
71-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, uint, i16, i32, 3) \
72-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, uint, i16, i32, 4) \
73-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, uint, i16, i32, 8) \
74-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, uint, i16, i32, 16) \
75-
GEN_DEFINITION_BFE( FUNC, OP, uint, uint, i32, i32 ) \
76-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, i32, i32, 2) \
77-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, i32, i32, 3) \
78-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, i32, i32, 4) \
79-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, i32, i32, 8) \
80-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, i32, i32, 16) \
81-
GEN_DEFINITION_BFE( FUNC, OP, ulong, uint, i64, i32 ) \
82-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, uint, i64, i32, 2) \
83-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, uint, i64, i32, 3) \
84-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, uint, i64, i32, 4) \
85-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, uint, i64, i32, 8) \
86-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, uint, i64, i32, 16)
63+
GEN_DEFINITION_BFE( FUNC, OP, uchar, uchar, uint, i8, i32 ) \
64+
GEN_DEFINITION_BFE( FUNC, OP, uchar, char, uint, i8, i32 ) \
65+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uchar, uint, i8, i32, 2) \
66+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, char, uint, i8, i32, 2) \
67+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uchar, uint, i8, i32, 3) \
68+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, char, uint, i8, i32, 3) \
69+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uchar, uint, i8, i32, 4) \
70+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, char, uint, i8, i32, 4) \
71+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uchar, uint, i8, i32, 8) \
72+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, char, uint, i8, i32, 8) \
73+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, uchar, uint, i8, i32, 16) \
74+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uchar, char, uint, i8, i32, 16) \
75+
GEN_DEFINITION_BFE( FUNC, OP, ushort, ushort, uint, i16, i32 ) \
76+
GEN_DEFINITION_BFE( FUNC, OP, ushort, short, uint, i16, i32 ) \
77+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, ushort, uint, i16, i32, 2) \
78+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, short, uint, i16, i32, 2) \
79+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, ushort, uint, i16, i32, 3) \
80+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, short, uint, i16, i32, 3) \
81+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, ushort, uint, i16, i32, 4) \
82+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, short, uint, i16, i32, 4) \
83+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, ushort, uint, i16, i32, 8) \
84+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, short, uint, i16, i32, 8) \
85+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, ushort, uint, i16, i32, 16) \
86+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ushort, short, uint, i16, i32, 16) \
87+
GEN_DEFINITION_BFE( FUNC, OP, uint, uint, uint, i32, i32 ) \
88+
GEN_DEFINITION_BFE( FUNC, OP, uint, int, uint, i32, i32 ) \
89+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, uint, i32, i32, 2) \
90+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, int, uint, i32, i32, 2) \
91+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, uint, i32, i32, 3) \
92+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, int, uint, i32, i32, 3) \
93+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, uint, i32, i32, 4) \
94+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, int, uint, i32, i32, 4) \
95+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, uint, i32, i32, 8) \
96+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, int, uint, i32, i32, 8) \
97+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, uint, uint, i32, i32, 16) \
98+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, uint, int, uint, i32, i32, 16) \
99+
GEN_DEFINITION_BFE( FUNC, OP, ulong, ulong, uint, i64, i32 ) \
100+
GEN_DEFINITION_BFE( FUNC, OP, ulong, long, uint, i64, i32 ) \
101+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, ulong, uint, i64, i32, 2) \
102+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, long, uint, i64, i32, 2) \
103+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, ulong, uint, i64, i32, 3) \
104+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, long, uint, i64, i32, 3) \
105+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, ulong, uint, i64, i32, 4) \
106+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, long, uint, i64, i32, 4) \
107+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, ulong, uint, i64, i32, 8) \
108+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, long, uint, i64, i32, 8) \
109+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, ulong, uint, i64, i32, 16) \
110+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, ulong, long, uint, i64, i32, 16)
87111

88112
#define GEN_DEFINITIONS_SBFE( FUNC, OP ) \
89-
GEN_DEFINITION_BFE( FUNC, OP, char, uint, i8, i32 ) \
90-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uint, i8, i32, 2) \
91-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uint, i8, i32, 3) \
92-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uint, i8, i32, 4) \
93-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uint, i8, i32, 8) \
94-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uint, i8, i32, 16) \
95-
GEN_DEFINITION_BFE( FUNC, OP, short, uint, i16, i32 ) \
96-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, uint, i16, i32, 2) \
97-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, uint, i16, i32, 3) \
98-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, uint, i16, i32, 4) \
99-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, uint, i16, i32, 8) \
100-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, uint, i16, i32, 16) \
101-
GEN_DEFINITION_BFE( FUNC, OP, int, uint, i32, i32 ) \
102-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, i32, i32, 2) \
103-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, i32, i32, 3) \
104-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, i32, i32, 4) \
105-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, i32, i32, 8) \
106-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, i32, i32, 16) \
107-
GEN_DEFINITION_BFE( FUNC, OP, long, uint, i64, i32 ) \
108-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, uint, i64, i32, 2) \
109-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, uint, i64, i32, 3) \
110-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, uint, i64, i32, 4) \
111-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, uint, i64, i32, 8) \
112-
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, uint, i64, i32, 16)
113+
GEN_DEFINITION_BFE( FUNC, OP, char, uchar, uint, i8, i32 ) \
114+
GEN_DEFINITION_BFE( FUNC, OP, char, char, uint, i8, i32 ) \
115+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uchar, uint, i8, i32, 2) \
116+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, char, uint, i8, i32, 2) \
117+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uchar, uint, i8, i32, 3) \
118+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, char, uint, i8, i32, 3) \
119+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uchar, uint, i8, i32, 4) \
120+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, char, uint, i8, i32, 4) \
121+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uchar, uint, i8, i32, 8) \
122+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, char, uint, i8, i32, 8) \
123+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, uchar, uint, i8, i32, 16) \
124+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, char, char, uint, i8, i32, 16) \
125+
GEN_DEFINITION_BFE( FUNC, OP, short, ushort, uint, i16, i32 ) \
126+
GEN_DEFINITION_BFE( FUNC, OP, short, short, uint, i16, i32 ) \
127+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, ushort, uint, i16, i32, 2) \
128+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, short, uint, i16, i32, 2) \
129+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, ushort, uint, i16, i32, 3) \
130+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, short, uint, i16, i32, 3) \
131+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, ushort, uint, i16, i32, 4) \
132+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, short, uint, i16, i32, 4) \
133+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, ushort, uint, i16, i32, 8) \
134+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, short, uint, i16, i32, 8) \
135+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, ushort, uint, i16, i32, 16) \
136+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, short, short, uint, i16, i32, 16) \
137+
GEN_DEFINITION_BFE( FUNC, OP, int, uint, uint, i32, i32 ) \
138+
GEN_DEFINITION_BFE( FUNC, OP, int, int, uint, i32, i32 ) \
139+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, uint, i32, i32, 2) \
140+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, int, uint, i32, i32, 2) \
141+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, uint, i32, i32, 3) \
142+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, int, uint, i32, i32, 3) \
143+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, uint, i32, i32, 4) \
144+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, int, uint, i32, i32, 4) \
145+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, uint, i32, i32, 8) \
146+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, int, uint, i32, i32, 8) \
147+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, uint, uint, i32, i32, 16) \
148+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, int, int, uint, i32, i32, 16) \
149+
GEN_DEFINITION_BFE( FUNC, OP, long, ulong, uint, i64, i32 ) \
150+
GEN_DEFINITION_BFE( FUNC, OP, long, long, uint, i64, i32 ) \
151+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, ulong, uint, i64, i32, 2) \
152+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, long, uint, i64, i32, 2) \
153+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, ulong, uint, i64, i32, 3) \
154+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, long, uint, i64, i32, 3) \
155+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, ulong, uint, i64, i32, 4) \
156+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, long, uint, i64, i32, 4) \
157+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, ulong, uint, i64, i32, 8) \
158+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, long, uint, i64, i32, 8) \
159+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, ulong, uint, i64, i32, 16) \
160+
GEN_VECTOR_DEFINITION_BFE( FUNC, OP, long, long, uint, i64, i32, 16)
113161

114162
#define GEN_DEFINITION_BFREV( FUNC, OP, TYPE, ABBR_TYPE ) \
115163
INLINE TYPE OVERLOADABLE FUNC( TYPE base ) { \

0 commit comments

Comments
 (0)