"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/amd/compiler/aco_instruction_selection.cpp" between
mesa-20.0.0-rc2.tar.xz and mesa-20.0.0-rc3.tar.xz

About: Mesa is an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics (main library code). Release candidate.

aco_instruction_selection.cpp  (mesa-20.0.0-rc2.tar.xz):aco_instruction_selection.cpp  (mesa-20.0.0-rc3.tar.xz)
skipping to change at line 2658 skipping to change at line 2658
Builder bld(ctx->program, ctx->block); Builder bld(ctx->program, ctx->block);
Operand m = load_lds_size_m0(ctx); Operand m = load_lds_size_m0(ctx);
unsigned num_components = dst.size() * 4u / elem_size_bytes; unsigned num_components = dst.size() * 4u / elem_size_bytes;
unsigned bytes_read = 0; unsigned bytes_read = 0;
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; bool large_ds_read = ctx->options->chip_class >= GFX7;
bool usable_read2 = 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;
bool aligned8 = bytes_read % 8 == 0 && align % 8 == 0; bool aligned8 = bytes_read % 8 == 0 && align % 8 == 0;
bool aligned16 = bytes_read % 16 == 0 && align % 16 == 0; bool aligned16 = bytes_read % 16 == 0 && align % 16 == 0;
aco_opcode op = aco_opcode::last_opcode; aco_opcode op = aco_opcode::last_opcode;
bool read2 = false; bool read2 = false;
if (todo >= 16 && aligned16 && large_ds_read) { 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 && usable_read2) {
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 && large_ds_read) { } 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) {
op = aco_opcode::ds_read_b64; op = aco_opcode::ds_read_b64;
todo = 8; todo = 8;
} else if (todo >= 8) { } else if (todo >= 8 && usable_read2) {
op = aco_opcode::ds_read2_b32; op = aco_opcode::ds_read2_b32;
read2 = true; read2 = true;
todo = 8; todo = 8;
} else if (todo >= 4) { } else if (todo >= 4) {
op = aco_opcode::ds_read_b32; op = aco_opcode::ds_read_b32;
todo = 4; todo = 4;
} else { } else {
assert(false); assert(false);
} }
assert(todo % elem_size_bytes == 0); assert(todo % elem_size_bytes == 0);
skipping to change at line 2784 skipping to change at line 2785
vec->definitions[0] = Definition(res); vec->definitions[0] = Definition(res);
ctx->block->instructions.emplace_back(std::move(vec)); ctx->block->instructions.emplace_back(std::move(vec));
return res; return res;
} }
void ds_write_helper(isel_context *ctx, Operand m, Temp address, Temp data, unsi gned data_start, unsigned total_size, unsigned offset0, unsigned offset1, unsign ed align) void ds_write_helper(isel_context *ctx, Operand m, Temp address, Temp data, unsi gned data_start, unsigned total_size, unsigned offset0, unsigned offset1, unsign ed align)
{ {
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; bool large_ds_write = ctx->options->chip_class >= GFX7;
bool usable_write2 = 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;
bool aligned16 = bytes_written % 16 == 0 && align % 16 == 0; bool aligned16 = bytes_written % 16 == 0 && align % 16 == 0;
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 && large_ds_write) { 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 && usable_write2) {
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 && large_ds_write) { } 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) {
op = aco_opcode::ds_write_b64; op = aco_opcode::ds_write_b64;
size = 2; size = 2;
} else if (todo >= 8) { } else if (todo >= 8 && usable_write2) {
op = aco_opcode::ds_write2_b32; op = aco_opcode::ds_write2_b32;
write2 = true; write2 = true;
size = 2; size = 2;
} else if (todo >= 4) { } else if (todo >= 4) {
op = aco_opcode::ds_write_b32; op = aco_opcode::ds_write_b32;
size = 1; size = 1;
} else { } else {
assert(false); assert(false);
} }
 End of changes. 6 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)