Mesa (master): i965: Add support for ir_unop_round_even via the RNDE instruction.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Oct 14 16:00:13 PDT 2010


Module: Mesa
Branch: master
Commit: f157812bbbcf9caac1f84988e738fc9d1e051056
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f157812bbbcf9caac1f84988e738fc9d1e051056

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Oct 14 14:31:54 2010 -0700

i965: Add support for ir_unop_round_even via the RNDE instruction.

---

 src/mesa/drivers/dri/i965/brw_eu.h      |    1 +
 src/mesa/drivers/dri/i965/brw_eu_emit.c |    1 +
 src/mesa/drivers/dri/i965/brw_fs.cpp    |    6 ++++++
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index c16613e..7cac4a7 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -820,6 +820,7 @@ ALU2(LINE)
 ALU2(PLN)
 
 ROUND(RNDZ)
+ROUND(RNDE)
 
 #undef ALU1
 #undef ALU2
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index 68c6c47..a1fead0 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -700,6 +700,7 @@ ALU2(PLN)
 
 
 ROUND(RNDZ)
+ROUND(RNDE)
 
 
 struct brw_instruction *brw_ADD(struct brw_compile *p,
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index d220c79..e372f3a 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -874,6 +874,9 @@ fs_visitor::visit(ir_expression *ir)
    case ir_unop_fract:
       inst = emit(fs_inst(BRW_OPCODE_FRC, this->result, op[0]));
       break;
+   case ir_unop_round_even:
+      emit(fs_inst(BRW_OPCODE_RNDE, this->result, op[0]));
+      break;
 
    case ir_binop_min:
       inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1]));
@@ -3016,6 +3019,9 @@ fs_visitor::generate_code()
       case BRW_OPCODE_RNDD:
 	 brw_RNDD(p, dst, src[0]);
 	 break;
+      case BRW_OPCODE_RNDE:
+	 brw_RNDE(p, dst, src[0]);
+	 break;
       case BRW_OPCODE_RNDZ:
 	 brw_RNDZ(p, dst, src[0]);
 	 break;



More information about the mesa-commit mailing list