break;
}
- case nir_intrinsic_memory_barrier:
- case nir_intrinsic_scoped_memory_barrier: {
+ case nir_intrinsic_scoped_barrier:
+ assert(nir_intrinsic_execution_scope(instr) == NIR_SCOPE_NONE);
+ /* Fall through. */
+ case nir_intrinsic_memory_barrier: {
const vec4_builder bld =
vec4_builder(this).at_end().annotate(current_annotation, base_ir);
- const dst_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UD, 2);
- bld.emit(SHADER_OPCODE_MEMORY_FENCE, tmp, brw_vec8_grf(0, 0))
- ->size_written = 2 * REG_SIZE;
+ const dst_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UD);
+ vec4_instruction *fence =
+ bld.emit(SHADER_OPCODE_MEMORY_FENCE, tmp, brw_vec8_grf(0, 0));
+ fence->sfid = GEN7_SFID_DATAPORT_DATA_CACHE;
break;
}
unreachable("not reached: should have been lowered");
case nir_op_fsign:
- if (op[0].abs) {
- /* Straightforward since the source can be assumed to be either
- * strictly >= 0 or strictly <= 0 depending on the setting of the
- * negate flag.
- */
- inst = emit(MOV(dst, op[0]));
- inst->conditional_mod = BRW_CONDITIONAL_NZ;
-
- inst = (op[0].negate)
- ? emit(MOV(dst, brw_imm_f(-1.0f)))
- : emit(MOV(dst, brw_imm_f(1.0f)));
- inst->predicate = BRW_PREDICATE_NORMAL;
- } else if (type_sz(op[0].type) < 8) {
+ if (type_sz(op[0].type) < 8) {
/* AND(val, 0x80000000) gives the sign bit.
*
* Predicated OR ORs 1.0 (0x3f800000) with the sign bit if val is not