instr->intrinsic == nir_intrinsic_image_deref_atomic_xor ||
instr->intrinsic == nir_intrinsic_image_deref_atomic_exchange ||
instr->intrinsic == nir_intrinsic_image_deref_atomic_comp_swap ||
+ instr->intrinsic == nir_intrinsic_image_deref_atomic_fadd ||
instr->intrinsic == nir_intrinsic_image_deref_size) {
b->cursor = nir_before_instr(&instr->instr);
op = nir_intrinsic_image_deref_store;
break;
case ir_intrinsic_image_atomic_add:
- op = nir_intrinsic_image_deref_atomic_add;
+ op = ir->return_deref->type->is_integer_32_64()
+ ? nir_intrinsic_image_deref_atomic_add
+ : nir_intrinsic_image_deref_atomic_fadd;
break;
case ir_intrinsic_image_atomic_min:
op = nir_intrinsic_image_deref_atomic_min;
op = nir_intrinsic_load_ssbo;
break;
case ir_intrinsic_ssbo_atomic_add:
- op = nir_intrinsic_ssbo_atomic_add;
+ op = ir->return_deref->type->is_integer_32_64()
+ ? nir_intrinsic_ssbo_atomic_add : nir_intrinsic_ssbo_atomic_fadd;
break;
case ir_intrinsic_ssbo_atomic_and:
op = nir_intrinsic_ssbo_atomic_and;
op = nir_intrinsic_store_shared;
break;
case ir_intrinsic_shared_atomic_add:
- op = nir_intrinsic_shared_atomic_add;
+ op = ir->return_deref->type->is_integer_32_64()
+ ? nir_intrinsic_shared_atomic_add
+ : nir_intrinsic_shared_atomic_fadd;
break;
case ir_intrinsic_shared_atomic_and:
op = nir_intrinsic_shared_atomic_and;
case nir_intrinsic_image_deref_atomic_xor:
case nir_intrinsic_image_deref_atomic_exchange:
case nir_intrinsic_image_deref_atomic_comp_swap:
+ case nir_intrinsic_image_deref_atomic_fadd:
case nir_intrinsic_image_deref_samples:
case nir_intrinsic_image_deref_size: {
nir_ssa_undef_instr *instr_undef =
case nir_intrinsic_ssbo_atomic_or:
case nir_intrinsic_ssbo_atomic_xor:
case nir_intrinsic_ssbo_atomic_exchange:
- case nir_intrinsic_ssbo_atomic_comp_swap: {
+ case nir_intrinsic_ssbo_atomic_comp_swap:
+ case nir_intrinsic_ssbo_atomic_fadd: {
int param_count = ir->actual_parameters.length();
assert(param_count == 3 || param_count == 4);
case nir_intrinsic_shared_atomic_or:
case nir_intrinsic_shared_atomic_xor:
case nir_intrinsic_shared_atomic_exchange:
- case nir_intrinsic_shared_atomic_comp_swap: {
+ case nir_intrinsic_shared_atomic_comp_swap:
+ case nir_intrinsic_shared_atomic_fadd: {
int param_count = ir->actual_parameters.length();
assert(param_count == 2 || param_count == 3);
intrinsic("image_deref_atomic_xor", src_comp=[1, 4, 1, 1], dest_comp=1)
intrinsic("image_deref_atomic_exchange", src_comp=[1, 4, 1, 1], dest_comp=1)
intrinsic("image_deref_atomic_comp_swap", src_comp=[1, 4, 1, 1, 1], dest_comp=1)
+intrinsic("image_deref_atomic_fadd", src_comp=[1, 4, 1, 1], dest_comp=1)
intrinsic("image_deref_size", src_comp=[1], dest_comp=0, flags=[CAN_ELIMINATE, CAN_REORDER])
intrinsic("image_deref_samples", src_comp=[1], dest_comp=1, flags=[CAN_ELIMINATE, CAN_REORDER])
intrinsic("deref_atomic_xor", src_comp=[1, 1], dest_comp=1)
intrinsic("deref_atomic_exchange", src_comp=[1, 1], dest_comp=1)
intrinsic("deref_atomic_comp_swap", src_comp=[1, 1, 1], dest_comp=1)
+intrinsic("deref_atomic_fadd", src_comp=[1, 1], dest_comp=1)
# SSBO atomic intrinsics
#
intrinsic("ssbo_atomic_xor", src_comp=[1, 1, 1], dest_comp=1)
intrinsic("ssbo_atomic_exchange", src_comp=[1, 1, 1], dest_comp=1)
intrinsic("ssbo_atomic_comp_swap", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_fadd", src_comp=[1, 1, 1], dest_comp=1)
# CS shared variable atomic intrinsics
#
intrinsic("shared_atomic_xor", src_comp=[1, 1], dest_comp=1, indices=[BASE])
intrinsic("shared_atomic_exchange", src_comp=[1, 1], dest_comp=1, indices=[BASE])
intrinsic("shared_atomic_comp_swap", src_comp=[1, 1, 1], dest_comp=1, indices=[BASE])
+intrinsic("shared_atomic_fadd", src_comp=[1, 1], dest_comp=1, indices=[BASE])
def system_value(name, dest_comp, indices=[]):
intrinsic("load_" + name, [], dest_comp, indices,
case nir_intrinsic_ssbo_atomic_xor:
case nir_intrinsic_ssbo_atomic_exchange:
case nir_intrinsic_ssbo_atomic_comp_swap:
+ case nir_intrinsic_ssbo_atomic_fadd:
case nir_intrinsic_store_ssbo:
case nir_intrinsic_load_ssbo:
case nir_intrinsic_get_buffer_size:
OP(atomic_and)
OP(atomic_or)
OP(atomic_xor)
+ OP(atomic_fadd)
#undef OP
default:
unreachable("Invalid atomic");
case nir_intrinsic_deref_atomic_xor:
case nir_intrinsic_deref_atomic_exchange:
case nir_intrinsic_deref_atomic_comp_swap:
+ case nir_intrinsic_deref_atomic_fadd:
/* We can lower the io for this nir instrinsic */
break;
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_deref_atomic_xor:
case nir_intrinsic_deref_atomic_exchange:
case nir_intrinsic_deref_atomic_comp_swap:
+ case nir_intrinsic_deref_atomic_fadd:
assert(vertex_index == NULL);
replacement = lower_atomic(intrin, state, var, offset);
break;