• Home
  • Raw
  • Download

Lines Matching refs:reg

190    struct brw_reg reg;  in brw_reg()  local
198 reg.type = type; in brw_reg()
199 reg.file = file; in brw_reg()
200 reg.nr = nr; in brw_reg()
201 reg.subnr = subnr * type_sz(type); in brw_reg()
202 reg.negate = 0; in brw_reg()
203 reg.abs = 0; in brw_reg()
204 reg.vstride = vstride; in brw_reg()
205 reg.width = width; in brw_reg()
206 reg.hstride = hstride; in brw_reg()
207 reg.address_mode = BRW_ADDRESS_DIRECT; in brw_reg()
208 reg.pad0 = 0; in brw_reg()
216 reg.dw1.bits.swizzle = swizzle; in brw_reg()
217 reg.dw1.bits.writemask = writemask; in brw_reg()
218 reg.dw1.bits.indirect_offset = 0; in brw_reg()
219 reg.dw1.bits.pad1 = 0; in brw_reg()
220 return reg; in brw_reg()
300 retype(struct brw_reg reg, unsigned type) in retype() argument
302 reg.type = type; in retype()
303 return reg; in retype()
307 sechalf(struct brw_reg reg) in sechalf() argument
309 if (reg.vstride) in sechalf()
310 reg.nr++; in sechalf()
311 return reg; in sechalf()
315 suboffset(struct brw_reg reg, unsigned delta) in suboffset() argument
317 reg.subnr += delta * type_sz(reg.type); in suboffset()
318 return reg; in suboffset()
323 offset(struct brw_reg reg, unsigned delta) in offset() argument
325 reg.nr += delta; in offset()
326 return reg; in offset()
331 byte_offset(struct brw_reg reg, unsigned bytes) in byte_offset() argument
333 unsigned newoffset = reg.nr * REG_SIZE + reg.subnr + bytes; in byte_offset()
334 reg.nr = newoffset / REG_SIZE; in byte_offset()
335 reg.subnr = newoffset % REG_SIZE; in byte_offset()
336 return reg; in byte_offset()
465 brw_address(struct brw_reg reg) in brw_address() argument
467 return brw_imm_uw(reg.nr * REG_SIZE + reg.subnr); in brw_address()
566 brw_flag_reg(int reg, int subreg) in brw_flag_reg() argument
569 BRW_ARF_FLAG + reg, subreg); in brw_flag_reg()
605 stride(struct brw_reg reg, unsigned vstride, unsigned width, unsigned hstride) in stride() argument
607 reg.vstride = cvt(vstride); in stride()
608 reg.width = cvt(width) - 1; in stride()
609 reg.hstride = cvt(hstride); in stride()
610 return reg; in stride()
615 vec16(struct brw_reg reg) in vec16() argument
617 return stride(reg, 16,16,1); in vec16()
621 vec8(struct brw_reg reg) in vec8() argument
623 return stride(reg, 8,8,1); in vec8()
627 vec4(struct brw_reg reg) in vec4() argument
629 return stride(reg, 4,4,1); in vec4()
633 vec2(struct brw_reg reg) in vec2() argument
635 return stride(reg, 2,2,1); in vec2()
639 vec1(struct brw_reg reg) in vec1() argument
641 return stride(reg, 0,1,0); in vec1()
646 get_element(struct brw_reg reg, unsigned elt) in get_element() argument
648 return vec1(suboffset(reg, elt)); in get_element()
652 get_element_ud(struct brw_reg reg, unsigned elt) in get_element_ud() argument
654 return vec1(suboffset(retype(reg, BRW_REGISTER_TYPE_UD), elt)); in get_element_ud()
658 get_element_d(struct brw_reg reg, unsigned elt) in get_element_d() argument
660 return vec1(suboffset(retype(reg, BRW_REGISTER_TYPE_D), elt)); in get_element_d()
665 brw_swizzle(struct brw_reg reg, unsigned x, unsigned y, unsigned z, unsigned w) in brw_swizzle() argument
667 assert(reg.file != BRW_IMMEDIATE_VALUE); in brw_swizzle()
669 reg.dw1.bits.swizzle = BRW_SWIZZLE4(BRW_GET_SWZ(reg.dw1.bits.swizzle, x), in brw_swizzle()
670 BRW_GET_SWZ(reg.dw1.bits.swizzle, y), in brw_swizzle()
671 BRW_GET_SWZ(reg.dw1.bits.swizzle, z), in brw_swizzle()
672 BRW_GET_SWZ(reg.dw1.bits.swizzle, w)); in brw_swizzle()
673 return reg; in brw_swizzle()
678 brw_swizzle1(struct brw_reg reg, unsigned x) in brw_swizzle1() argument
680 return brw_swizzle(reg, x, x, x, x); in brw_swizzle1()
684 brw_writemask(struct brw_reg reg, unsigned mask) in brw_writemask() argument
686 assert(reg.file != BRW_IMMEDIATE_VALUE); in brw_writemask()
687 reg.dw1.bits.writemask &= mask; in brw_writemask()
688 return reg; in brw_writemask()
692 brw_set_writemask(struct brw_reg reg, unsigned mask) in brw_set_writemask() argument
694 assert(reg.file != BRW_IMMEDIATE_VALUE); in brw_set_writemask()
695 reg.dw1.bits.writemask = mask; in brw_set_writemask()
696 return reg; in brw_set_writemask()
700 negate(struct brw_reg reg) in negate() argument
702 reg.negate ^= 1; in negate()
703 return reg; in negate()
707 brw_abs(struct brw_reg reg) in brw_abs() argument
709 reg.abs = 1; in brw_abs()
710 reg.negate = 0; in brw_abs()
711 return reg; in brw_abs()
719 struct brw_reg reg = brw_vec4_grf(0, 0); in brw_vec4_indirect() local
720 reg.subnr = subnr; in brw_vec4_indirect()
721 reg.address_mode = BRW_ADDRESS_REGISTER_INDIRECT_REGISTER; in brw_vec4_indirect()
722 reg.dw1.bits.indirect_offset = offset; in brw_vec4_indirect()
723 return reg; in brw_vec4_indirect()
729 struct brw_reg reg = brw_vec1_grf(0, 0); in brw_vec1_indirect() local
730 reg.subnr = subnr; in brw_vec1_indirect()
731 reg.address_mode = BRW_ADDRESS_REGISTER_INDIRECT_REGISTER; in brw_vec1_indirect()
732 reg.dw1.bits.indirect_offset = offset; in brw_vec1_indirect()
733 return reg; in brw_vec1_indirect()
802 void brw_print_reg(struct brw_reg reg);