pan/bi: ignore ftz mode when scheduling int instructions

This allows more efficient scheduling by putting a 16-bit int
instruction in the same clause as a 32-bit float instruction even when
the 16-bit and 32-bit float controls are different.

Signed-off-by: Benjamin Lee <benjamin.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33660>
This commit is contained in:
Benjamin Lee 2025-03-04 20:03:32 -08:00 committed by Marge Bot
parent 08765d53c9
commit 9737c1fa15
3 changed files with 11 additions and 11 deletions

View file

@ -39,6 +39,7 @@ struct bi_op_props bi_opcode_props[BI_NUM_OPCODES] = {
branch = int(opcode.startswith('BRANCH'))
has_fma = int("*" + opcode in instructions)
has_add = int("+" + opcode in instructions)
is_float = int(opcode.endswith("f32") or opcode.endswith("f16"))
mods = ops[opcode]['modifiers']
clamp = hasmod(mods, 'clamp')
not_result = hasmod(mods, 'not_result')
@ -49,8 +50,8 @@ struct bi_op_props bi_opcode_props[BI_NUM_OPCODES] = {
[BI_OPCODE_${opcode.replace('.', '_').upper()}] = {
"${opcode}", BIFROST_MESSAGE_${message}, BI_SIZE_${size},
BI_SR_COUNT_${sr_count}, ${sr_read}, ${sr_write}, ${last}, ${branch},
${table}, ${has_fma}, ${has_add}, ${clamp}, ${not_result}, ${abs},
${neg}, ${m_not},
${table}, ${has_fma}, ${has_add}, ${is_float}, ${clamp}, ${not_result},
${abs}, ${neg}, ${m_not},
},
% endfor
};"""

View file

@ -89,6 +89,7 @@ struct bi_op_props {
bool table : 1;
bool fma : 1;
bool add : 1;
bool is_float : 1;
/* Supported propagable modifiers */
bool clamp : 1;

View file

@ -1019,13 +1019,7 @@ bi_write_count(bi_instr *instr, uint64_t live_after_temp)
return count;
}
/*
* Test if an instruction requires a specific flush-to-zero mode.
*
* This could be optimized to allow pairing integer instructions with
* instructions with differently-sized float instructions regardless of float
* controls, but punting on this until we have a workload that cares.
*/
/* Test if an instruction requires a specific flush-to-zero mode. */
static enum bi_ftz_state
bi_instr_ftz(bi_instr *I)
{
@ -1033,8 +1027,12 @@ bi_instr_ftz(bi_instr *I)
if ((I->op == BI_OPCODE_F16_TO_F32 || I->op == BI_OPCODE_V2F32_TO_V2F16) &&
I->ftz)
return BI_FTZ_STATE_ENABLE;
else
return BI_FTZ_STATE_DISABLE;
struct bi_op_props props = bi_opcode_props[I->op];
if (!props.is_float)
return BI_FTZ_STATE_NONE;
return BI_FTZ_STATE_DISABLE;
}
/*