ir: Add opcodes for converting S64 and U64 to double-precision values

This commit is contained in:
Lioncash
2018-07-09 17:14:00 -04:00
committed by MerryMage
parent 436ca80bcd
commit 3a41465eaf
4 changed files with 49 additions and 0 deletions

View File

@@ -1476,6 +1476,11 @@ U32 IREmitter::FPS32ToSingle(const U32& a, bool round_to_nearest, bool fpscr_con
return Inst<U32>(Opcode::FPS32ToSingle, a, Imm1(round_to_nearest));
}
U64 IREmitter::FPS64ToDouble(const U64& a, bool round_to_nearest, bool fpscr_controlled) {
ASSERT(fpscr_controlled);
return Inst<U64>(Opcode::FPS64ToDouble, a, Imm1(round_to_nearest));
}
U32 IREmitter::FPU32ToSingle(const U32& a, bool round_to_nearest, bool fpscr_controlled) {
ASSERT(fpscr_controlled);
return Inst<U32>(Opcode::FPU32ToSingle, a, Imm1(round_to_nearest));
@@ -1491,6 +1496,11 @@ U64 IREmitter::FPU32ToDouble(const U32& a, bool round_to_nearest, bool fpscr_con
return Inst<U64>(Opcode::FPU32ToDouble, a, Imm1(round_to_nearest));
}
U64 IREmitter::FPU64ToDouble(const U64& a, bool round_to_nearest, bool fpscr_controlled) {
ASSERT(fpscr_controlled);
return Inst<U64>(Opcode::FPU64ToDouble, a, Imm1(round_to_nearest));
}
U128 IREmitter::FPVectorAbs(size_t esize, const U128& a) {
switch (esize) {
case 16:

View File

@@ -271,7 +271,9 @@ public:
U32 FPS32ToSingle(const U32& a, bool round_to_nearest, bool fpscr_controlled);
U32 FPU32ToSingle(const U32& a, bool round_to_nearest, bool fpscr_controlled);
U64 FPS32ToDouble(const U32& a, bool round_to_nearest, bool fpscr_controlled);
U64 FPS64ToDouble(const U64& a, bool round_to_nearest, bool fpscr_controlled);
U64 FPU32ToDouble(const U32& a, bool round_to_nearest, bool fpscr_controlled);
U64 FPU64ToDouble(const U64& a, bool round_to_nearest, bool fpscr_controlled);
U128 FPVectorAbs(size_t esize, const U128& a);
U128 FPVectorAbsoluteDifference(size_t esize, const U128& a, const U128& b);

View File

@@ -393,7 +393,9 @@ OPCODE(FPDoubleToS32, T::U32, T::U64, T::U
OPCODE(FPU32ToSingle, T::U32, T::U32, T::U1 )
OPCODE(FPS32ToSingle, T::U32, T::U32, T::U1 )
OPCODE(FPU32ToDouble, T::U64, T::U32, T::U1 )
OPCODE(FPU64ToDouble, T::U64, T::U64, T::U1 )
OPCODE(FPS32ToDouble, T::U64, T::U32, T::U1 )
OPCODE(FPS64ToDouble, T::U64, T::U64, T::U1 )
// Floating-point vector instructions
OPCODE(FPVectorAbs16, T::U128, T::U128 )