diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-18 02:38:01 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-18 02:38:01 +0200 |
commit | dc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch) | |
tree | 569a7f13128450bbab973236615587ff00bced5f /src/video_core/pica_types.h | |
parent | Travis: Import Dolphin’s clang-format hook. (diff) | |
download | yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2 yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/pica_types.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/video_core/pica_types.h b/src/video_core/pica_types.h index 3b7bfbdca..20f648b03 100644 --- a/src/video_core/pica_types.h +++ b/src/video_core/pica_types.h @@ -22,7 +22,7 @@ namespace Pica { * * @todo Verify on HW if this conversion is sufficiently accurate. */ -template<unsigned M, unsigned E> +template <unsigned M, unsigned E> struct Float { public: static Float<M, E> FromFloat32(float val) { @@ -58,7 +58,7 @@ public: return value; } - Float<M, E> operator * (const Float<M, E>& flt) const { + Float<M, E> operator*(const Float<M, E>& flt) const { if ((this->value == 0.f && !std::isnan(flt.value)) || (flt.value == 0.f && !std::isnan(this->value))) // PICA gives 0 instead of NaN when multiplying by inf @@ -66,67 +66,68 @@ public: return Float<M, E>::FromFloat32(ToFloat32() * flt.ToFloat32()); } - Float<M, E> operator / (const Float<M, E>& flt) const { + Float<M, E> operator/(const Float<M, E>& flt) const { return Float<M, E>::FromFloat32(ToFloat32() / flt.ToFloat32()); } - Float<M, E> operator + (const Float<M, E>& flt) const { + Float<M, E> operator+(const Float<M, E>& flt) const { return Float<M, E>::FromFloat32(ToFloat32() + flt.ToFloat32()); } - Float<M, E> operator - (const Float<M, E>& flt) const { + Float<M, E> operator-(const Float<M, E>& flt) const { return Float<M, E>::FromFloat32(ToFloat32() - flt.ToFloat32()); } - Float<M, E>& operator *= (const Float<M, E>& flt) { + Float<M, E>& operator*=(const Float<M, E>& flt) { if ((this->value == 0.f && !std::isnan(flt.value)) || (flt.value == 0.f && !std::isnan(this->value))) // PICA gives 0 instead of NaN when multiplying by inf *this = Zero(); - else value *= flt.ToFloat32(); + else + value *= flt.ToFloat32(); return *this; } - Float<M, E>& operator /= (const Float<M, E>& flt) { + Float<M, E>& operator/=(const Float<M, E>& flt) { value /= flt.ToFloat32(); return *this; } - Float<M, E>& operator += (const Float<M, E>& flt) { + Float<M, E>& operator+=(const Float<M, E>& flt) { value += flt.ToFloat32(); return *this; } - Float<M, E>& operator -= (const Float<M, E>& flt) { + Float<M, E>& operator-=(const Float<M, E>& flt) { value -= flt.ToFloat32(); return *this; } - Float<M, E> operator - () const { + Float<M, E> operator-() const { return Float<M, E>::FromFloat32(-ToFloat32()); } - bool operator < (const Float<M, E>& flt) const { + bool operator<(const Float<M, E>& flt) const { return ToFloat32() < flt.ToFloat32(); } - bool operator > (const Float<M, E>& flt) const { + bool operator>(const Float<M, E>& flt) const { return ToFloat32() > flt.ToFloat32(); } - bool operator >= (const Float<M, E>& flt) const { + bool operator>=(const Float<M, E>& flt) const { return ToFloat32() >= flt.ToFloat32(); } - bool operator <= (const Float<M, E>& flt) const { + bool operator<=(const Float<M, E>& flt) const { return ToFloat32() <= flt.ToFloat32(); } - bool operator == (const Float<M, E>& flt) const { + bool operator==(const Float<M, E>& flt) const { return ToFloat32() == flt.ToFloat32(); } - bool operator != (const Float<M, E>& flt) const { + bool operator!=(const Float<M, E>& flt) const { return ToFloat32() != flt.ToFloat32(); } |