freedreno/isa: add store_instruction(..)

Makes it possible to store an encoded instruction in a
generic ISA specific way.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
This commit is contained in:
Christian Gmeiner 2021-07-22 19:03:40 +02:00 committed by Marge Bot
parent a5bbd08775
commit a6b82d1c8c
1 changed files with 8 additions and 0 deletions

View File

@ -358,6 +358,14 @@ uint64_t_to_bitmask(uint64_t val)
return mask;
}
static inline void
store_instruction(BITSET_WORD *dst, bitmask_t instr)
{
% for i in range(0, int(isa.bitsize / 32)):
*(dst + ${i}) = instr.bitset[${i}];
% endfor
}
/**
* Opaque type from the PoV of generated code, but allows state to be passed
* thru to the hand written helpers used by the generated code.