struct brw_reg clampX1,
struct brw_reg clampY1)
{
- emit_cond_mov(regX, clampX0, BRW_CONDITIONAL_L, regX, clampX0);
- emit_cond_mov(regX, clampX1, BRW_CONDITIONAL_G, regX, clampX1);
- emit_cond_mov(regY, clampY0, BRW_CONDITIONAL_L, regY, clampY0);
- emit_cond_mov(regY, clampY1, BRW_CONDITIONAL_G, regY, clampY1);
+ emit_max(regX, regX, clampX0);
+ emit_max(regY, regY, clampY0);
+ emit_min(regX, regX, clampX1);
+ emit_min(regY, regY, clampY1);
}
/**
new (mem_ctx) fs_inst(BRW_OPCODE_LRP, 16, dst, src1, src2, src3));
}
+ inline void emit_min(const struct brw_reg& dst,
+ const struct brw_reg& src1,
+ const struct brw_reg& src2)
+ {
+ fs_inst *inst = new (mem_ctx) fs_inst(BRW_OPCODE_SEL, 16, dst, src1, src2);
+ inst->conditional_mod = BRW_CONDITIONAL_L;
+ insts.push_tail(inst);
+ }
+
+ inline void emit_max(const struct brw_reg& dst,
+ const struct brw_reg& src1,
+ const struct brw_reg& src2)
+ {
+ fs_inst *inst = new (mem_ctx) fs_inst(BRW_OPCODE_SEL, 16, dst, src1, src2);
+ inst->conditional_mod = BRW_CONDITIONAL_GE;
+ insts.push_tail(inst);
+ }
+
inline void emit_mov(const struct brw_reg& dst, const struct brw_reg& src)
{
insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_MOV, 16, dst, src));