mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-26 20:36:16 +00:00
shader_recompiler: Implement FREXP instructions. (#1766)
This commit is contained in:
parent
722a0e36be
commit
f1c23d514b
10 changed files with 119 additions and 8 deletions
|
@ -200,6 +200,11 @@ public:
|
|||
void V_BFREV_B32(const GcnInst& inst);
|
||||
void V_FFBH_U32(const GcnInst& inst);
|
||||
void V_FFBL_B32(const GcnInst& inst);
|
||||
void V_FREXP_EXP_I32_F64(const GcnInst& inst);
|
||||
void V_FREXP_MANT_F64(const GcnInst& inst);
|
||||
void V_FRACT_F64(const GcnInst& inst);
|
||||
void V_FREXP_EXP_I32_F32(const GcnInst& inst);
|
||||
void V_FREXP_MANT_F32(const GcnInst& inst);
|
||||
void V_MOVRELD_B32(const GcnInst& inst);
|
||||
void V_MOVRELS_B32(const GcnInst& inst);
|
||||
void V_MOVRELSD_B32(const GcnInst& inst);
|
||||
|
|
|
@ -179,6 +179,16 @@ void Translator::EmitVectorAlu(const GcnInst& inst) {
|
|||
return V_FFBH_U32(inst);
|
||||
case Opcode::V_FFBL_B32:
|
||||
return V_FFBL_B32(inst);
|
||||
case Opcode::V_FREXP_EXP_I32_F64:
|
||||
return V_FREXP_EXP_I32_F64(inst);
|
||||
case Opcode::V_FREXP_MANT_F64:
|
||||
return V_FREXP_MANT_F64(inst);
|
||||
case Opcode::V_FRACT_F64:
|
||||
return V_FRACT_F64(inst);
|
||||
case Opcode::V_FREXP_EXP_I32_F32:
|
||||
return V_FREXP_EXP_I32_F32(inst);
|
||||
case Opcode::V_FREXP_MANT_F32:
|
||||
return V_FREXP_MANT_F32(inst);
|
||||
case Opcode::V_MOVRELD_B32:
|
||||
return V_MOVRELD_B32(inst);
|
||||
case Opcode::V_MOVRELS_B32:
|
||||
|
@ -733,7 +743,7 @@ void Translator::V_CVT_F32_UBYTE(u32 index, const GcnInst& inst) {
|
|||
|
||||
void Translator::V_FRACT_F32(const GcnInst& inst) {
|
||||
const IR::F32 src0{GetSrc<IR::F32>(inst.src[0])};
|
||||
SetDst(inst.dst[0], ir.Fract(src0));
|
||||
SetDst(inst.dst[0], ir.FPFract(src0));
|
||||
}
|
||||
|
||||
void Translator::V_TRUNC_F32(const GcnInst& inst) {
|
||||
|
@ -822,6 +832,31 @@ void Translator::V_FFBL_B32(const GcnInst& inst) {
|
|||
SetDst(inst.dst[0], ir.FindILsb(src0));
|
||||
}
|
||||
|
||||
void Translator::V_FREXP_EXP_I32_F64(const GcnInst& inst) {
|
||||
const IR::F64 src0{GetSrc64<IR::F64>(inst.src[0])};
|
||||
SetDst(inst.dst[0], ir.FPFrexpExp(src0));
|
||||
}
|
||||
|
||||
void Translator::V_FREXP_MANT_F64(const GcnInst& inst) {
|
||||
const IR::F64 src0{GetSrc64<IR::F64>(inst.src[0])};
|
||||
SetDst64(inst.dst[0], ir.FPFrexpSig(src0));
|
||||
}
|
||||
|
||||
void Translator::V_FRACT_F64(const GcnInst& inst) {
|
||||
const IR::F32 src0{GetSrc64<IR::F64>(inst.src[0])};
|
||||
SetDst64(inst.dst[0], ir.FPFract(src0));
|
||||
}
|
||||
|
||||
void Translator::V_FREXP_EXP_I32_F32(const GcnInst& inst) {
|
||||
const IR::F32 src0{GetSrc<IR::F32>(inst.src[0])};
|
||||
SetDst(inst.dst[0], ir.FPFrexpExp(src0));
|
||||
}
|
||||
|
||||
void Translator::V_FREXP_MANT_F32(const GcnInst& inst) {
|
||||
const IR::F32 src0{GetSrc<IR::F32>(inst.src[0])};
|
||||
SetDst(inst.dst[0], ir.FPFrexpSig(src0));
|
||||
}
|
||||
|
||||
void Translator::V_MOVRELD_B32(const GcnInst& inst) {
|
||||
const IR::U32 src_val{GetSrc(inst.src[0])};
|
||||
u32 dst_vgprno = inst.dst[0].code - static_cast<u32>(IR::VectorReg::V0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue