mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-07-22 21:17:14 +00:00
Implement float comparison instruction.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cmath>
|
||||
|
||||
#ifdef __clang__
|
||||
#include <x86intrin.h>
|
||||
@@ -53,7 +54,11 @@ struct PPCCRRegister
|
||||
uint8_t lt;
|
||||
uint8_t gt;
|
||||
uint8_t eq;
|
||||
uint8_t so;
|
||||
union
|
||||
{
|
||||
uint8_t so;
|
||||
uint8_t un;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
void compare(T left, T right, const PPCXERRegister& xer)
|
||||
@@ -63,6 +68,14 @@ struct PPCCRRegister
|
||||
eq = left == right;
|
||||
so = xer.so;
|
||||
}
|
||||
|
||||
void compare(double left, double right)
|
||||
{
|
||||
lt = left < right;
|
||||
gt = left > right;
|
||||
eq = left == right;
|
||||
un = isnan(left) || isnan(right);
|
||||
}
|
||||
};
|
||||
|
||||
typedef float float128[4];
|
||||
|
Reference in New Issue
Block a user