mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-23 15:25:45 +00:00
Sign-extend shader memory instruction offsets (#934)
This commit is contained in:
parent
416ddd0f6e
commit
5a9dba0756
4 changed files with 6 additions and 6 deletions
|
@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||||
Rd = new Register(opCode.Extract(0, 8), RegisterType.Gpr);
|
Rd = new Register(opCode.Extract(0, 8), RegisterType.Gpr);
|
||||||
Ra = new Register(opCode.Extract(8, 8), RegisterType.Gpr);
|
Ra = new Register(opCode.Extract(8, 8), RegisterType.Gpr);
|
||||||
|
|
||||||
Offset = opCode.Extract(22, 14);
|
Offset = (opCode.Extract(20, 16) << 16) >> 16;
|
||||||
Slot = opCode.Extract(36, 5);
|
Slot = opCode.Extract(36, 5);
|
||||||
|
|
||||||
Size = (IntegerSize)opCode.Extract(48, 3);
|
Size = (IntegerSize)opCode.Extract(48, 3);
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||||
Rd = new Register(opCode.Extract(0, 8), RegisterType.Gpr);
|
Rd = new Register(opCode.Extract(0, 8), RegisterType.Gpr);
|
||||||
Ra = new Register(opCode.Extract(8, 8), RegisterType.Gpr);
|
Ra = new Register(opCode.Extract(8, 8), RegisterType.Gpr);
|
||||||
|
|
||||||
Offset = opCode.Extract(20, 24);
|
Offset = (opCode.Extract(20, 24) << 8) >> 8;
|
||||||
|
|
||||||
Extended = opCode.Extract(45);
|
Extended = opCode.Extract(45);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||||
|
|
||||||
AtomicOp = (AtomicOp)opCode.Extract(23, 3);
|
AtomicOp = (AtomicOp)opCode.Extract(23, 3);
|
||||||
|
|
||||||
Offset = opCode.Extract(28, 20);
|
Offset = (opCode.Extract(28, 20) << 12) >> 12;
|
||||||
|
|
||||||
Extended = opCode.Extract(48);
|
Extended = opCode.Extract(48);
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,11 +138,11 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
|
|
||||||
int count = op.Size == IntegerSize.B64 ? 2 : 1;
|
int count = op.Size == IntegerSize.B64 ? 2 : 1;
|
||||||
|
|
||||||
Operand wordOffset = context.ShiftRightU32(GetSrcA(context), Const(2));
|
Operand addr = context.IAdd(GetSrcA(context), Const(op.Offset));
|
||||||
|
|
||||||
wordOffset = context.IAdd(wordOffset, Const(op.Offset));
|
Operand wordOffset = context.ShiftRightU32(addr, Const(2));
|
||||||
|
|
||||||
Operand bitOffset = GetBitOffset(context, GetSrcA(context));
|
Operand bitOffset = GetBitOffset(context, addr);
|
||||||
|
|
||||||
for (int index = 0; index < count; index++)
|
for (int index = 0; index < count; index++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue