2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **********************************************************************/
29 * Keith Whitwell <keith@tungstengraphics.com>
37 #include "brw_structs.h"
38 #include "brw_defines.h"
39 #include "program/prog_instruction.h"
41 #define BRW_SWIZZLE4(a,b,c,d) (((a)<<0) | ((b)<<2) | ((c)<<4) | ((d)<<6))
42 #define BRW_GET_SWZ(swz, idx) (((swz) >> ((idx)*2)) & 0x3)
44 #define BRW_SWIZZLE_NOOP BRW_SWIZZLE4(0,1,2,3)
45 #define BRW_SWIZZLE_XYZW BRW_SWIZZLE4(0,1,2,3)
46 #define BRW_SWIZZLE_XXXX BRW_SWIZZLE4(0,0,0,0)
47 #define BRW_SWIZZLE_XYXY BRW_SWIZZLE4(0,1,0,1)
50 #define REG_SIZE (8*4)
53 /* These aren't hardware structs, just something useful for us to pass around:
55 * Align1 operation has a lot of control over input ranges. Used in
56 * WM programs to implement shaders decomposed into "channel serial"
57 * or "structure of array" form:
64 GLuint subnr:5; /* :1 in align16 */
65 GLuint negate:1; /* source only */
66 GLuint abs:1; /* source only */
67 GLuint vstride:4; /* source only */
68 GLuint width:3; /* src only, align1 only */
69 GLuint hstride:2; /* align1 only */
70 GLuint address_mode:1; /* relative addressing, hopefully! */
75 GLuint swizzle:8; /* src only, align16 only */
76 GLuint writemask:4; /* dest only, align16 only */
77 GLint indirect_offset:10; /* relative addressing offset */
78 GLuint pad1:10; /* two dwords total */
95 struct brw_glsl_label;
100 #define BRW_EU_MAX_INSN_STACK 5
101 #define BRW_EU_MAX_INSN 10000
104 struct brw_instruction store[BRW_EU_MAX_INSN];
109 /* Allow clients to push/pop instruction state:
111 struct brw_instruction stack[BRW_EU_MAX_INSN_STACK];
112 bool compressed_stack[BRW_EU_MAX_INSN_STACK];
113 struct brw_instruction *current;
116 GLboolean single_program_flow;
118 struct brw_context *brw;
120 /* Control flow stacks:
121 * - if_stack contains IF and ELSE instructions which must be patched
122 * (and popped) once the matching ENDIF instruction is encountered.
124 struct brw_instruction **if_stack;
126 int if_stack_array_size;
128 struct brw_glsl_label *first_label; /**< linked list of labels */
129 struct brw_glsl_call *first_call; /**< linked list of CALs */
134 brw_save_label(struct brw_compile *c, const char *name, GLuint position);
137 brw_save_call(struct brw_compile *c, const char *name, GLuint call_pos);
140 brw_resolve_cals(struct brw_compile *c);
144 static INLINE int type_sz( GLuint type )
147 case BRW_REGISTER_TYPE_UD:
148 case BRW_REGISTER_TYPE_D:
149 case BRW_REGISTER_TYPE_F:
151 case BRW_REGISTER_TYPE_HF:
152 case BRW_REGISTER_TYPE_UW:
153 case BRW_REGISTER_TYPE_W:
155 case BRW_REGISTER_TYPE_UB:
156 case BRW_REGISTER_TYPE_B:
164 * Construct a brw_reg.
165 * \param file one of the BRW_x_REGISTER_FILE values
166 * \param nr register number/index
167 * \param subnr register sub number
168 * \param type one of BRW_REGISTER_TYPE_x
169 * \param vstride one of BRW_VERTICAL_STRIDE_x
170 * \param width one of BRW_WIDTH_x
171 * \param hstride one of BRW_HORIZONTAL_STRIDE_x
172 * \param swizzle one of BRW_SWIZZLE_x
173 * \param writemask WRITEMASK_X/Y/Z/W bitfield
175 static INLINE struct brw_reg brw_reg( GLuint file,
186 if (file == BRW_GENERAL_REGISTER_FILE)
187 assert(nr < BRW_MAX_GRF);
188 else if (file == BRW_MESSAGE_REGISTER_FILE)
189 assert((nr & ~(1 << 7)) < BRW_MAX_MRF);
190 else if (file == BRW_ARCHITECTURE_REGISTER_FILE)
191 assert(nr <= BRW_ARF_IP);
196 reg.subnr = subnr * type_sz(type);
199 reg.vstride = vstride;
201 reg.hstride = hstride;
202 reg.address_mode = BRW_ADDRESS_DIRECT;
205 /* Could do better: If the reg is r5.3<0;1,0>, we probably want to
206 * set swizzle and writemask to W, as the lower bits of subnr will
207 * be lost when converted to align16. This is probably too much to
208 * keep track of as you'd want it adjusted by suboffset(), etc.
209 * Perhaps fix up when converting to align16?
211 reg.dw1.bits.swizzle = swizzle;
212 reg.dw1.bits.writemask = writemask;
213 reg.dw1.bits.indirect_offset = 0;
214 reg.dw1.bits.pad1 = 0;
218 /** Construct float[16] register */
219 static INLINE struct brw_reg brw_vec16_reg( GLuint file,
227 BRW_VERTICAL_STRIDE_16,
229 BRW_HORIZONTAL_STRIDE_1,
234 /** Construct float[8] register */
235 static INLINE struct brw_reg brw_vec8_reg( GLuint file,
243 BRW_VERTICAL_STRIDE_8,
245 BRW_HORIZONTAL_STRIDE_1,
250 /** Construct float[4] register */
251 static INLINE struct brw_reg brw_vec4_reg( GLuint file,
259 BRW_VERTICAL_STRIDE_4,
261 BRW_HORIZONTAL_STRIDE_1,
266 /** Construct float[2] register */
267 static INLINE struct brw_reg brw_vec2_reg( GLuint file,
275 BRW_VERTICAL_STRIDE_2,
277 BRW_HORIZONTAL_STRIDE_1,
282 /** Construct float[1] register */
283 static INLINE struct brw_reg brw_vec1_reg( GLuint file,
291 BRW_VERTICAL_STRIDE_0,
293 BRW_HORIZONTAL_STRIDE_0,
299 static INLINE struct brw_reg retype( struct brw_reg reg,
306 static inline struct brw_reg
307 sechalf(struct brw_reg reg)
314 static INLINE struct brw_reg suboffset( struct brw_reg reg,
317 reg.subnr += delta * type_sz(reg.type);
322 static INLINE struct brw_reg offset( struct brw_reg reg,
330 static INLINE struct brw_reg byte_offset( struct brw_reg reg,
333 GLuint newoffset = reg.nr * REG_SIZE + reg.subnr + bytes;
334 reg.nr = newoffset / REG_SIZE;
335 reg.subnr = newoffset % REG_SIZE;
340 /** Construct unsigned word[16] register */
341 static INLINE struct brw_reg brw_uw16_reg( GLuint file,
345 return suboffset(retype(brw_vec16_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr);
348 /** Construct unsigned word[8] register */
349 static INLINE struct brw_reg brw_uw8_reg( GLuint file,
353 return suboffset(retype(brw_vec8_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr);
356 /** Construct unsigned word[1] register */
357 static INLINE struct brw_reg brw_uw1_reg( GLuint file,
361 return suboffset(retype(brw_vec1_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr);
364 static INLINE struct brw_reg brw_imm_reg( GLuint type )
366 return brw_reg( BRW_IMMEDIATE_VALUE,
370 BRW_VERTICAL_STRIDE_0,
372 BRW_HORIZONTAL_STRIDE_0,
377 /** Construct float immediate register */
378 static INLINE struct brw_reg brw_imm_f( GLfloat f )
380 struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_F);
385 /** Construct integer immediate register */
386 static INLINE struct brw_reg brw_imm_d( GLint d )
388 struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_D);
393 /** Construct uint immediate register */
394 static INLINE struct brw_reg brw_imm_ud( GLuint ud )
396 struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_UD);
401 /** Construct ushort immediate register */
402 static INLINE struct brw_reg brw_imm_uw( GLushort uw )
404 struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_UW);
405 imm.dw1.ud = uw | (uw << 16);
409 /** Construct short immediate register */
410 static INLINE struct brw_reg brw_imm_w( GLshort w )
412 struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_W);
413 imm.dw1.d = w | (w << 16);
417 /* brw_imm_b and brw_imm_ub aren't supported by hardware - the type
418 * numbers alias with _V and _VF below:
421 /** Construct vector of eight signed half-byte values */
422 static INLINE struct brw_reg brw_imm_v( GLuint v )
424 struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_V);
425 imm.vstride = BRW_VERTICAL_STRIDE_0;
426 imm.width = BRW_WIDTH_8;
427 imm.hstride = BRW_HORIZONTAL_STRIDE_1;
432 /** Construct vector of four 8-bit float values */
433 static INLINE struct brw_reg brw_imm_vf( GLuint v )
435 struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_VF);
436 imm.vstride = BRW_VERTICAL_STRIDE_0;
437 imm.width = BRW_WIDTH_4;
438 imm.hstride = BRW_HORIZONTAL_STRIDE_1;
445 #define VF_NEG (1<<7)
447 static INLINE struct brw_reg brw_imm_vf4( GLuint v0,
452 struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_VF);
453 imm.vstride = BRW_VERTICAL_STRIDE_0;
454 imm.width = BRW_WIDTH_4;
455 imm.hstride = BRW_HORIZONTAL_STRIDE_1;
456 imm.dw1.ud = ((v0 << 0) |
464 static INLINE struct brw_reg brw_address( struct brw_reg reg )
466 return brw_imm_uw(reg.nr * REG_SIZE + reg.subnr);
469 /** Construct float[1] general-purpose register */
470 static INLINE struct brw_reg brw_vec1_grf( GLuint nr, GLuint subnr )
472 return brw_vec1_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr);
475 /** Construct float[2] general-purpose register */
476 static INLINE struct brw_reg brw_vec2_grf( GLuint nr, GLuint subnr )
478 return brw_vec2_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr);
481 /** Construct float[4] general-purpose register */
482 static INLINE struct brw_reg brw_vec4_grf( GLuint nr, GLuint subnr )
484 return brw_vec4_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr);
487 /** Construct float[8] general-purpose register */
488 static INLINE struct brw_reg brw_vec8_grf( GLuint nr, GLuint subnr )
490 return brw_vec8_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr);
494 static INLINE struct brw_reg brw_uw8_grf( GLuint nr, GLuint subnr )
496 return brw_uw8_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr);
499 static INLINE struct brw_reg brw_uw16_grf( GLuint nr, GLuint subnr )
501 return brw_uw16_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr);
505 /** Construct null register (usually used for setting condition codes) */
506 static INLINE struct brw_reg brw_null_reg( void )
508 return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE,
513 static INLINE struct brw_reg brw_address_reg( GLuint subnr )
515 return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE,
520 /* If/else instructions break in align16 mode if writemask & swizzle
521 * aren't xyzw. This goes against the convention for other scalar
524 static INLINE struct brw_reg brw_ip_reg( void )
526 return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE,
529 BRW_REGISTER_TYPE_UD,
530 BRW_VERTICAL_STRIDE_4, /* ? */
532 BRW_HORIZONTAL_STRIDE_0,
533 BRW_SWIZZLE_XYZW, /* NOTE! */
534 WRITEMASK_XYZW); /* NOTE! */
537 static INLINE struct brw_reg brw_acc_reg( void )
539 return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE,
544 static INLINE struct brw_reg brw_notification_1_reg(void)
547 return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE,
548 BRW_ARF_NOTIFICATION_COUNT,
550 BRW_REGISTER_TYPE_UD,
551 BRW_VERTICAL_STRIDE_0,
553 BRW_HORIZONTAL_STRIDE_0,
559 static INLINE struct brw_reg brw_flag_reg( void )
561 return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE,
567 static INLINE struct brw_reg brw_mask_reg( GLuint subnr )
569 return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE,
574 static INLINE struct brw_reg brw_message_reg( GLuint nr )
576 assert((nr & ~(1 << 7)) < BRW_MAX_MRF);
577 return brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE,
585 /* This is almost always called with a numeric constant argument, so
586 * make things easy to evaluate at compile time:
588 static INLINE GLuint cvt( GLuint val )
602 static INLINE struct brw_reg stride( struct brw_reg reg,
607 reg.vstride = cvt(vstride);
608 reg.width = cvt(width) - 1;
609 reg.hstride = cvt(hstride);
614 static INLINE struct brw_reg vec16( struct brw_reg reg )
616 return stride(reg, 16,16,1);
619 static INLINE struct brw_reg vec8( struct brw_reg reg )
621 return stride(reg, 8,8,1);
624 static INLINE struct brw_reg vec4( struct brw_reg reg )
626 return stride(reg, 4,4,1);
629 static INLINE struct brw_reg vec2( struct brw_reg reg )
631 return stride(reg, 2,2,1);
634 static INLINE struct brw_reg vec1( struct brw_reg reg )
636 return stride(reg, 0,1,0);
640 static INLINE struct brw_reg get_element( struct brw_reg reg, GLuint elt )
642 return vec1(suboffset(reg, elt));
645 static INLINE struct brw_reg get_element_ud( struct brw_reg reg, GLuint elt )
647 return vec1(suboffset(retype(reg, BRW_REGISTER_TYPE_UD), elt));
651 static INLINE struct brw_reg brw_swizzle( struct brw_reg reg,
657 assert(reg.file != BRW_IMMEDIATE_VALUE);
659 reg.dw1.bits.swizzle = BRW_SWIZZLE4(BRW_GET_SWZ(reg.dw1.bits.swizzle, x),
660 BRW_GET_SWZ(reg.dw1.bits.swizzle, y),
661 BRW_GET_SWZ(reg.dw1.bits.swizzle, z),
662 BRW_GET_SWZ(reg.dw1.bits.swizzle, w));
667 static INLINE struct brw_reg brw_swizzle1( struct brw_reg reg,
670 return brw_swizzle(reg, x, x, x, x);
673 static INLINE struct brw_reg brw_writemask( struct brw_reg reg,
676 assert(reg.file != BRW_IMMEDIATE_VALUE);
677 reg.dw1.bits.writemask &= mask;
681 static INLINE struct brw_reg brw_set_writemask( struct brw_reg reg,
684 assert(reg.file != BRW_IMMEDIATE_VALUE);
685 reg.dw1.bits.writemask = mask;
689 static INLINE struct brw_reg negate( struct brw_reg reg )
695 static INLINE struct brw_reg brw_abs( struct brw_reg reg )
701 /***********************************************************************
703 static INLINE struct brw_reg brw_vec4_indirect( GLuint subnr,
706 struct brw_reg reg = brw_vec4_grf(0, 0);
708 reg.address_mode = BRW_ADDRESS_REGISTER_INDIRECT_REGISTER;
709 reg.dw1.bits.indirect_offset = offset;
713 static INLINE struct brw_reg brw_vec1_indirect( GLuint subnr,
716 struct brw_reg reg = brw_vec1_grf(0, 0);
718 reg.address_mode = BRW_ADDRESS_REGISTER_INDIRECT_REGISTER;
719 reg.dw1.bits.indirect_offset = offset;
723 static INLINE struct brw_reg deref_4f(struct brw_indirect ptr, GLint offset)
725 return brw_vec4_indirect(ptr.addr_subnr, ptr.addr_offset + offset);
728 static INLINE struct brw_reg deref_1f(struct brw_indirect ptr, GLint offset)
730 return brw_vec1_indirect(ptr.addr_subnr, ptr.addr_offset + offset);
733 static INLINE struct brw_reg deref_4b(struct brw_indirect ptr, GLint offset)
735 return retype(deref_4f(ptr, offset), BRW_REGISTER_TYPE_B);
738 static INLINE struct brw_reg deref_1uw(struct brw_indirect ptr, GLint offset)
740 return retype(deref_1f(ptr, offset), BRW_REGISTER_TYPE_UW);
743 static INLINE struct brw_reg deref_1d(struct brw_indirect ptr, GLint offset)
745 return retype(deref_1f(ptr, offset), BRW_REGISTER_TYPE_D);
748 static INLINE struct brw_reg deref_1ud(struct brw_indirect ptr, GLint offset)
750 return retype(deref_1f(ptr, offset), BRW_REGISTER_TYPE_UD);
753 static INLINE struct brw_reg get_addr_reg(struct brw_indirect ptr)
755 return brw_address_reg(ptr.addr_subnr);
758 static INLINE struct brw_indirect brw_indirect_offset( struct brw_indirect ptr, GLint offset )
760 ptr.addr_offset += offset;
764 static INLINE struct brw_indirect brw_indirect( GLuint addr_subnr, GLint offset )
766 struct brw_indirect ptr;
767 ptr.addr_subnr = addr_subnr;
768 ptr.addr_offset = offset;
773 /** Do two brw_regs refer to the same register? */
774 static INLINE GLboolean
775 brw_same_reg(struct brw_reg r1, struct brw_reg r2)
777 return r1.file == r2.file && r1.nr == r2.nr;
780 static INLINE struct brw_instruction *current_insn( struct brw_compile *p)
782 return &p->store[p->nr_insn];
785 void brw_pop_insn_state( struct brw_compile *p );
786 void brw_push_insn_state( struct brw_compile *p );
787 void brw_set_mask_control( struct brw_compile *p, GLuint value );
788 void brw_set_saturate( struct brw_compile *p, GLuint value );
789 void brw_set_access_mode( struct brw_compile *p, GLuint access_mode );
790 void brw_set_compression_control( struct brw_compile *p, GLboolean control );
791 void brw_set_predicate_control_flag_value( struct brw_compile *p, GLuint value );
792 void brw_set_predicate_control( struct brw_compile *p, GLuint pc );
793 void brw_set_predicate_inverse(struct brw_compile *p, bool predicate_inverse);
794 void brw_set_conditionalmod( struct brw_compile *p, GLuint conditional );
795 void brw_set_acc_write_control(struct brw_compile *p, GLuint value);
797 void brw_init_compile(struct brw_context *, struct brw_compile *p,
799 const GLuint *brw_get_program( struct brw_compile *p, GLuint *sz );
802 /* Helpers for regular instructions:
805 struct brw_instruction *brw_##OP(struct brw_compile *p, \
806 struct brw_reg dest, \
807 struct brw_reg src0);
810 struct brw_instruction *brw_##OP(struct brw_compile *p, \
811 struct brw_reg dest, \
812 struct brw_reg src0, \
813 struct brw_reg src1);
816 void brw_##OP(struct brw_compile *p, struct brw_reg dest, struct brw_reg src0);
853 /* Helpers for SEND instruction:
855 void brw_urb_WRITE(struct brw_compile *p,
862 GLuint response_length,
864 GLboolean writes_complete,
868 void brw_ff_sync(struct brw_compile *p,
873 GLuint response_length,
876 void brw_fb_WRITE(struct brw_compile *p,
880 GLuint binding_table_index,
882 GLuint response_length,
884 GLboolean header_present);
886 void brw_SAMPLE(struct brw_compile *p,
890 GLuint binding_table_index,
894 GLuint response_length,
897 GLuint header_present,
900 void brw_math_16( struct brw_compile *p,
908 void brw_math( struct brw_compile *p,
917 void brw_math2(struct brw_compile *p,
921 struct brw_reg src1);
923 void brw_oword_block_read(struct brw_compile *p,
927 uint32_t bind_table_index);
929 void brw_oword_block_read_scratch(struct brw_compile *p,
935 void brw_oword_block_write_scratch(struct brw_compile *p,
940 void brw_dword_scattered_read(struct brw_compile *p,
943 uint32_t bind_table_index);
945 void brw_dp_READ_4_vs( struct brw_compile *p,
948 GLuint bind_table_index );
950 void brw_dp_READ_4_vs_relative(struct brw_compile *p,
952 struct brw_reg addrReg,
954 GLuint bind_table_index);
956 /* If/else/endif. Works by manipulating the execution flags on each
959 struct brw_instruction *brw_IF(struct brw_compile *p,
960 GLuint execute_size);
961 struct brw_instruction *gen6_IF(struct brw_compile *p, uint32_t conditional,
962 struct brw_reg src0, struct brw_reg src1);
964 void brw_ELSE(struct brw_compile *p);
965 void brw_ENDIF(struct brw_compile *p);
969 struct brw_instruction *brw_DO(struct brw_compile *p,
970 GLuint execute_size);
972 struct brw_instruction *brw_WHILE(struct brw_compile *p,
973 struct brw_instruction *patch_insn);
975 struct brw_instruction *brw_BREAK(struct brw_compile *p, int pop_count);
976 struct brw_instruction *brw_CONT(struct brw_compile *p, int pop_count);
977 struct brw_instruction *gen6_CONT(struct brw_compile *p,
978 struct brw_instruction *do_insn);
981 void brw_land_fwd_jump(struct brw_compile *p,
982 struct brw_instruction *jmp_insn);
986 void brw_NOP(struct brw_compile *p);
988 void brw_WAIT(struct brw_compile *p);
990 /* Special case: there is never a destination, execution size will be
993 void brw_CMP(struct brw_compile *p,
997 struct brw_reg src1);
999 void brw_print_reg( struct brw_reg reg );
1002 /***********************************************************************
1006 void brw_copy_indirect_to_indirect(struct brw_compile *p,
1007 struct brw_indirect dst_ptr,
1008 struct brw_indirect src_ptr,
1011 void brw_copy_from_indirect(struct brw_compile *p,
1013 struct brw_indirect ptr,
1016 void brw_copy4(struct brw_compile *p,
1021 void brw_copy8(struct brw_compile *p,
1026 void brw_math_invert( struct brw_compile *p,
1028 struct brw_reg src);
1030 void brw_set_src1(struct brw_compile *p,
1031 struct brw_instruction *insn,
1032 struct brw_reg reg);
1034 void brw_set_uip_jip(struct brw_compile *p);
1036 uint32_t brw_swap_cmod(uint32_t cmod);
1038 /* brw_optimize.c */
1039 void brw_optimize(struct brw_compile *p);
1040 void brw_remove_duplicate_mrf_moves(struct brw_compile *p);
1041 void brw_remove_grf_to_mrf_moves(struct brw_compile *p);