r600: add assembler support for literal(inline) constants
[mesa.git] / src / mesa / drivers / dri / r600 / r700_assembler.h
1 /*
2 * Copyright (C) 2008-2009 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 */
21
22 /*
23 * Authors:
24 * Richard Li <RichardZ.Li@amd.com>, <richardradeon@gmail.com>
25 */
26
27 #ifndef _R700_ASSEMBLER_H_
28 #define _R700_ASSEMBLER_H_
29
30 #include "main/mtypes.h"
31 #include "shader/prog_instruction.h"
32
33 #include "r700_chip.h"
34 #include "r700_shaderinst.h"
35 #include "r700_shader.h"
36
37 typedef enum SHADER_PIPE_TYPE
38 {
39 SPT_VP = 0,
40 SPT_FP = 1
41 } SHADER_PIPE_TYPE;
42
43 typedef enum ConstantCycles
44 {
45 NUMBER_OF_CYCLES = 3,
46 NUMBER_OF_COMPONENTS = 4
47 } ConstantCycles;
48
49 typedef enum HARDWARE_LIMIT_VALUES
50 {
51 TEMPORARY_REGISTER_OFFSET = SQ_ALU_SRC_GPR_BASE,
52 MAX_TEMPORARY_REGISTERS = SQ_ALU_SRC_GPR_SIZE,
53 MAX_CONSTANT_REGISTERS = SQ_ALU_SRC_CFILE_SIZE,
54 CFILE_REGISTER_OFFSET = SQ_ALU_SRC_CFILE_BASE,
55 NUMBER_OF_INPUT_COLORS = 2,
56 NUMBER_OF_OUTPUT_COLORS = 8,
57 NUMBER_OF_TEXTURE_UNITS = 16,
58 MEGA_FETCH_BYTES = 32
59 } HARDWARE_LIMIT_VALUES;
60
61 typedef enum AddressMode
62 {
63 ADDR_ABSOLUTE = 0,
64 ADDR_RELATIVE_A0 = 1,
65 ADDR_RELATIVE_FLI_0 = 2,
66 NUMBER_OF_ADDR_MOD = 3
67 } AddressMode;
68
69 typedef enum SrcRegisterType
70 {
71 SRC_REG_TEMPORARY = 0,
72 SRC_REG_INPUT = 1,
73 SRC_REG_CONSTANT = 2,
74 SRC_REG_ALT_TEMPORARY = 3,
75 SRC_REC_LITERAL = 4,
76 NUMBER_OF_SRC_REG_TYPE = 5
77 } SrcRegisterType;
78
79 typedef enum DstRegisterType
80 {
81 DST_REG_TEMPORARY = 0,
82 DST_REG_A0 = 1,
83 DST_REG_OUT = 2,
84 DST_REG_OUT_X_REPL = 3,
85 DST_REG_ALT_TEMPORARY = 4,
86 DST_REG_INPUT = 5,
87 NUMBER_OF_DST_REG_TYPE = 6
88 } DstRegisterType;
89
90 typedef unsigned int BITS;
91
92 typedef struct PVSDSTtag
93 {
94 BITS opcode:8; //(:6) //@@@ really should be 10 bits for OP2
95 BITS math:1;
96 BITS predicated:1; //10 //8
97 BITS pred_inv :1; //11 //8
98
99 BITS rtype:3;
100 BITS reg:10; //24 //20
101
102 BITS writex:1;
103 BITS writey:1;
104 BITS writez:1;
105 BITS writew:1; //28
106
107 BITS op3:1; // 29 Represents *_OP3_* ALU opcode
108
109 BITS dualop:1; // 30 //26
110
111 BITS addrmode0:1; //31 //29
112 BITS addrmode1:1; //32
113 } PVSDST;
114
115 typedef struct PVSINSTtag
116 {
117 BITS literal_slots :2;
118 BITS SaturateMode :2;
119 BITS index_mode :3;
120 } PVSINST;
121
122 typedef struct PVSSRCtag
123 {
124 BITS rtype:3;
125 BITS addrmode0:1;
126 BITS reg:10; //14 (8)
127 BITS swizzlex:3;
128 BITS swizzley:3;
129 BITS swizzlez:3;
130 BITS swizzlew:3; //26
131
132 BITS abs:1;
133 BITS negx:1;
134 BITS negy:1;
135 BITS negz:1;
136 BITS negw:1; //31
137 //BITS addrsel:2;
138 BITS addrmode1:1; //32
139 } PVSSRC;
140
141 typedef struct PVSMATHtag
142 {
143 BITS rtype:4;
144 BITS spare:1;
145 BITS reg:8;
146 BITS swizzlex:3;
147 BITS swizzley:3;
148 BITS dstoff:2; // 2 bits of dest offset into alt ram
149 BITS opcode:4;
150 BITS negx:1;
151 BITS negy:1;
152 BITS dstcomp:2; // select dest component
153 BITS spare2:3;
154 } PVSMATH;
155
156 typedef union PVSDWORDtag
157 {
158 BITS bits;
159 PVSDST dst;
160 PVSINST dst2;
161 PVSSRC src;
162 PVSMATH math;
163 float f;
164 } PVSDWORD;
165
166 typedef struct VAP_OUT_VTX_FMT_0tag
167 {
168 BITS pos:1; // 0
169 BITS misc:1;
170 BITS clip_dist0:1;
171 BITS clip_dist1:1;
172 BITS pos_param:1; // 4
173
174 BITS color0:1; // 5
175 BITS color1:1;
176 BITS color2:1;
177 BITS color3:1;
178 BITS color4:1;
179 BITS color5:1;
180 BITS color6:1;
181 BITS color7:1;
182
183 BITS normal:1;
184
185 BITS depth:1; // 14
186
187 BITS point_size:1; // 15
188 BITS edge_flag:1;
189 BITS rta_index:1; // shares same channel as kill_flag
190 BITS kill_flag:1;
191 BITS viewport_index:1; // 19
192
193 BITS resvd1:12; // 20
194 } VAP_OUT_VTX_FMT_0;
195
196 typedef struct VAP_OUT_VTX_FMT_1tag
197 {
198 BITS tex0comp:3;
199 BITS tex1comp:3;
200 BITS tex2comp:3;
201 BITS tex3comp:3;
202 BITS tex4comp:3;
203 BITS tex5comp:3;
204 BITS tex6comp:3;
205 BITS tex7comp:3;
206
207 BITS resvd:8;
208 } VAP_OUT_VTX_FMT_1;
209
210 typedef struct VAP_OUT_VTX_FMT_2tag
211 {
212 BITS tex8comp :3;
213 BITS tex9comp :3;
214 BITS tex10comp:3;
215 BITS tex11comp:3;
216 BITS tex12comp:3;
217 BITS tex13comp:3;
218 BITS tex14comp:3;
219 BITS tex15comp:3;
220
221 BITS resvd:8;
222 } VAP_OUT_VTX_FMT_2;
223
224 typedef struct OUT_FRAGMENT_FMT_0tag
225 {
226 BITS color0:1;
227 BITS color1:1;
228 BITS color2:1;
229 BITS color3:1;
230 BITS color4:1;
231 BITS color5:1;
232 BITS color6:1;
233 BITS color7:1;
234
235 BITS depth:1;
236 BITS stencil_ref:1;
237 BITS coverage_to_mask:1;
238 BITS mask:1;
239
240 BITS resvd1:20;
241 } OUT_FRAGMENT_FMT_0;
242
243 typedef enum CF_CLAUSE_TYPE
244 {
245 CF_EXPORT_CLAUSE,
246 CF_ALU_CLAUSE,
247 CF_TEX_CLAUSE,
248 CF_VTX_CLAUSE,
249 CF_OTHER_CLAUSE,
250 CF_EMPTY_CLAUSE,
251 NUMBER_CF_CLAUSE_TYPES
252 } CF_CLAUSE_TYPE;
253
254 enum
255 {
256 MAX_BOOL_CONSTANTS = 32,
257 MAX_INT_CONSTANTS = 32,
258 MAX_FLOAT_CONSTANTS = 256,
259
260 FC_NONE = 0,
261 FC_IF = 1,
262 FC_LOOP = 2,
263 FC_REP = 3,
264 FC_PUSH_VPM = 4,
265 FC_PUSH_WQM = 5,
266
267 COND_NONE = 0,
268 COND_BOOL = 1,
269 COND_PRED = 2,
270 COND_ALU = 3,
271
272 SAFEDIST_TEX = 6, ///< safe distance for using result of texture lookup in alu or another tex lookup
273 SAFEDIST_ALU = 6 ///< the same for alu->fc
274 };
275
276 typedef struct FC_LEVEL
277 {
278 R700ControlFlowGenericClause * first;
279 R700ControlFlowGenericClause ** mid;
280 unsigned int unNumMid;
281 unsigned int midLen;
282 unsigned int type;
283 unsigned int cond;
284 unsigned int inv;
285 int id; ///< id of bool or int variable
286 } FC_LEVEL;
287
288 typedef struct VTX_FETCH_METHOD
289 {
290 GLboolean bEnableMini;
291 GLuint mega_fetch_remainder;
292 } VTX_FETCH_METHOD;
293
294 typedef struct SUB_OFFSET
295 {
296 GLint subIL_Offset;
297 GLuint unCFoffset;
298 GLuint unStackDepthMax;
299 TypedShaderList lstCFInstructions_local;
300 } SUB_OFFSET;
301
302 typedef struct CALLER_POINTER
303 {
304 GLint subIL_Offset;
305 GLint subDescIndex;
306 R700ControlFlowGenericClause* cf_ptr;
307 } CALLER_POINTER;
308
309 #define SQ_MAX_CALL_DEPTH 0x00000020
310
311 typedef struct CALL_LEVEL
312 {
313 unsigned int FCSP_BeforeEntry;
314 GLint subDescIndex;
315 GLushort current;
316 GLushort max;
317 TypedShaderList * plstCFInstructions_local;
318 } CALL_LEVEL;
319
320 #define HAS_CURRENT_LOOPRET 0x1L
321 #define HAS_LOOPRET 0x2L
322 #define LOOPRET_FLAGS HAS_LOOPRET | HAS_CURRENT_LOOPRET
323
324 typedef struct r700_AssemblerBase
325 {
326 R700ControlFlowSXClause* cf_last_export_ptr;
327 R700ControlFlowSXClause* cf_current_export_clause_ptr;
328 R700ControlFlowALUClause* cf_current_alu_clause_ptr;
329 R700ControlFlowGenericClause* cf_current_tex_clause_ptr;
330 R700ControlFlowGenericClause* cf_current_vtx_clause_ptr;
331 R700ControlFlowGenericClause* cf_current_cf_clause_ptr;
332
333 //Result shader
334 R700_Shader * pR700Shader;
335
336 // No clause has been created yet
337 CF_CLAUSE_TYPE cf_current_clause_type;
338
339 BITS alu_x_opcode;
340
341 GLuint number_of_exports;
342 GLuint number_of_colorandz_exports;
343 GLuint number_of_export_opcodes;
344
345 PVSDWORD D;
346 PVSDWORD D2;
347 PVSDWORD S[3];
348 PVSDWORD C[4];
349
350 unsigned int uLastPosUpdate;
351 unsigned int last_cond_register;
352
353 OUT_FRAGMENT_FMT_0 fp_stOutFmt0;
354
355 unsigned int uIIns;
356 unsigned int uOIns;
357 unsigned int number_used_registers;
358 unsigned int uUsedConsts;
359
360 unsigned int flag_reg_index;
361
362 // Fragment programs
363 unsigned int uiFP_AttributeMap[FRAG_ATTRIB_MAX];
364 unsigned int uiFP_OutputMap[FRAG_RESULT_MAX];
365 unsigned int uBoolConsts;
366 unsigned int uIntConsts;
367 unsigned int uInsts;
368 unsigned int uConsts;
369
370 // Vertex programs
371 unsigned char ucVP_AttributeMap[VERT_ATTRIB_MAX];
372 unsigned char ucVP_OutputMap[VERT_RESULT_MAX];
373
374 unsigned char * pucOutMask;
375
376 //-----------------------------------------------------------------------------------
377 // flow control members
378 //-----------------------------------------------------------------------------------
379 unsigned int FCSP;
380 FC_LEVEL fc_stack[32];
381
382 //-----------------------------------------------------------------------------------
383 // ArgSubst used in Assemble_Source() function
384 //-----------------------------------------------------------------------------------
385 int aArgSubst[4];
386
387 GLint hw_gpr[ NUMBER_OF_CYCLES ][ NUMBER_OF_COMPONENTS ];
388 GLint hw_cfile_addr[ NUMBER_OF_COMPONENTS ];
389 GLint hw_cfile_chan[ NUMBER_OF_COMPONENTS ];
390
391 GLuint uOutputs;
392
393 GLint color_export_register_number[NUMBER_OF_OUTPUT_COLORS];
394 GLint depth_export_register_number;
395
396 GLint stencil_export_register_number;
397 GLint coverage_to_mask_export_register_number;
398 GLint mask_export_register_number;
399
400 GLuint starting_export_register_number;
401 GLuint starting_vfetch_register_number;
402 GLuint starting_temp_register_number;
403 GLuint uHelpReg;
404 GLuint uFirstHelpReg;
405
406 GLboolean input_position_is_used;
407 GLboolean input_normal_is_used;
408
409 GLboolean input_color_is_used[NUMBER_OF_INPUT_COLORS];
410
411 GLboolean input_texture_unit_is_used[NUMBER_OF_TEXTURE_UNITS];
412
413 R700VertexGenericFetch* vfetch_instruction_ptr_array[VERT_ATTRIB_MAX];
414
415 GLuint number_of_inputs;
416
417 InstDeps *pInstDeps;
418
419 SHADER_PIPE_TYPE currentShaderType;
420 struct prog_instruction * pILInst;
421 GLuint uiCurInst;
422 GLubyte SamplerUnits[MAX_SAMPLERS];
423 GLboolean bR6xx;
424 /* helper to decide which type of instruction to assemble */
425 GLboolean is_tex;
426 /* we inserted helper intructions and need barrier on next TEX ins */
427 GLboolean need_tex_barrier;
428
429 SUB_OFFSET * subs;
430 GLuint unSubArraySize;
431 GLuint unSubArrayPointer;
432 CALLER_POINTER * callers;
433 GLuint unCallerArraySize;
434 GLuint unCallerArrayPointer;
435 unsigned int CALLSP;
436 CALL_LEVEL CALLSTACK[SQ_MAX_CALL_DEPTH];
437
438 GLuint unCFflags;
439
440 } r700_AssemblerBase;
441
442 //Internal use
443 BITS addrmode_PVSDST(PVSDST * pPVSDST);
444 void setaddrmode_PVSDST(PVSDST * pPVSDST, BITS addrmode);
445 void nomask_PVSDST(PVSDST * pPVSDST);
446 BITS addrmode_PVSSRC(PVSSRC* pPVSSRC);
447 void setaddrmode_PVSSRC(PVSSRC* pPVSSRC, BITS addrmode);
448 void setswizzle_PVSSRC(PVSSRC* pPVSSRC, BITS swz);
449 void noswizzle_PVSSRC(PVSSRC* pPVSSRC);
450 void swizzleagain_PVSSRC(PVSSRC * pPVSSRC, BITS x, BITS y, BITS z, BITS w);
451 void neg_PVSSRC(PVSSRC* pPVSSRC);
452 void noneg_PVSSRC(PVSSRC* pPVSSRC);
453 void flipneg_PVSSRC(PVSSRC* pPVSSRC);
454 void zerocomp_PVSSRC(PVSSRC* pPVSSRC, int c);
455 void onecomp_PVSSRC(PVSSRC* pPVSSRC, int c);
456 BITS is_misc_component_exported(VAP_OUT_VTX_FMT_0* pOutVTXFmt0);
457 BITS is_depth_component_exported(OUT_FRAGMENT_FMT_0* pFPOutFmt) ;
458 GLboolean is_reduction_opcode(PVSDWORD * dest);
459 GLuint GetSurfaceFormat(GLenum eType, GLuint nChannels, GLuint * pClient_size);
460
461 unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm);
462
463 GLboolean IsTex(gl_inst_opcode Opcode);
464 GLboolean IsAlu(gl_inst_opcode Opcode);
465 int check_current_clause(r700_AssemblerBase* pAsm,
466 CF_CLAUSE_TYPE new_clause_type);
467 GLboolean add_vfetch_instruction(r700_AssemblerBase* pAsm,
468 R700VertexInstruction* vertex_instruction_ptr);
469 GLboolean add_tex_instruction(r700_AssemblerBase* pAsm,
470 R700TextureInstruction* tex_instruction_ptr);
471 GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm,
472 GLuint gl_client_id,
473 GLuint destination_register,
474 GLuint number_of_elements,
475 GLenum dataElementType,
476 VTX_FETCH_METHOD* pFetchMethod);
477 GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm,
478 GLuint destination_register,
479 GLenum type,
480 GLint size,
481 GLubyte element,
482 GLuint _signed,
483 GLboolean normalize,
484 VTX_FETCH_METHOD * pFetchMethod);
485 GLboolean cleanup_vfetch_instructions(r700_AssemblerBase* pAsm);
486 GLuint gethelpr(r700_AssemblerBase* pAsm);
487 void resethelpr(r700_AssemblerBase* pAsm);
488 void checkop_init(r700_AssemblerBase* pAsm);
489 GLboolean mov_temp(r700_AssemblerBase* pAsm, int src);
490 GLboolean checkop1(r700_AssemblerBase* pAsm);
491 GLboolean checkop2(r700_AssemblerBase* pAsm);
492 GLboolean checkop3(r700_AssemblerBase* pAsm);
493 GLboolean assemble_src(r700_AssemblerBase *pAsm,
494 int src,
495 int fld);
496 GLboolean assemble_dst(r700_AssemblerBase *pAsm);
497 GLboolean tex_dst(r700_AssemblerBase *pAsm);
498 GLboolean tex_src(r700_AssemblerBase *pAsm);
499 GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalized);
500 void initialize(r700_AssemblerBase *pAsm);
501 GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr,
502 int source_index,
503 PVSSRC* pSource,
504 BITS scalar_channel_index);
505 GLboolean add_alu_instruction(r700_AssemblerBase* pAsm,
506 R700ALUInstruction* alu_instruction_ptr,
507 GLuint contiguous_slots_needed);
508
509 GLboolean add_cf_instruction(r700_AssemblerBase* pAsm);
510 void add_return_inst(r700_AssemblerBase *pAsm);
511
512 void get_src_properties(R700ALUInstruction* alu_instruction_ptr,
513 int source_index,
514 BITS* psrc_sel,
515 BITS* psrc_rel,
516 BITS* psrc_chan,
517 BITS* psrc_neg);
518 int is_cfile(BITS sel);
519 int is_const(BITS sel);
520 int is_gpr(BITS sel);
521 GLboolean reserve_cfile(r700_AssemblerBase* pAsm,
522 GLuint sel,
523 GLuint chan);
524 GLboolean reserve_gpr(r700_AssemblerBase* pAsm, GLuint sel, GLuint chan, GLuint cycle);
525 GLboolean cycle_for_scalar_bank_swizzle(const int swiz, const int sel, GLuint* pCycle);
526 GLboolean cycle_for_vector_bank_swizzle(const int swiz, const int sel, GLuint* pCycle);
527 GLboolean check_scalar(r700_AssemblerBase* pAsm,
528 R700ALUInstruction* alu_instruction_ptr);
529 GLboolean check_vector(r700_AssemblerBase* pAsm,
530 R700ALUInstruction* alu_instruction_ptr);
531 GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm);
532 GLboolean next_ins(r700_AssemblerBase *pAsm);
533
534 /* TODO : merge next_ins/literal, assemble_alu_instruction/literal */
535 GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral);
536 GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral);
537
538 GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops);
539 GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset);
540 GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue);
541 GLboolean testFlag(r700_AssemblerBase *pAsm);
542 GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP);
543 GLboolean returnOnFlag(r700_AssemblerBase *pAsm, GLuint unIF);
544
545 GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode);
546 GLboolean assemble_ABS(r700_AssemblerBase *pAsm);
547 GLboolean assemble_ADD(r700_AssemblerBase *pAsm);
548 GLboolean assemble_ARL(r700_AssemblerBase *pAsm);
549 GLboolean assemble_BAD(char *opcode_str);
550 GLboolean assemble_CMP(r700_AssemblerBase *pAsm);
551 GLboolean assemble_COS(r700_AssemblerBase *pAsm);
552 GLboolean assemble_DOT(r700_AssemblerBase *pAsm);
553 GLboolean assemble_DST(r700_AssemblerBase *pAsm);
554 GLboolean assemble_EX2(r700_AssemblerBase *pAsm);
555 GLboolean assemble_EXP(r700_AssemblerBase *pAsm);
556 GLboolean assemble_FLR(r700_AssemblerBase *pAsm);
557 GLboolean assemble_FLR_INT(r700_AssemblerBase *pAsm);
558 GLboolean assemble_FRC(r700_AssemblerBase *pAsm);
559 GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode);
560 GLboolean assemble_LG2(r700_AssemblerBase *pAsm);
561 GLboolean assemble_LRP(r700_AssemblerBase *pAsm);
562 GLboolean assemble_LOG(r700_AssemblerBase *pAsm);
563 GLboolean assemble_MAD(r700_AssemblerBase *pAsm);
564 GLboolean assemble_LIT(r700_AssemblerBase *pAsm);
565 GLboolean assemble_MAX(r700_AssemblerBase *pAsm);
566 GLboolean assemble_MIN(r700_AssemblerBase *pAsm);
567 GLboolean assemble_MOV(r700_AssemblerBase *pAsm);
568 GLboolean assemble_MUL(r700_AssemblerBase *pAsm);
569 GLboolean assemble_POW(r700_AssemblerBase *pAsm);
570 GLboolean assemble_RCP(r700_AssemblerBase *pAsm);
571 GLboolean assemble_RSQ(r700_AssemblerBase *pAsm);
572 GLboolean assemble_SIN(r700_AssemblerBase *pAsm);
573 GLboolean assemble_SCS(r700_AssemblerBase *pAsm);
574 GLboolean assemble_SGE(r700_AssemblerBase *pAsm);
575
576 GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode);
577 GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode);
578
579 GLboolean assemble_SLT(r700_AssemblerBase *pAsm);
580 GLboolean assemble_STP(r700_AssemblerBase *pAsm);
581 GLboolean assemble_TEX(r700_AssemblerBase *pAsm);
582 GLboolean assemble_XPD(r700_AssemblerBase *pAsm);
583 GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm);
584 GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse);
585 GLboolean assemble_ELSE(r700_AssemblerBase *pAsm);
586 GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm);
587
588 GLboolean assemble_BGNLOOP(r700_AssemblerBase *pAsm);
589 GLboolean assemble_BRK(r700_AssemblerBase *pAsm);
590 GLboolean assemble_COND(r700_AssemblerBase *pAsm);
591 GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm);
592
593 GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex);
594 GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm);
595 GLboolean assemble_RET(r700_AssemblerBase *pAsm);
596 GLboolean assemble_CAL(r700_AssemblerBase *pAsm,
597 GLint nILindex,
598 GLuint uiNumberInsts,
599 struct prog_instruction *pILInst);
600
601 GLboolean Process_Export(r700_AssemblerBase* pAsm,
602 GLuint type,
603 GLuint export_starting_index,
604 GLuint export_count,
605 GLuint starting_register_number,
606 GLboolean is_depth_export);
607 GLboolean Move_Depth_Exports_To_Correct_Channels(r700_AssemblerBase *pAsm,
608 BITS depth_channel_select);
609
610
611 //Interface
612 GLboolean AssembleInstr(GLuint uiFirstInst,
613 GLuint uiNumberInsts,
614 struct prog_instruction *pILInst,
615 r700_AssemblerBase *pR700AsmCode);
616 GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten);
617 GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten);
618
619 GLboolean RelocProgram(r700_AssemblerBase * pAsm);
620 GLboolean InitShaderProgram(r700_AssemblerBase * pAsm);
621
622 int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700_Shader* pShader);
623 GLboolean Clean_Up_Assembler(r700_AssemblerBase *pR700AsmCode);
624
625 #endif //_R700_ASSEMBLER_H_