summaryrefslogtreecommitdiff
path: root/shaders/h264/mc/AllAVC.asm
blob: 045ddf3b9fb35d4e49986ad87413aaea2c7a40ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
/*
 * All HWMC kernels 
 * Copyright © <2010>, Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at
 * http://www.opensource.org/licenses/eclipse-1.0.php.
 *
 */

// Kernel name: AllAVC.asm
//
// All HWMC kernels merged into this file
//
//  $Revision: 2 $
//  $Date: 9/10/06 2:02a $
//

// Note: To enable SW scoreboard for ILK AVC kernels, simply toggle the HW_SCOREBOARD 
//		 and SW_SCOREBOARD definition as described below.
//
// ----------------------------------------------------
//  Main: ALLINTRA
// ----------------------------------------------------

#define	COMBINED_KERNEL
#define	ENABLE_ILDB

//	WA for *Stim tool issue, should be removed later

#ifdef DEV_ILK
#define INSTFACTOR	2	// 128-bit count as 2 instructions
#else
#define INSTFACTOR	1	// 128-bit is 1 instruction
#endif	// DEV_ILK

#ifdef DEV_CTG
  #define SW_SCOREBOARD		// SW Scoreboard should be enabled for CTG and earlier
  #undef HW_SCOREBOARD		// HW Scoreboard should be disabled for CTG and earlier
#else
  #define HW_SCOREBOARD		// HW Scoreboard should be enabled for ILK and beyond
  #undef SW_SCOREBOARD		// SW Scoreboard should be disabled for ILK and beyond
#endif	// DEV_CTG
#include "export.inc"
#if defined(_EXPORT)
	#include "AllAVC_Export.inc"
#elif defined(_BUILD)
	#include "AllAVC.ich"			// ISAasm dumped .exports
	#include "AllAVC_Export.inc"	// Keep jumping targets aligned, only for CTG and beyond
	#include "AllAVC_Build.inc"
#else
#endif

.kernel AllAVC

