diff options
author | Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> | 2022-12-14 19:13:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-14 21:13:23 -0300 |
commit | 8ac53c66b4e58c9793f3c1c894679d04604a99c8 (patch) | |
tree | 39fa3b07722ee26835df5f9d402dad27069ac1cc /Ryujinx.Graphics.Shader/Translation/Optimizations/HalfConversion.cs | |
parent | 0f50de72beb52585ee032a72990bb505885eab19 (diff) |
Remove Half Conversion (#4106)1.1.470
* Remove HalfConversion
* Update `CodeGenVersion`
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/Optimizations/HalfConversion.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/Translation/Optimizations/HalfConversion.cs | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/Optimizations/HalfConversion.cs b/Ryujinx.Graphics.Shader/Translation/Optimizations/HalfConversion.cs deleted file mode 100644 index 96060272..00000000 --- a/Ryujinx.Graphics.Shader/Translation/Optimizations/HalfConversion.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace Ryujinx.Graphics.Shader.Translation.Optimizations -{ - static class HalfConversion - { - public static float HalfToSingle(int value) - { - int mantissa = (value >> 0) & 0x3ff; - int exponent = (value >> 10) & 0x1f; - int sign = (value >> 15) & 0x1; - - if (exponent == 0x1f) - { - // NaN or Infinity. - mantissa <<= 13; - exponent = 0xff; - } - else if (exponent != 0 || mantissa != 0 ) - { - if (exponent == 0) - { - // Denormal. - int e = -1; - int m = mantissa; - - do - { - e++; - m <<= 1; - } - while ((m & 0x400) == 0); - - mantissa = m & 0x3ff; - exponent = e; - } - - mantissa <<= 13; - exponent = 127 - 15 + exponent; - } - - int output = (sign << 31) | (exponent << 23) | mantissa; - - return BitConverter.Int32BitsToSingle(output); - } - } -}
\ No newline at end of file |