diff options
author | Boris Brezillon <[email protected]> | 2020-01-20 15:00:57 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-22 15:31:28 +0000 |
commit | 15c92d158cad000b12cbed7f9c3a8248e8c99aee (patch) | |
tree | 5f157c21c99bb5da7dac76da798ab21936badf2f /src/panfrost/midgard/compiler.h | |
parent | 63461cb7e13fa544a081414b8a0a6e69e66e90d0 (diff) |
panfrost/midgard: Use a union to manipulate embedded constants
Each instruction bundle can contain up to 16 constant bytes. The meaning
of those byte is instruction dependent: it depends on the instruction
native type (int, uint or float) and the instruction reg_mode (8, 16, 32
or 64 bit). Those different layouts can be exposed as a union to
facilitate constants manipulation.
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3478>
Diffstat (limited to 'src/panfrost/midgard/compiler.h')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index ab9cc819ef6..ef89589ced6 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -103,7 +103,7 @@ typedef struct midgard_instruction { int unit; bool has_constants; - uint32_t constants[4]; + midgard_constants constants; uint16_t inline_constant; bool has_blend_constant; bool has_inline_constant; @@ -217,7 +217,7 @@ typedef struct midgard_bundle { int padding; int control; bool has_embedded_constants; - float constants[4]; + midgard_constants constants; bool has_blend_constant; bool last_writeout; } midgard_bundle; @@ -616,7 +616,7 @@ v_load_store_scratch( .no_spill = (1 << REG_CLASS_WORK) }; - ins.constants[0] = byte; + ins.constants.u32[0] = byte; if (is_store) { ins.src[0] = srcdest; |