pan/bi: Model offset for LOAD/STORE

Needed to model the immediate offset on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
This commit is contained in:
Alyssa Rosenzweig 2021-12-12 16:17:14 -05:00 committed by Marge Bot
parent 039bb4e68c
commit 5796777889
5 changed files with 25 additions and 7 deletions

View file

@ -7085,6 +7085,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+LOAD.i16" staging="w=1" message="load">
@ -7144,6 +7145,7 @@
<eq left="extend" right="#zext"/>
</derived>
</encoding>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+LOAD.i24" staging="w=1" mask="0xffe00" exact="0x65000" message="load">
@ -7159,6 +7161,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+LOAD.i32" staging="w=1" message="load">
@ -7196,6 +7199,7 @@
<eq left="extend" right="#zext"/>
</derived>
</encoding>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+LOAD.i48" staging="w=2" mask="0xffe00" exact="0x65200" message="load">
@ -7211,6 +7215,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+LOAD.i64" staging="w=2" mask="0xffe00" exact="0x60e00" message="load">
@ -7226,6 +7231,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+LOAD.i8" staging="w=1" message="load">
@ -7310,6 +7316,7 @@
<eq left="extend" right="#zext"/>
</derived>
</encoding>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+LOAD.i96" staging="w=3" mask="0xffe00" exact="0x65400" message="load">
@ -7325,6 +7332,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+LOGB.f32" mask="0xfffe0" exact="0x3d9a0">
@ -7539,6 +7547,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+STORE.i16" staging="r=1" mask="0xffe00" exact="0x62800" message="store" dests="0">
@ -7554,6 +7563,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+STORE.i24" staging="r=1" mask="0xffe00" exact="0x65800" message="store" dests="0">
@ -7569,6 +7579,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+STORE.i32" staging="r=1" mask="0xffe00" exact="0x62c00" message="store" dests="0">
@ -7584,6 +7595,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+STORE.i48" staging="r=2" mask="0xffe00" exact="0x65a00" message="store" dests="0">
@ -7599,6 +7611,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+STORE.i64" staging="r=2" mask="0xffe00" exact="0x62e00" message="store" dests="0">
@ -7614,6 +7627,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+STORE.i8" staging="r=1" mask="0xffe00" exact="0x62000" message="store" dests="0">
@ -7629,6 +7643,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+STORE.i96" staging="r=3" mask="0xffe00" exact="0x65c00" message="store" dests="0">
@ -7644,6 +7659,7 @@
<reserved/>
<opt>tl</opt>
</mod>
<immediate name="byte_offset" size="16" pseudo="true"/>
</ins>
<ins name="+ST_CVT" staging="r=format" mask="0xff800" exact="0xc9800" message="store" dests="0">

View file

@ -492,7 +492,7 @@ bi_spill_register(bi_context *ctx, bi_index index, uint32_t offset)
b.cursor = bi_after_instr(I);
bi_index loc = bi_imm_u32(offset + 4 * extra);
bi_store(&b, bits, tmp, loc, bi_zero(), BI_SEG_TL);
bi_store(&b, bits, tmp, loc, bi_zero(), BI_SEG_TL, 0);
ctx->spills++;
channels = MAX2(channels, extra + count);
@ -506,7 +506,8 @@ bi_spill_register(bi_context *ctx, bi_index index, uint32_t offset)
bi_rewrite_index_src_single(I, index, tmp);
bi_instr *ld = bi_load_to(&b, bits, tmp,
bi_imm_u32(offset), bi_zero(), BI_SEG_TL);
bi_imm_u32(offset), bi_zero(), BI_SEG_TL,
0);
ld->no_spill = true;
ctx->fills++;
}

View file

@ -423,7 +423,7 @@ bi_load_sysval_to(bi_builder *b, bi_index dest, int sysval,
return bi_load_to(b, nr_components * 32, dest,
bi_imm_u32(idx),
bi_imm_u32(sysval_ubo), BI_SEG_UBO);
bi_imm_u32(sysval_ubo), BI_SEG_UBO, 0);
}
static void
@ -792,7 +792,7 @@ bi_emit_load_ubo(bi_builder *b, nir_intrinsic_instr *instr)
bi_dest_index(&instr->dest), offset_is_const ?
bi_imm_u32(const_offset) : dyn_offset,
kernel_input ? bi_zero() : bi_src_index(&instr->src[0]),
BI_SEG_UBO);
BI_SEG_UBO, 0);
}
static bi_index
@ -808,7 +808,7 @@ bi_emit_load(bi_builder *b, nir_intrinsic_instr *instr, enum bi_seg seg)
bi_load_to(b, instr->num_components * nir_dest_bit_size(instr->dest),
bi_dest_index(&instr->dest),
bi_src_index(&instr->src[0]), bi_addr_high(&instr->src[0]),
seg);
seg, 0);
}
static void
@ -821,7 +821,7 @@ bi_emit_store(bi_builder *b, nir_intrinsic_instr *instr, enum bi_seg seg)
bi_store(b, instr->num_components * nir_src_bit_size(instr->src[0]),
bi_src_index(&instr->src[0]),
bi_src_index(&instr->src[1]), bi_addr_high(&instr->src[1]),
seg);
seg, 0);
}
/* Exchanges the staging register with memory */

View file

@ -428,6 +428,7 @@ typedef struct {
uint32_t fill;
uint32_t index;
uint32_t attribute_index;
int32_t byte_offset;
int32_t branch_offset;
struct {

View file

@ -69,7 +69,7 @@ TEST_F(SchedulerPredicates, FMA)
TEST_F(SchedulerPredicates, LOAD)
{
bi_instr *load = bi_load_i128_to(b, TMP(), TMP(), TMP(), BI_SEG_UBO);
bi_instr *load = bi_load_i128_to(b, TMP(), TMP(), TMP(), BI_SEG_UBO, 0);
ASSERT_FALSE(bi_can_fma(load));
ASSERT_TRUE(bi_can_add(load));
ASSERT_TRUE(bi_must_message(load));