mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-17 17:50:29 +01:00
agx: Define p_extract for type converts
Useful for grabbing the high 32-bit word of a 64-bit value. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12053>
This commit is contained in:
parent
3417ecb4d7
commit
96c98e0d25
1 changed files with 2 additions and 2 deletions
|
|
@ -200,8 +200,8 @@ agx_ra(agx_context *ctx)
|
|||
agx_remove_instruction(ins);
|
||||
continue;
|
||||
} else if (ins->op == AGX_OPCODE_P_EXTRACT) {
|
||||
/* Uses the destination size */
|
||||
assert(ins->dest[0].type == AGX_INDEX_NORMAL);
|
||||
assert(ins->dest[0].size == ins->src[0].size);
|
||||
unsigned base = ins->src[0].value;
|
||||
|
||||
if (ins->src[0].type != AGX_INDEX_REGISTER) {
|
||||
|
|
@ -209,7 +209,7 @@ agx_ra(agx_context *ctx)
|
|||
base = alloc[base];
|
||||
}
|
||||
|
||||
unsigned size = ins->dest[0].size == AGX_SIZE_32 ? 2 : 1;
|
||||
unsigned size = ins->dest[0].size == AGX_SIZE_64 ? 4 : ins->dest[0].size == AGX_SIZE_32 ? 2 : 1;
|
||||
unsigned left = ssa_to_reg[ins->dest[0].value];
|
||||
unsigned right = ssa_to_reg[ins->src[0].value] + (size * ins->imm);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue