Lines Matching refs:reg
39 fs_reg(struct ::brw_reg reg);
58 negate(fs_reg reg) in negate() argument
60 assert(reg.file != IMM); in negate()
61 reg.negate = !reg.negate; in negate()
62 return reg; in negate()
66 retype(fs_reg reg, enum brw_reg_type type) in retype() argument
68 reg.type = type; in retype()
69 return reg; in retype()
73 byte_offset(fs_reg reg, unsigned delta) in byte_offset() argument
75 switch (reg.file) { in byte_offset()
81 reg.offset += delta; in byte_offset()
84 const unsigned suboffset = reg.offset + delta; in byte_offset()
85 reg.nr += suboffset / REG_SIZE; in byte_offset()
86 reg.offset = suboffset % REG_SIZE; in byte_offset()
91 const unsigned suboffset = reg.subnr + delta; in byte_offset()
92 reg.nr += suboffset / REG_SIZE; in byte_offset()
93 reg.subnr = suboffset % REG_SIZE; in byte_offset()
100 return reg; in byte_offset()
104 horiz_offset(const fs_reg ®, unsigned delta) in horiz_offset() argument
106 switch (reg.file) { in horiz_offset()
114 return reg; in horiz_offset()
118 return byte_offset(reg, delta * reg.stride * type_sz(reg.type)); in horiz_offset()
121 if (reg.is_null()) { in horiz_offset()
122 return reg; in horiz_offset()
124 const unsigned stride = reg.hstride ? 1 << (reg.hstride - 1) : 0; in horiz_offset()
125 return byte_offset(reg, delta * stride * type_sz(reg.type)); in horiz_offset()
132 offset(fs_reg reg, unsigned width, unsigned delta) in offset() argument
134 switch (reg.file) { in offset()
143 return byte_offset(reg, delta * reg.component_size(width)); in offset()
147 return reg; in offset()
155 component(fs_reg reg, unsigned idx) in component() argument
157 reg = horiz_offset(reg, idx); in component()
158 reg.stride = 0; in component()
159 return reg; in component()
248 is_periodic(const fs_reg ®, unsigned n) in is_periodic() argument
250 if (reg.file == BAD_FILE || reg.is_null()) { in is_periodic()
253 } else if (reg.file == IMM) { in is_periodic()
254 const unsigned period = (reg.type == BRW_REGISTER_TYPE_UV || in is_periodic()
255 reg.type == BRW_REGISTER_TYPE_V ? 8 : in is_periodic()
256 reg.type == BRW_REGISTER_TYPE_VF ? 4 : in is_periodic()
260 } else if (reg.file == ARF || reg.file == FIXED_GRF) { in is_periodic()
261 const unsigned period = (reg.hstride == 0 && reg.vstride == 0 ? 1 : in is_periodic()
262 reg.vstride == 0 ? 1 << reg.width : in is_periodic()
267 return reg.stride == 0; in is_periodic()
272 is_uniform(const fs_reg ®) in is_uniform() argument
274 return is_periodic(reg, 1); in is_uniform()
281 quarter(const fs_reg ®, unsigned idx) in quarter() argument
284 return horiz_offset(reg, 8 * idx); in quarter()
292 subscript(fs_reg reg, brw_reg_type type, unsigned i) in subscript() argument
294 assert((i + 1) * type_sz(type) <= type_sz(reg.type)); in subscript()
296 if (reg.file == ARF || reg.file == FIXED_GRF) { in subscript()
300 const int delta = util_logbase2(type_sz(reg.type)) - in subscript()
302 reg.hstride += (reg.hstride ? delta : 0); in subscript()
303 reg.vstride += (reg.vstride ? delta : 0); in subscript()
305 } else if (reg.file == IMM) { in subscript()
307 reg.u64 >>= i * bit_size; in subscript()
308 reg.u64 &= BITFIELD64_MASK(bit_size); in subscript()
310 reg.u64 |= reg.u64 << 16; in subscript()
311 return retype(reg, type); in subscript()
313 reg.stride *= type_sz(reg.type) / type_sz(type); in subscript()
316 return byte_offset(retype(reg, type), i * type_sz(type)); in subscript()
320 horiz_stride(fs_reg reg, unsigned s) in horiz_stride() argument
322 reg.stride *= s; in horiz_stride()
323 return reg; in horiz_stride()
632 fs_reg reg = inst->src[0]; in is_identity_payload() local
635 reg.type = inst->src[i].type; in is_identity_payload()
636 if (!inst->src[i].equals(reg)) in is_identity_payload()
639 reg = byte_offset(reg, inst->size_read(i)); in is_identity_payload()