mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-25 21:03:18 +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
|
@ -869,8 +869,37 @@ F32F64 IREmitter::FPTrunc(const F32F64& value) {
|
|||
}
|
||||
}
|
||||
|
||||
F32 IREmitter::Fract(const F32& value) {
|
||||
return Inst<F32>(Opcode::FPFract, value);
|
||||
F32F64 IREmitter::FPFract(const F32F64& value) {
|
||||
switch (value.Type()) {
|
||||
case Type::F32:
|
||||
return Inst<F32>(Opcode::FPFract32, value);
|
||||
case Type::F64:
|
||||
return Inst<F64>(Opcode::FPFract64, value);
|
||||
default:
|
||||
ThrowInvalidType(value.Type());
|
||||
}
|
||||
}
|
||||
|
||||
F32F64 IREmitter::FPFrexpSig(const F32F64& value) {
|
||||
switch (value.Type()) {
|
||||
case Type::F32:
|
||||
return Inst<F32>(Opcode::FPFrexpSig32, value);
|
||||
case Type::F64:
|
||||
return Inst<F64>(Opcode::FPFrexpSig64, value);
|
||||
default:
|
||||
ThrowInvalidType(value.Type());
|
||||
}
|
||||
}
|
||||
|
||||
U32 IREmitter::FPFrexpExp(const F32F64& value) {
|
||||
switch (value.Type()) {
|
||||
case Type::F32:
|
||||
return Inst<U32>(Opcode::FPFrexpExp32, value);
|
||||
case Type::F64:
|
||||
return Inst<U32>(Opcode::FPFrexpExp64, value);
|
||||
default:
|
||||
ThrowInvalidType(value.Type());
|
||||
}
|
||||
}
|
||||
|
||||
U1 IREmitter::FPEqual(const F32F64& lhs, const F32F64& rhs, bool ordered) {
|
||||
|
|
|
@ -180,7 +180,9 @@ public:
|
|||
[[nodiscard]] F32F64 FPFloor(const F32F64& value);
|
||||
[[nodiscard]] F32F64 FPCeil(const F32F64& value);
|
||||
[[nodiscard]] F32F64 FPTrunc(const F32F64& value);
|
||||
[[nodiscard]] F32 Fract(const F32& value);
|
||||
[[nodiscard]] F32F64 FPFract(const F32F64& value);
|
||||
[[nodiscard]] F32F64 FPFrexpSig(const F32F64& value);
|
||||
[[nodiscard]] U32 FPFrexpExp(const F32F64& value);
|
||||
|
||||
[[nodiscard]] U1 FPEqual(const F32F64& lhs, const F32F64& rhs, bool ordered = true);
|
||||
[[nodiscard]] U1 FPNotEqual(const F32F64& lhs, const F32F64& rhs, bool ordered = true);
|
||||
|
|
|
@ -210,7 +210,12 @@ OPCODE(FPCeil32, F32, F32,
|
|||
OPCODE(FPCeil64, F64, F64, )
|
||||
OPCODE(FPTrunc32, F32, F32, )
|
||||
OPCODE(FPTrunc64, F64, F64, )
|
||||
OPCODE(FPFract, F32, F32, )
|
||||
OPCODE(FPFract32, F32, F32, )
|
||||
OPCODE(FPFract64, F64, F64, )
|
||||
OPCODE(FPFrexpSig32, F32, F32, )
|
||||
OPCODE(FPFrexpSig64, F64, F64, )
|
||||
OPCODE(FPFrexpExp32, U32, F32, )
|
||||
OPCODE(FPFrexpExp64, U32, F64, )
|
||||
|
||||
OPCODE(FPOrdEqual32, U1, F32, F32, )
|
||||
OPCODE(FPOrdEqual64, U1, F64, F64, )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue