mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
pan/bi: Hook up cube instructions packing
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7408>
This commit is contained in:
parent
0ed8eee706
commit
f76558be65
3 changed files with 29 additions and 0 deletions
|
|
@ -393,6 +393,17 @@ bi_pack_registers(bi_registers regs)
|
|||
return packed;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
bi_pack_fma_special(bi_clause *clause, bi_instruction *ins, bi_registers *regs)
|
||||
{
|
||||
switch (ins->op.special) {
|
||||
case BI_SPECIAL_CUBEFACE1:
|
||||
return pan_pack_fma_cubeface1(clause, ins, regs);
|
||||
default:
|
||||
unreachable("Unknown special op");
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned
|
||||
bi_pack_fma(bi_clause *clause, bi_bundle bundle, bi_registers *regs)
|
||||
{
|
||||
|
|
@ -575,6 +586,8 @@ bi_pack_fma(bi_clause *clause, bi_bundle bundle, bi_registers *regs)
|
|||
return pan_pack_fma_fadd_lscale_f32(clause, bundle.fma, regs);
|
||||
case BI_IMUL:
|
||||
return pan_pack_fma_imul_i32(clause, bundle.fma, regs);
|
||||
case BI_SPECIAL_FMA:
|
||||
return bi_pack_fma_special(clause, bundle.fma, regs);
|
||||
default:
|
||||
unreachable("Cannot encode class as FMA");
|
||||
}
|
||||
|
|
@ -675,6 +688,12 @@ bi_pack_add_special(bi_clause *clause, bi_instruction *ins, bi_registers *regs)
|
|||
case BI_SPECIAL_IABS:
|
||||
assert(ins->src_types[0] == nir_type_int32);
|
||||
return pan_pack_add_iabs_s32(clause, ins, regs);
|
||||
case BI_SPECIAL_CUBEFACE2:
|
||||
return pan_pack_add_cubeface2(clause, ins, regs);
|
||||
case BI_SPECIAL_CUBE_SSEL:
|
||||
return pan_pack_add_cube_ssel(clause, ins, regs);
|
||||
case BI_SPECIAL_CUBE_TSEL:
|
||||
return pan_pack_add_cube_tsel(clause, ins, regs);
|
||||
default:
|
||||
unreachable("Unknown special op");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,6 +191,10 @@ bi_special_op_name(enum bi_special_op op)
|
|||
case BI_SPECIAL_FRCP: return "frcp";
|
||||
case BI_SPECIAL_FRSQ: return "frsq";
|
||||
case BI_SPECIAL_EXP2_LOW: return "exp2_low";
|
||||
case BI_SPECIAL_CUBEFACE1: return "cubeface1";
|
||||
case BI_SPECIAL_CUBEFACE2: return "cubeface2";
|
||||
case BI_SPECIAL_CUBE_SSEL: return "cube_ssel";
|
||||
case BI_SPECIAL_CUBE_TSEL: return "cube_tsel";
|
||||
default: return "invalid";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,6 +233,12 @@ enum bi_special_op {
|
|||
* the second, it takes x itself. */
|
||||
BI_SPECIAL_EXP2_LOW,
|
||||
BI_SPECIAL_IABS,
|
||||
|
||||
/* cubemap coordinates extraction helpers */
|
||||
BI_SPECIAL_CUBEFACE1,
|
||||
BI_SPECIAL_CUBEFACE2,
|
||||
BI_SPECIAL_CUBE_SSEL,
|
||||
BI_SPECIAL_CUBE_TSEL,
|
||||
};
|
||||
|
||||
struct bi_bitwise {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue