nir/glsl: Emit abs, neg, and sat operations instead of source modifiers

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
Jason Ekstrand
2014-11-13 17:23:58 -08:00
parent 8edcd1de14
commit a94d1c2481

View File

@@ -1036,19 +1036,16 @@ nir_visitor::visit(ir_expression *ir)
emit(supports_ints ? nir_op_inot : nir_op_fnot, dest_size, srcs);
break;
case ir_unop_neg:
instr = emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fmov : nir_op_imov,
instr = emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fneg : nir_op_ineg,
dest_size, srcs);
instr->src[0].negate = true;
break;
case ir_unop_abs:
instr = emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fmov : nir_op_imov,
instr = emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fabs : nir_op_iabs,
dest_size, srcs);
instr->src[0].abs = true;
break;
case ir_unop_saturate:
assert(types[0] == GLSL_TYPE_FLOAT);
instr = emit(nir_op_fmov, dest_size, srcs);
instr->dest.saturate = true;
instr = emit(nir_op_fsat, dest_size, srcs);
break;
case ir_unop_sign:
emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fsign : nir_op_isign,