shader_recompiler/frontend: Implement opcodes (#289)
`S_ASHR_I32` and `BUFFER_LOAD_DWORD`.
This commit is contained in:
parent
a75851f7e2
commit
83c8204d23
|
@ -193,6 +193,14 @@ void Translator::S_AND_B32(const GcnInst& inst) {
|
||||||
ir.SetScc(ir.INotEqual(result, ir.Imm32(0)));
|
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) {
|
void Translator::S_OR_B32(const GcnInst& inst) {
|
||||||
const IR::U32 src0{GetSrc(inst.src[0])};
|
const IR::U32 src0{GetSrc(inst.src[0])};
|
||||||
const IR::U32 src1{GetSrc(inst.src[1])};
|
const IR::U32 src1{GetSrc(inst.src[1])};
|
||||||
|
|
|
@ -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);
|
translator.BUFFER_LOAD_FORMAT(4, true, inst);
|
||||||
break;
|
break;
|
||||||
case Opcode::BUFFER_LOAD_FORMAT_X:
|
case Opcode::BUFFER_LOAD_FORMAT_X:
|
||||||
|
case Opcode::BUFFER_LOAD_DWORD:
|
||||||
translator.BUFFER_LOAD_FORMAT(1, false, inst);
|
translator.BUFFER_LOAD_FORMAT(1, false, inst);
|
||||||
break;
|
break;
|
||||||
case Opcode::BUFFER_LOAD_FORMAT_XYZ:
|
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:
|
case Opcode::S_AND_B32:
|
||||||
translator.S_AND_B32(inst);
|
translator.S_AND_B32(inst);
|
||||||
break;
|
break;
|
||||||
|
case Opcode::S_ASHR_I32:
|
||||||
|
translator.S_ASHR_I32(inst);
|
||||||
|
break;
|
||||||
case Opcode::S_OR_B32:
|
case Opcode::S_OR_B32:
|
||||||
translator.S_OR_B32(inst);
|
translator.S_OR_B32(inst);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
void S_AND_B64(NegateMode negate, const GcnInst& inst);
|
void S_AND_B64(NegateMode negate, const GcnInst& inst);
|
||||||
void S_ADD_I32(const GcnInst& inst);
|
void S_ADD_I32(const GcnInst& inst);
|
||||||
void S_AND_B32(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_OR_B32(const GcnInst& inst);
|
||||||
void S_LSHR_B32(const GcnInst& inst);
|
void S_LSHR_B32(const GcnInst& inst);
|
||||||
void S_CSELECT_B32(const GcnInst& inst);
|
void S_CSELECT_B32(const GcnInst& inst);
|
||||||
|
|
Loading…
Reference in New Issue