summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp11
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp11
2 files changed, 14 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index bd9345ebef2..1e7fdf5b4f2 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -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]));
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index a81c66a861f..8b8b27f8e7b 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -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]));