diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-10-16 12:24:28 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-10-20 12:02:31 +0000 |
commit | d079631248c81e8b82b5deb8a4559e84f1a7893a (patch) | |
tree | 9d9564e648a3fc634a78b877a415967f2c131e66 /src/panfrost/midgard/compiler.h | |
parent | e981b69484ce6b60d3d0f886fef1af74c0ceb20c (diff) |
pan/midgard: Add helpers for manipulating byte masks
There are essentially two formats of masks in play beginning with this
commit: masks per-channel and masks per-byte. The former make sense
within a given fixed-size instruction; the latter are
typesize-independent. It turns out you need the latter to meaningfully
manipulate instructions containing multiple sizes (which is quite
possible with ALU operations).
Similarly, we have mir_srcsize. We calculate the size of the source by
analyzing the size of the instruction itself and stepping down if there
is a half-modifier.
Finally, we have mir_round_bytemask_down, for when we want to take a
byte mask and "round it down" to a given component size, so that we can
use it as a component mask.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/compiler.h')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 508f7fd3d18..4b51aabb096 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -514,6 +514,10 @@ unsigned mir_use_count(compiler_context *ctx, unsigned value); bool mir_is_written_before(compiler_context *ctx, midgard_instruction *ins, unsigned node); unsigned mir_mask_of_read_components(midgard_instruction *ins, unsigned node); unsigned mir_ubo_shift(midgard_load_store_op op); +midgard_reg_mode mir_typesize(midgard_instruction *ins); +uint16_t mir_from_bytemask(uint16_t bytemask, midgard_reg_mode mode); +uint16_t mir_bytemask(midgard_instruction *ins); +uint16_t mir_round_bytemask_down(uint16_t mask, midgard_reg_mode mode); /* MIR printing */ |