diff --git a/src/panfrost/compiler/bi_opcodes.c.py b/src/panfrost/compiler/bi_opcodes.c.py index 034ee2c60cb..9be94aeebdb 100644 --- a/src/panfrost/compiler/bi_opcodes.c.py +++ b/src/panfrost/compiler/bi_opcodes.c.py @@ -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 };""" diff --git a/src/panfrost/compiler/bi_opcodes.h.py b/src/panfrost/compiler/bi_opcodes.h.py index 1f74331f972..c2cb73734d4 100644 --- a/src/panfrost/compiler/bi_opcodes.h.py +++ b/src/panfrost/compiler/bi_opcodes.h.py @@ -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; diff --git a/src/panfrost/compiler/bifrost/bi_schedule.c b/src/panfrost/compiler/bifrost/bi_schedule.c index e54ed6770d3..ed6514de317 100644 --- a/src/panfrost/compiler/bifrost/bi_schedule.c +++ b/src/panfrost/compiler/bifrost/bi_schedule.c @@ -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; } /*