i965: Add support for ir_unop_round_even via the RNDE instruction.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Oct 2010 21:31:54 +0000 (14:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Oct 2010 22:59:47 +0000 (15:59 -0700)
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c
src/mesa/drivers/dri/i965/brw_fs.cpp

index c16613e3df58686f8bc514a509a779e00deae2f5..7cac4a72e4ae3047307d67f2e978b7038c680cb3 100644 (file)
@@ -820,6 +820,7 @@ ALU2(LINE)
 ALU2(PLN)
 
 ROUND(RNDZ)
+ROUND(RNDE)
 
 #undef ALU1
 #undef ALU2
index 68c6c47763bfd953c854775b763a71f810ad3794..a1fead0a4fac06431fcb40dff7a4f7e70299a8b8 100644 (file)
@@ -700,6 +700,7 @@ ALU2(PLN)
 
 
 ROUND(RNDZ)
+ROUND(RNDE)
 
 
 struct brw_instruction *brw_ADD(struct brw_compile *p,
index d220c79a8e464c0025bf1e960bd7f7dbcf26fa4f..e372f3a13da2f0eb1f59b5ff53790f4bc3b094f4 100644 (file)
@@ -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;