nv50/ir: fix emission of ld/st lock/unlock

This is necessary to implement shared atomics.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>
This commit is contained in:
Ilia Mirkin 2021-03-01 18:59:27 -05:00
parent d0fa6e066b
commit 0dfc5b5196

View file

@ -644,6 +644,9 @@ CodeEmitterNV50::emitLOAD(const Instruction *i)
code[1] |= 0x04000000;
emitLoadStoreSizeCS(i->sType);
if (i->subOp == NV50_IR_SUBOP_LOAD_LOCKED)
code[1] |= 0x00800000;
} else {
assert(offset <= (int32_t)(0x1f * typeSizeof(i->sType)));
code[0] = 0x10000001;
@ -714,6 +717,8 @@ CodeEmitterNV50::emitSTORE(const Instruction *i)
case FILE_MEMORY_SHARED:
code[0] = 0x00000001;
code[1] = 0xe0000000;
if (i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED)
code[1] |= 0x00800000;
switch (typeSizeof(i->dType)) {
case 1:
code[0] |= offset << 9;