op = nir_intrinsic_atomic_counter_inc;
break;
- case nir_intrinsic_atomic_counter_dec_deref:
- op = nir_intrinsic_atomic_counter_dec;
+ case nir_intrinsic_atomic_counter_pre_dec_deref:
+ op = nir_intrinsic_atomic_counter_pre_dec;
+ break;
+
+ case nir_intrinsic_atomic_counter_post_dec_deref:
+ op = nir_intrinsic_atomic_counter_post_dec;
break;
case nir_intrinsic_atomic_counter_add_deref:
op = nir_intrinsic_atomic_counter_inc_deref;
break;
case ir_intrinsic_atomic_counter_predecrement:
- op = nir_intrinsic_atomic_counter_dec_deref;
+ op = nir_intrinsic_atomic_counter_pre_dec_deref;
break;
case ir_intrinsic_atomic_counter_add:
op = nir_intrinsic_atomic_counter_add_deref;
switch (op) {
case nir_intrinsic_atomic_counter_read_deref:
case nir_intrinsic_atomic_counter_inc_deref:
- case nir_intrinsic_atomic_counter_dec_deref:
+ case nir_intrinsic_atomic_counter_pre_dec_deref:
case nir_intrinsic_atomic_counter_add_deref:
case nir_intrinsic_atomic_counter_min_deref:
case nir_intrinsic_atomic_counter_max_deref:
intrinsic(name, src_comp=[1, 1, 1], dest_comp=1, indices=[BASE])
atomic("atomic_counter_inc")
-atomic("atomic_counter_dec")
+atomic("atomic_counter_pre_dec")
+atomic("atomic_counter_post_dec")
atomic("atomic_counter_read", flags=[CAN_ELIMINATE])
atomic2("atomic_counter_add")
atomic2("atomic_counter_min")
return true;
case nir_intrinsic_atomic_counter_inc:
case nir_intrinsic_atomic_counter_add:
- case nir_intrinsic_atomic_counter_dec:
+ case nir_intrinsic_atomic_counter_pre_dec:
+ case nir_intrinsic_atomic_counter_post_dec:
/* inc and dec get remapped to add: */
op = nir_intrinsic_ssbo_atomic_add;
break;
nir_src_copy(&new_instr->src[1], &instr->src[0], new_instr);
new_instr->src[2] = nir_src_for_ssa(temp);
break;
- case nir_intrinsic_atomic_counter_dec:
+ case nir_intrinsic_atomic_counter_pre_dec:
+ case nir_intrinsic_atomic_counter_post_dec:
/* remapped to ssbo_atomic_add: { buffer_idx, offset, -1 } */
/* NOTE semantic difference so we adjust the return value below */
temp = nir_imm_int(b, -1);
nir_instr_insert_before(&instr->instr, &new_instr->instr);
nir_instr_remove(&instr->instr);
- if (instr->intrinsic == nir_intrinsic_atomic_counter_dec) {
+ if (instr->intrinsic == nir_intrinsic_atomic_counter_pre_dec) {
b->cursor = nir_after_instr(&new_instr->instr);
nir_ssa_def *result = nir_iadd(b, &new_instr->dest.ssa, temp);
nir_ssa_def_rewrite_uses(&instr->dest.ssa, nir_src_for_ssa(result));
OP(AtomicExchange, exchange)
OP(AtomicCompareExchange, comp_swap)
OP(AtomicIIncrement, inc_deref)
- OP(AtomicIDecrement, dec_deref)
+ OP(AtomicIDecrement, post_dec_deref)
OP(AtomicIAdd, add_deref)
OP(AtomicISub, add_deref)
OP(AtomicUMin, min_deref)