shader_recompiler/frontend: Implement opcodes (#289)

`S_ASHR_I32` and `BUFFER_LOAD_DWORD`.
This commit is contained in:
Daniel R 2024-07-13 11:37:25 +02:00 committed by GitHub
parent a75851f7e2
commit 83c8204d23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -193,6 +193,14 @@ void Translator::S_AND_B32(const GcnInst& inst) {
ir.SetScc(ir.INotEqual(result, ir.Imm32(0)));
}
void Translator::S_ASHR_I32(const GcnInst& inst) {
const IR::U32 src0{GetSrc(inst.src[0])};
const IR::U32 src1{GetSrc(inst.src[1])};
const IR::U32 result{ir.ShiftRightArithmetic(src0, src1)};
SetDst(inst.dst[0], result);
ir.SetScc(ir.INotEqual(result, ir.Imm32(0)));
}
void Translator::S_OR_B32(const GcnInst& inst) {
const IR::U32 src0{GetSrc(inst.src[0])};
const IR::U32 src1{GetSrc(inst.src[1])};

View File

@ -573,6 +573,7 @@ void Translate(IR::Block* block, u32 block_base, std::span<const GcnInst> inst_l
translator.BUFFER_LOAD_FORMAT(4, true, inst);
break;
case Opcode::BUFFER_LOAD_FORMAT_X:
case Opcode::BUFFER_LOAD_DWORD:
translator.BUFFER_LOAD_FORMAT(1, false, inst);
break;
case Opcode::BUFFER_LOAD_FORMAT_XYZ:
@ -818,6 +819,9 @@ void Translate(IR::Block* block, u32 block_base, std::span<const GcnInst> inst_l
case Opcode::S_AND_B32:
translator.S_AND_B32(inst);
break;
case Opcode::S_ASHR_I32:
translator.S_ASHR_I32(inst);
break;
case Opcode::S_OR_B32:
translator.S_OR_B32(inst);
break;

View File

@ -69,6 +69,7 @@ public:
void S_AND_B64(NegateMode negate, const GcnInst& inst);
void S_ADD_I32(const GcnInst& inst);
void S_AND_B32(const GcnInst& inst);
void S_ASHR_I32(const GcnInst& inst);
void S_OR_B32(const GcnInst& inst);
void S_LSHR_B32(const GcnInst& inst);
void S_CSELECT_B32(const GcnInst& inst);