On Fri Jul 7 02:54:01 2023 +0000, Francisco Casas wrote:
I thought on including the following change but didn't because, if I remember correctly, last time we agreed on not doing it. It may make more sense now though. My opinion is that we should include all the fields that are exclusive to both sm4_dst_register and sm4_src_register within struct sm4_register, namely:
unsigned int writemask; enum vkd3d_sm4_swizzle_type swizzle_type; unsigned int swizzle;
even if they are not used when the register is src or dst. This would save us from passing them as arguments every time, which also adds complexity when these are register used as indexes of a struct sm4_xregister. Also, this would also allows us to define struct sm4_xregister simply as:
struct sm4_xregister { struct sm4_register r; /* Relative addressing to be added to the constant offsets in r.idx[·]. */ bool idx_has_reg[3]; struct sm4_register idx_reg[3]; };
and use it directly for the dsts[] and srcs[] fields of struct sm4_instruction.
This comment is superseded by the proposal in !269 .