mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-09 21:31:04 +00:00
Render.Recompiler: Implement V_FLOOR_F64 (#3828)
* VectorFpRound64 decode table Also fixed definition for V_TRUNC_F64, though I doubt that would change anything important. * V_FLOOR_F64 implementation Used by Just Cause 4 * Oops Never forget your 64s
This commit is contained in:
@@ -1837,11 +1837,17 @@ constexpr std::array<InstFormat, 71> InstructionFormatVOP1 = {{
|
||||
// 22 = V_CVT_F64_U32
|
||||
{InstClass::VectorConv, InstCategory::VectorALU, 1, 1, ScalarType::Uint32, ScalarType::Float64},
|
||||
// 23 = V_TRUNC_F64
|
||||
{InstClass::VectorConv, InstCategory::VectorALU, 1, 1, ScalarType::Float64,
|
||||
{InstClass::VectorFpRound64, InstCategory::VectorALU, 1, 1, ScalarType::Float64,
|
||||
ScalarType::Float64},
|
||||
// 24 = V_CEIL_F64
|
||||
{InstClass::VectorFpRound64, InstCategory::VectorALU, 1, 1, ScalarType::Float64,
|
||||
ScalarType::Float64},
|
||||
// 25 = V_RNDNE_F64
|
||||
{InstClass::VectorFpRound64, InstCategory::VectorALU, 1, 1, ScalarType::Float64,
|
||||
ScalarType::Float64},
|
||||
// 26 = V_FLOOR_F64
|
||||
{InstClass::VectorFpRound64, InstCategory::VectorALU, 1, 1, ScalarType::Float64,
|
||||
ScalarType::Float64},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
|
||||
@@ -201,6 +201,7 @@ public:
|
||||
void V_CVT_F32_F64(const GcnInst& inst);
|
||||
void V_CVT_F64_F32(const GcnInst& inst);
|
||||
void V_CVT_F32_UBYTE(u32 index, const GcnInst& inst);
|
||||
void V_FLOOR_F64(const GcnInst& inst);
|
||||
void V_FRACT_F32(const GcnInst& inst);
|
||||
void V_TRUNC_F32(const GcnInst& inst);
|
||||
void V_CEIL_F32(const GcnInst& inst);
|
||||
|
||||
@@ -142,6 +142,8 @@ void Translator::EmitVectorAlu(const GcnInst& inst) {
|
||||
return V_CVT_F32_UBYTE(2, inst);
|
||||
case Opcode::V_CVT_F32_UBYTE3:
|
||||
return V_CVT_F32_UBYTE(3, inst);
|
||||
case Opcode::V_FLOOR_F64:
|
||||
return V_FLOOR_F64(inst);
|
||||
case Opcode::V_FRACT_F32:
|
||||
return V_FRACT_F32(inst);
|
||||
case Opcode::V_TRUNC_F32:
|
||||
@@ -806,6 +808,11 @@ void Translator::V_CVT_F32_UBYTE(u32 index, const GcnInst& inst) {
|
||||
SetDst(inst.dst[0], ir.ConvertUToF(32, 32, byte));
|
||||
}
|
||||
|
||||
void Translator::V_FLOOR_F64(const GcnInst& inst) {
|
||||
const IR::F64 src0{GetSrc64<IR::F64>(inst.src[0])};
|
||||
SetDst64(inst.dst[0], ir.FPFloor(src0));
|
||||
}
|
||||
|
||||
void Translator::V_FRACT_F32(const GcnInst& inst) {
|
||||
const IR::F32 src0{GetSrc<IR::F32>(inst.src[0])};
|
||||
SetDst(inst.dst[0], ir.FPFract(src0));
|
||||
|
||||
Reference in New Issue
Block a user