diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-29 09:15:32 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-31 09:39:16 -0700 |
commit | 13ee87c8b99e045d8610bf801f2f15544ca4f430 (patch) | |
tree | bd7d39a439ef9bb2767fb0b29e961a072c698715 /src/panfrost/midgard/midgard.h | |
parent | 2037478702adab5a3863a120be821626191b2e3e (diff) |
pan/midgard: Document branch combination LUT
This took way longer to figure out than it should have..
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/midgard.h')
-rw-r--r-- | src/panfrost/midgard/midgard.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/panfrost/midgard/midgard.h b/src/panfrost/midgard/midgard.h index d0e15ce86d1..6473809d10a 100644 --- a/src/panfrost/midgard/midgard.h +++ b/src/panfrost/midgard/midgard.h @@ -359,6 +359,19 @@ __attribute__((__packed__)) unsigned dest_tag : 4; /* tag of branch destination */ unsigned unknown : 2; signed offset : 23; + + /* Extended branches permit inputting up to 4 conditions loaded into + * r31 (two in r31.w and two in r31.x). In the most general case, we + * specify a function f(A, B, C, D) mapping 4 1-bit conditions to a + * single 1-bit branch criteria. Note that the domain of f has 2^(2^4) + * elements, each mapping to 1-bit of output, so we can trivially + * construct a Godel numbering of f as a (2^4)=16-bit integer. This + * 16-bit integer serves as a lookup table to compute f, subject to + * some swaps for ordering. + * + * Interesting, the standard 2-bit condition codes are also a LUT with + * the same format (2^1-bit), but it's usually easier to use enums. */ + unsigned cond : 16; } midgard_branch_extended; |