aco: do not select 96-bit/128-bit variants for ds_read/ds_write on GFX6
Only GFX7 and later support large ds_read/ds_write. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3412>
This commit is contained in:
parent
44ffeb4fee
commit
923005bf54
|
@ -2759,6 +2759,7 @@ void load_lds(isel_context *ctx, unsigned elem_size_bytes, Temp dst,
|
||||||
unsigned result_size = 0;
|
unsigned result_size = 0;
|
||||||
unsigned total_bytes = num_components * elem_size_bytes;
|
unsigned total_bytes = num_components * elem_size_bytes;
|
||||||
std::array<Temp, NIR_MAX_VEC_COMPONENTS> result;
|
std::array<Temp, NIR_MAX_VEC_COMPONENTS> result;
|
||||||
|
bool large_ds_read = ctx->options->chip_class >= GFX7;
|
||||||
|
|
||||||
while (bytes_read < total_bytes) {
|
while (bytes_read < total_bytes) {
|
||||||
unsigned todo = total_bytes - bytes_read;
|
unsigned todo = total_bytes - bytes_read;
|
||||||
|
@ -2767,14 +2768,14 @@ void load_lds(isel_context *ctx, unsigned elem_size_bytes, Temp dst,
|
||||||
|
|
||||||
aco_opcode op = aco_opcode::last_opcode;
|
aco_opcode op = aco_opcode::last_opcode;
|
||||||
bool read2 = false;
|
bool read2 = false;
|
||||||
if (todo >= 16 && aligned16) {
|
if (todo >= 16 && aligned16 && large_ds_read) {
|
||||||
op = aco_opcode::ds_read_b128;
|
op = aco_opcode::ds_read_b128;
|
||||||
todo = 16;
|
todo = 16;
|
||||||
} else if (todo >= 16 && aligned8) {
|
} else if (todo >= 16 && aligned8) {
|
||||||
op = aco_opcode::ds_read2_b64;
|
op = aco_opcode::ds_read2_b64;
|
||||||
read2 = true;
|
read2 = true;
|
||||||
todo = 16;
|
todo = 16;
|
||||||
} else if (todo >= 12 && aligned16) {
|
} else if (todo >= 12 && aligned16 && large_ds_read) {
|
||||||
op = aco_opcode::ds_read_b96;
|
op = aco_opcode::ds_read_b96;
|
||||||
todo = 12;
|
todo = 12;
|
||||||
} else if (todo >= 8 && aligned8) {
|
} else if (todo >= 8 && aligned8) {
|
||||||
|
@ -2884,6 +2885,8 @@ void ds_write_helper(isel_context *ctx, Operand m, Temp address, Temp data, unsi
|
||||||
{
|
{
|
||||||
Builder bld(ctx->program, ctx->block);
|
Builder bld(ctx->program, ctx->block);
|
||||||
unsigned bytes_written = 0;
|
unsigned bytes_written = 0;
|
||||||
|
bool large_ds_write = ctx->options->chip_class >= GFX7;
|
||||||
|
|
||||||
while (bytes_written < total_size * 4) {
|
while (bytes_written < total_size * 4) {
|
||||||
unsigned todo = total_size * 4 - bytes_written;
|
unsigned todo = total_size * 4 - bytes_written;
|
||||||
bool aligned8 = bytes_written % 8 == 0 && align % 8 == 0;
|
bool aligned8 = bytes_written % 8 == 0 && align % 8 == 0;
|
||||||
|
@ -2892,14 +2895,14 @@ void ds_write_helper(isel_context *ctx, Operand m, Temp address, Temp data, unsi
|
||||||
aco_opcode op = aco_opcode::last_opcode;
|
aco_opcode op = aco_opcode::last_opcode;
|
||||||
bool write2 = false;
|
bool write2 = false;
|
||||||
unsigned size = 0;
|
unsigned size = 0;
|
||||||
if (todo >= 16 && aligned16) {
|
if (todo >= 16 && aligned16 && large_ds_write) {
|
||||||
op = aco_opcode::ds_write_b128;
|
op = aco_opcode::ds_write_b128;
|
||||||
size = 4;
|
size = 4;
|
||||||
} else if (todo >= 16 && aligned8) {
|
} else if (todo >= 16 && aligned8) {
|
||||||
op = aco_opcode::ds_write2_b64;
|
op = aco_opcode::ds_write2_b64;
|
||||||
write2 = true;
|
write2 = true;
|
||||||
size = 4;
|
size = 4;
|
||||||
} else if (todo >= 12 && aligned16) {
|
} else if (todo >= 12 && aligned16 && large_ds_write) {
|
||||||
op = aco_opcode::ds_write_b96;
|
op = aco_opcode::ds_write_b96;
|
||||||
size = 3;
|
size = 3;
|
||||||
} else if (todo >= 8 && aligned8) {
|
} else if (todo >= 8 && aligned8) {
|
||||||
|
|
Loading…
Reference in New Issue