aco/ir: Add integer get_cmp_info.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
This commit is contained in:
Georg Lehmann 2022-07-27 12:03:22 +02:00 committed by Marge Bot
parent 590b93ae65
commit 9c727b958e
1 changed files with 22 additions and 0 deletions

View File

@ -616,6 +616,7 @@ get_cmp_info(aco_opcode op, CmpInfo* info)
info->ordered = aco_opcode::num_opcodes;
info->unordered = aco_opcode::num_opcodes;
info->swapped = aco_opcode::num_opcodes;
info->f32 = aco_opcode::num_opcodes;
switch (op) {
// clang-format off
#define CMP2(ord, unord, ord_swap, unord_swap, sz) \
@ -658,6 +659,27 @@ get_cmp_info(aco_opcode op, CmpInfo* info)
ORD_TEST(32)
ORD_TEST(64)
#undef ORD_TEST
#define CMPI2(op, swap, inv, type, sz) \
case aco_opcode::v_cmp_##op##_##type##sz: \
info->swapped = aco_opcode::v_cmp_##swap##_##type##sz; \
info->inverse = aco_opcode::v_cmp_##inv##_##type##sz; \
info->size = sz; \
return true;
#define CMPI(op, swap, inv) \
CMPI2(op, swap, inv, i, 16) \
CMPI2(op, swap, inv, u, 16) \
CMPI2(op, swap, inv, i, 32) \
CMPI2(op, swap, inv, u, 32) \
CMPI2(op, swap, inv, i, 64) \
CMPI2(op, swap, inv, u, 64)
CMPI(lt, gt, ge)
CMPI(eq, eq, lg)
CMPI(le, ge, gt)
CMPI(gt, lt, le)
CMPI(lg, lg, eq)
CMPI(ge, le, lt)
#undef CMPI
#undef CMPI2
// clang-format on
default: return false;
}