// Build all intra prediction kernels
//
#ifdef INTRA_16x16_PAD_NENOP
    $for(0; <INTRA_16x16_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef INTRA_16x16_PAD_NOP
    $for(0; <INTRA_16x16_PAD_NOP; 1) {
	nop
	}
#endif
    #include "Intra_16x16.asm"

#ifdef INTRA_8x8_PAD_NENOP
    $for(0; <INTRA_8x8_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef INTRA_8x8_PAD_NOP
    $for(0; <INTRA_8x8_PAD_NOP; 1) {
	nop
	}
#endif
    #include "Intra_8x8.asm"

#ifdef INTRA_4x4_PAD_NENOP
    $for(0; <INTRA_4x4_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef INTRA_4x4_PAD_NOP
    $for(0; <INTRA_4x4_PAD_NOP; 1) {
	nop
	}
#endif
    #include "Intra_4x4.asm"

#ifdef INTRA_PCM_PAD_NENOP
    $for(0; <INTRA_PCM_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef INTRA_PCM_PAD_NOP
    $for(0; <INTRA_PCM_PAD_NOP; 1) {
	nop
	}
#endif
    #include "Intra_PCM.asm"

// Build FrameMB_Motion kernel
//
#define FRAME

  #ifdef FRAME_MB_PAD_NENOP
    $for(0; <FRAME_MB_PAD_NENOP; 1) {
	nenop
	}
  #endif
  #ifdef FRAME_MB_PAD_NOP
    $for(0; <FRAME_MB_PAD_NOP; 1) {
	nop
	}
  #endif
    #include "AVCMCInter.asm"
#undef  FRAME

// Build FieldMB_Motion kernel
//
#define FIELD

  #ifdef FIELD_MB_PAD_NENOP
    $for(0; <FIELD_MB_PAD_NENOP; 1) {
	nenop
	}
  #endif
  #ifdef FIELD_MB_PAD_NOP
    $for(0; <FIELD_MB_PAD_NOP; 1) {
	nop
	}
  #endif
    #include "AVCMCInter.asm"
#undef  FIELD

// Build MBAff_Motion kernel
//
#define MBAFF

  #ifdef MBAFF_MB_PAD_NENOP
    $for(0; <MBAFF_MB_PAD_NENOP; 1) {
	nenop
	}
  #endif
  #ifdef MBAFF_MB_PAD_NOP
    $for(0; <MBAFF_MB_PAD_NOP; 1) {
	nop
	}
  #endif
    #include "AVCMCInter.asm"
#undef  MBAFF

#ifdef SW_SCOREBOARD    

// SW scoreboard kernel for non-MBAFF
//
#ifdef SCOREBOARD_PAD_NENOP
    $for(0; <SCOREBOARD_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef SCOREBOARD_PAD_NOP
    $for(0; <SCOREBOARD_PAD_NOP; 1) {
	nop
	}
#endif
    #include "scoreboard.asm"

//	SW scoreboard kernel for MBAFF

#ifdef SCOREBOARD_MBAFF_PAD_NENOP
    $for(0; <SCOREBOARD_MBAFF_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef SCOREBOARD_MBAFF_PAD_NOP
    $for(0; <SCOREBOARD_MBAFF_PAD_NOP; 1) {
	nop
	}
#endif
    #include "scoreboard_MBAFF.asm"

#elif defined(HW_SCOREBOARD)
 
// SetHWscoreboard kernel for non-MBAFF
//
#ifdef SETHWSCOREBOARD_PAD_NENOP
    $for(0; <SETHWSCOREBOARD_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef SETHWSCOREBOARD_PAD_NOP
    $for(0; <SETHWSCOREBOARD_PAD_NOP; 1) {
	nop
	}
#endif
    #include "SetHWScoreboard.asm"

//	SetHWscoreboard kernel for MBAFF

#ifdef SETHWSCOREBOARD_MBAFF_PAD_NENOP
    $for(0; <SETHWSCOREBOARD_MBAFF_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef SETHWSCOREBOARD_MBAFF_PAD_NOP
    $for(0; <SETHWSCOREBOARD_MBAFF_PAD_NOP; 1) {
	nop
	}
#endif
    #include "SetHWScoreboard_MBAFF.asm"

#endif	// SW_SCOREBOARD

#ifdef BSDRESET_PAD_NENOP
    $for(0; <BSDRESET_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef BSDRESET_PAD_NOP
    $for(0; <BSDRESET_PAD_NOP; 1) {
	nop
	}
#endif
    #include "BSDReset.asm"

#ifdef DCRESETDUMMY_PAD_NENOP
    $for(0; <DCRESETDUMMY_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef DCRESETDUMMY_PAD_NOP
    $for(0; <DCRESETDUMMY_PAD_NOP; 1) {
	nop
	}
#endif
    #include "DCResetDummy.asm"

#ifdef ENABLE_ILDB

// Build all ILDB kernels
//
//	Undefine some previous defined symbols since they will be re-defined/re-declared in ILDB kernels
#undef	A
#undef	B
#undef	p0
#undef	p1

#define MSGPAYLOADB MSGPAYLOADB_ILDB
#define MSGPAYLOADW MSGPAYLOADW_ILDB
#define MSGPAYLOADD MSGPAYLOADD_ILDB
#define MSGPAYLOADF MSGPAYLOADF_ILDB

//				< Frame ILDB >
#define _PROGRESSIVE
#define ILDB_LABEL(x)	x##_ILDB_FRAME
#ifdef AVC_ILDB_ROOT_Y_ILDB_FRAME_PAD_NENOP
    $for(0; <AVC_ILDB_ROOT_Y_ILDB_FRAME_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_ROOT_Y_ILDB_FRAME_PAD_NOP
    $for(0; <AVC_ILDB_ROOT_Y_ILDB_FRAME_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Root_Y.asm"

#ifdef AVC_ILDB_CHILD_Y_ILDB_FRAME_PAD_NENOP
    $for(0; <AVC_ILDB_CHILD_Y_ILDB_FRAME_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_CHILD_Y_ILDB_FRAME_PAD_NOP
    $for(0; <AVC_ILDB_CHILD_Y_ILDB_FRAME_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Child_Y.asm"

#ifdef AVC_ILDB_ROOT_UV_ILDB_FRAME_PAD_NENOP
    $for(0; <AVC_ILDB_ROOT_UV_ILDB_FRAME_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_ROOT_UV_ILDB_FRAME_PAD_NOP
    $for(0; <AVC_ILDB_ROOT_UV_ILDB_FRAME_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Root_UV.asm"

#ifdef AVC_ILDB_CHILD_UV_ILDB_FRAME_PAD_NENOP
    $for(0; <AVC_ILDB_CHILD_UV_ILDB_FRAME_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_CHILD_UV_ILDB_FRAME_PAD_NOP
    $for(0; <AVC_ILDB_CHILD_UV_ILDB_FRAME_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Child_UV.asm"
#undef ILDB_LABEL
#undef _PROGRESSIVE

//				< Field ILDB >
#define _FIELD
#define ILDB_LABEL(x)	x##_ILDB_FIELD
#ifdef AVC_ILDB_ROOT_Y_ILDB_FIELD_PAD_NENOP
    $for(0; <AVC_ILDB_ROOT_Y_ILDB_FIELD_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_ROOT_Y_ILDB_FIELD_PAD_NOP
    $for(0; <AVC_ILDB_ROOT_Y_ILDB_FIELD_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Root_Field_Y.asm"

#ifdef AVC_ILDB_CHILD_Y_ILDB_FIELD_PAD_NENOP
    $for(0; <AVC_ILDB_CHILD_Y_ILDB_FIELD_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_CHILD_Y_ILDB_FIELD_PAD_NOP
    $for(0; <AVC_ILDB_CHILD_Y_ILDB_FIELD_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Child_Field_Y.asm"

#ifdef AVC_ILDB_ROOT_UV_ILDB_FIELD_PAD_NENOP
    $for(0; <AVC_ILDB_ROOT_UV_ILDB_FIELD_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_ROOT_UV_ILDB_FIELD_PAD_NOP
    $for(0; <AVC_ILDB_ROOT_UV_ILDB_FIELD_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Root_Field_UV.asm"

#ifdef AVC_ILDB_CHILD_UV_ILDB_FIELD_PAD_NENOP
    $for(0; <AVC_ILDB_CHILD_UV_ILDB_FIELD_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_CHILD_UV_ILDB_FIELD_PAD_NOP
    $for(0; <AVC_ILDB_CHILD_UV_ILDB_FIELD_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Child_Field_UV.asm"
#undef ILDB_LABEL
#undef _FIELD

//				< MBAFF Frame ILDB >
#define _MBAFF
#define ILDB_LABEL(x)	x##_ILDB_MBAFF
#ifdef AVC_ILDB_ROOT_Y_ILDB_MBAFF_PAD_NENOP
    $for(0; <AVC_ILDB_ROOT_Y_ILDB_MBAFF_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_ROOT_Y_ILDB_MBAFF_PAD_NOP
    $for(0; <AVC_ILDB_ROOT_Y_ILDB_MBAFF_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Root_Mbaff_Y.asm"

#ifdef AVC_ILDB_CHILD_Y_ILDB_MBAFF_PAD_NENOP
    $for(0; <AVC_ILDB_CHILD_Y_ILDB_MBAFF_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_CHILD_Y_ILDB_MBAFF_PAD_NOP
    $for(0; <AVC_ILDB_CHILD_Y_ILDB_MBAFF_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Child_Mbaff_Y.asm"

#ifdef AVC_ILDB_ROOT_UV_ILDB_MBAFF_PAD_NENOP
    $for(0; <AVC_ILDB_ROOT_UV_ILDB_MBAFF_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_ROOT_UV_ILDB_MBAFF_PAD_NOP
    $for(0; <AVC_ILDB_ROOT_UV_ILDB_MBAFF_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Root_Mbaff_UV.asm"

#ifdef AVC_ILDB_CHILD_UV_ILDB_MBAFF_PAD_NENOP
    $for(0; <AVC_ILDB_CHILD_UV_ILDB_MBAFF_PAD_NENOP; 1) {
	nenop
	}
#endif
#ifdef AVC_ILDB_CHILD_UV_ILDB_MBAFF_PAD_NOP
    $for(0; <AVC_ILDB_CHILD_UV_ILDB_MBAFF_PAD_NOP; 1) {
	nop
	}
#endif
    #include "AVC_ILDB_Child_Mbaff_UV.asm"
#undef ILDB_LABEL
#undef _MBAFF

#endif		// ENABLE_ILDB

AllAVC_END:
nop
// End of AllAVC

.end_code

.end_kernel