mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-26 05:40:33 +01:00
i965: Emit MOVs for neg/abs.
Necessary to avoid combining a bitcast and a modifier into a single
operation. Otherwise if safe, the MOV should be removed by
copy-propagation or register coalescing.
With this and the next patch, there are only four changes in shader-db:
all a single extra instruction. The code does something like
mov a.w, -b.x
and copy propagation doesn't work because it only handles no-op
swizzles. Seems acceptable, given the known limitation of our copy
propagation.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereoytpe441@gmail.com>
(cherry picked from commit 0ae9ca12a8)
This commit is contained in:
parent
3f438bfa4c
commit
f0bc10679e
2 changed files with 4 additions and 4 deletions
|
|
@ -361,12 +361,12 @@ fs_visitor::visit(ir_expression *ir)
|
|||
break;
|
||||
case ir_unop_neg:
|
||||
op[0].negate = !op[0].negate;
|
||||
this->result = op[0];
|
||||
emit(MOV(this->result, op[0]));
|
||||
break;
|
||||
case ir_unop_abs:
|
||||
op[0].abs = true;
|
||||
op[0].negate = false;
|
||||
this->result = op[0];
|
||||
emit(MOV(this->result, op[0]));
|
||||
break;
|
||||
case ir_unop_sign:
|
||||
temp = fs_reg(this, ir->type);
|
||||
|
|
|
|||
|
|
@ -1391,12 +1391,12 @@ vec4_visitor::visit(ir_expression *ir)
|
|||
break;
|
||||
case ir_unop_neg:
|
||||
op[0].negate = !op[0].negate;
|
||||
this->result = op[0];
|
||||
emit(MOV(result_dst, op[0]));
|
||||
break;
|
||||
case ir_unop_abs:
|
||||
op[0].abs = true;
|
||||
op[0].negate = false;
|
||||
this->result = op[0];
|
||||
emit(MOV(result_dst, op[0]));
|
||||
break;
|
||||
|
||||
case ir_unop_sign:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue