Skip to content

Commit

Permalink
Merge pull request #16984 from fp64/vfpu-sincos
Browse files Browse the repository at this point in the history
VFPU sin/cos
  • Loading branch information
hrydgard authored Mar 28, 2023
2 parents 882a531 + 3a6e48a commit 98d9a9c
Show file tree
Hide file tree
Showing 22 changed files with 612 additions and 258 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2388,6 +2388,7 @@ set(NativeAssets
assets/lang
assets/shaders
assets/themes
assets/vfpu
assets/Roboto-Condensed.ttf
assets/7z.png
assets/compat.ini
Expand Down Expand Up @@ -2498,6 +2499,7 @@ if(TargetBin)
file(GLOB_RECURSE SHADER_FILES assets/shaders/*)
file(GLOB_RECURSE THEME_FILE assets/themes/*)
file(GLOB_RECURSE DEBUGGER_FILES assets/debugger/*)
file(GLOB_RECURSE VFPU_FILES assets/vfpu/*)

if(NOT IOS)
set_source_files_properties(${BigFontAssets} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets")
Expand All @@ -2507,6 +2509,7 @@ if(TargetBin)
set_source_files_properties(${SHADER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/shaders")
set_source_files_properties(${THEME_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/themes")
set_source_files_properties(${DEBUGGER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/debugger")
set_source_files_properties(${VFPU_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/vfpu")
endif()

if(IOS)
Expand Down
12 changes: 6 additions & 6 deletions Core/MIPS/MIPSIntVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,18 +629,18 @@ namespace MIPSInt
// vsat0 changes -0.0 to +0.0, both retain NAN.
case 4: if (s[i] <= 0) d[i] = 0; else {if(s[i] > 1.0f) d[i] = 1.0f; else d[i] = s[i];} break; // vsat0
case 5: if (s[i] < -1.0f) d[i] = -1.0f; else {if(s[i] > 1.0f) d[i] = 1.0f; else d[i] = s[i];} break; // vsat1
case 16: d[i] = 1.0f / s[i]; break; //vrcp
case 16: { d[i] = vfpu_rcp(s[i]); } break; //vrcp
case 17: d[i] = USE_VFPU_SQRT ? vfpu_rsqrt(s[i]) : 1.0f / sqrtf(s[i]); break; //vrsq

case 18: { d[i] = vfpu_sin(s[i]); } break; //vsin
case 19: { d[i] = vfpu_cos(s[i]); } break; //vcos
case 20: d[i] = powf(2.0f, s[i]); break; //vexp2
case 21: d[i] = logf(s[i])/log(2.0f); break; //vlog2
case 20: { d[i] = vfpu_exp2(s[i]); } break; //vexp2
case 21: { d[i] = vfpu_log2(s[i]); } break; //vlog2
case 22: d[i] = USE_VFPU_SQRT ? vfpu_sqrt(s[i]) : fabsf(sqrtf(s[i])); break; //vsqrt
case 23: d[i] = (float)(asinf(s[i]) / M_PI_2); break; //vasin
case 24: d[i] = -1.0f / s[i]; break; // vnrcp
case 23: { d[i] = vfpu_asin(s[i]); } break; //vasin
case 24: { d[i] = -vfpu_rcp(s[i]); } break; // vnrcp
case 26: { d[i] = -vfpu_sin(s[i]); } break; // vnsin
case 28: d[i] = 1.0f / powf(2.0, s[i]); break; // vrexp2
case 28: { d[i] = vfpu_rexp2(s[i]); } break; // vrexp2
default:
_dbg_assert_msg_( false, "Invalid VV2Op op type %d", optype);
break;
Expand Down
Loading

0 comments on commit 98d9a9c

Please sign in to comment.