[Mesa-dev] [PATCH 10/23] i965/fs: Remove fs_reg::sechalf.

Paul Berry stereotype441 at gmail.com
Mon Dec 30 09:35:27 PST 2013


On 2 December 2013 11:31, Francisco Jerez <currojerez at riseup.net> wrote:

> +/**
> + * Get either of the 8-component halves of a 16-component register.
> + */
> +static inline fs_reg
> +half(const fs_reg &reg, unsigned idx)
> +{
> +   assert(idx == 0 || (reg.file != HW_REG && reg.file != IMM));
> +   return byte_offset(reg, 8 * idx * reg.stride * type_sz(reg.type));
> +}
> +
>

I'd like to see a comment explaining that it's safe to call this function
on a register with 32 bits per component, since brw_reg.h's byte_offset()
handles byte offsets greater than 32 by incrementing the register number.

Also, for sanity's sake, it would be nice for this function to include the
assertion:

   assert(idx < 2);

With those changes, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131230/fa12e697/attachment.html>


More information about the mesa-dev mailing list