nir_address_format_64bit_global,
/**
+ * An address format which is a 64-bit global base address and a 32-bit
+ * offset.
+ *
+ * The address is comprised as a 32-bit vec4 where .xy are a uint64_t base
+ * address stored with the low bits in .x and high bits in .y, .z is
+ * undefined, and .w is an offset. This is intended to match
+ * 64bit_bounded_global but without the bounds checking.
+ */
+ nir_address_format_64bit_global_32bit_offset,
+
+ /**
* An address format which is a bounds-checked 64-bit global GPU address.
*
* The address is comprised as a 32-bit vec4 where .xy are a uint64_t base
switch (addr_format) {
case nir_address_format_32bit_global: return 32;
case nir_address_format_64bit_global: return 64;
+ case nir_address_format_64bit_global_32bit_offset: return 32;
case nir_address_format_64bit_bounded_global: return 32;
case nir_address_format_32bit_index_offset: return 32;
case nir_address_format_32bit_index_offset_pack64: return 64;
switch (addr_format) {
case nir_address_format_32bit_global: return 1;
case nir_address_format_64bit_global: return 1;
+ case nir_address_format_64bit_global_32bit_offset: return 4;
case nir_address_format_64bit_bounded_global: return 4;
case nir_address_format_32bit_index_offset: return 2;
case nir_address_format_32bit_index_offset_pack64: return 1;
assert(offset->bit_size == 32);
return nir_u2u64(b, nir_iadd(b, nir_u2u32(b, addr), offset));
+ case nir_address_format_64bit_global_32bit_offset:
case nir_address_format_64bit_bounded_global:
assert(addr->num_components == 4);
assert(addr->bit_size == offset->bit_size);
return addr_format == nir_address_format_32bit_global ||
addr_format == nir_address_format_64bit_global ||
+ addr_format == nir_address_format_64bit_global_32bit_offset ||
addr_format == nir_address_format_64bit_bounded_global;
}
assert(addr->num_components == 1);
return addr;
+ case nir_address_format_64bit_global_32bit_offset:
case nir_address_format_64bit_bounded_global:
assert(addr->num_components == 4);
return nir_iadd(b, nir_pack_64_2x32(b, nir_channels(b, addr, 0x3)),
const static nir_const_value null_values[][NIR_MAX_VEC_COMPONENTS] = {
[nir_address_format_32bit_global] = {{0}},
[nir_address_format_64bit_global] = {{0}},
+ [nir_address_format_64bit_global_32bit_offset] = {{0}},
[nir_address_format_64bit_bounded_global] = {{0}},
[nir_address_format_32bit_index_offset] = {{.u32 = ~0}, {.u32 = ~0}},
[nir_address_format_32bit_index_offset_pack64] = {{.u64 = ~0ull}},
case nir_address_format_62bit_generic:
return nir_ball_iequal(b, addr0, addr1);
+ case nir_address_format_64bit_global_32bit_offset:
+ return nir_ball_iequal(b, nir_channels(b, addr0, 0xb),
+ nir_channels(b, addr1, 0xb));
+
case nir_address_format_32bit_offset_as_64bit:
assert(addr0->num_components == 1 && addr1->num_components == 1);
return nir_ieq(b, nir_u2u32(b, addr0), nir_u2u32(b, addr1));
assert(addr1->num_components == 1);
return nir_u2u64(b, nir_isub(b, nir_u2u32(b, addr0), nir_u2u32(b, addr1)));
+ case nir_address_format_64bit_global_32bit_offset:
case nir_address_format_64bit_bounded_global:
return nir_isub(b, addr_to_global(b, addr0, addr_format),
addr_to_global(b, addr1, addr_format));