i965: Fix bitcast operations with negate (ceil)

Commit 0ae9ca12a8 put source modifiers out of the bitcast operations
by adding a MOV operation that would handle them separately. It missed
the case of ceil though: the implementation negates both its source and
destination operands. The source operand will be used for RNDD, which
we can handle normally, but we need to fix the modifier for the
negated result.

v2:
  - RNDD can handle the source modifier so no need to put that one
    in a separate MOV.

Fixes the following 42 dEQP tests:
dEQP-GLES3.functional.shaders.builtin_functions.common.ceil.*_vertex
dEQP-GLES3.functional.shaders.builtin_functions.common.ceil.*_fragment
dEQP-GLES3.functional.shaders.builtin_functions.precision.ceil._*vertex.*
dEQP-GLES3.functional.shaders.builtin_functions.precision.ceil._*fragment.*

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
Iago Toral Quiroga 2014-12-17 14:19:01 +01:00
parent d42e090386
commit c260d61e76
2 changed files with 14 additions and 8 deletions

View File

@ -954,10 +954,13 @@ fs_visitor::visit(ir_expression *ir)
case ir_unop_trunc:
emit(RNDZ(this->result, op[0]));
break;
case ir_unop_ceil:
op[0].negate = !op[0].negate;
emit(RNDD(this->result, op[0]));
this->result.negate = true;
case ir_unop_ceil: {
fs_reg tmp = fs_reg(this, ir->type);
op[0].negate = !op[0].negate;
emit(RNDD(tmp, op[0]));
tmp.negate = true;
emit(MOV(this->result, tmp));
}
break;
case ir_unop_floor:
emit(RNDD(this->result, op[0]));

View File

@ -1647,10 +1647,13 @@ vec4_visitor::visit(ir_expression *ir)
case ir_unop_trunc:
emit(RNDZ(result_dst, op[0]));
break;
case ir_unop_ceil:
op[0].negate = !op[0].negate;
inst = emit(RNDD(result_dst, op[0]));
this->result.negate = true;
case ir_unop_ceil: {
src_reg tmp = src_reg(this, ir->type);
op[0].negate = !op[0].negate;
emit(RNDD(dst_reg(tmp), op[0]));
tmp.negate = true;
emit(MOV(result_dst, tmp));
}
break;
case ir_unop_floor:
inst = emit(RNDD(result_dst, op[0]));