[Mesa-dev] [PATCH] i965/fs: Use source's original type in register_coalesce().
Kenneth Graunke
kenneth at whitecape.org
Wed Nov 20 15:02:30 PST 2013
On 11/16/2013 03:23 PM, Matt Turner wrote:
> Previously, register_coalesce() would modify
>
> mov vgrf1:f vgrf2:f
> cmp null vgrf3:d vgrf1:d
>
> to be
>
> cmp null vgrf3:d vgrf2:f
>
> and incorrectly use vgrf2's type in the instruction that the mov was
> coalesced into.
> ---
> My in progress value-numbering pass exposes this bug, but without it I
> didn't find anything fixed by the patch in piglit.
>
> src/mesa/drivers/dri/i965/brw_fs.cpp | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 795e01e..800a7b4 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -2442,6 +2442,7 @@ fs_visitor::register_coalesce()
> scan_inst->src[i].reg == inst->dst.reg &&
> scan_inst->src[i].reg_offset == inst->dst.reg_offset) {
> fs_reg new_src = inst->src[0];
> + new_src.type = scan_inst->src[i].type;
> if (scan_inst->src[i].abs) {
> new_src.negate = 0;
> new_src.abs = 1;
>
Yep, clearly needed. Nice catch.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
More information about the mesa-dev
mailing list