[Soft-Float] - Merges the softloat-ui branch from: https://github.com/TheLastRar/pcsx2/tree/softfoat-ui

I am sorry for the manual merging, hopefully credits are enough in the commit title.
This commit is contained in:
GitHubProUser67 2025-09-29 20:27:52 +02:00
parent 9ccca2ba26
commit cf64b86c1a
8 changed files with 196 additions and 759 deletions

View File

@ -23,6 +23,26 @@ SettingsWrapper::SettingsWrapper(SettingsInterface& si)
{
}
int SettingsWrapper::EntryFlagsBitfield(const char* section, const char* var_prefix, int value, const std::pair<int, const char*>* entries, const int defvalue /*= 0.0*/)
{
std::string name;
int outval = 0;
int i = 0;
while (entries[i].second != nullptr)
{
name.assign(var_prefix);
name.append(entries[i].second);
const int bit = entries[i].first;
const bool def = defvalue & bit;
bool val = value & bit;
Entry(section, name.c_str(), val, def);
outval |= val ? bit : 0;
i++;
}
return outval;
}
SettingsLoadWrapper::SettingsLoadWrapper(SettingsInterface& si)
: SettingsWrapper(si)
{

View File

@ -9,6 +9,7 @@
#include "common/SmallString.h"
#include <optional>
#include <utility>
// Helper class which loads or saves depending on the derived class.
class SettingsWrapper
@ -29,6 +30,7 @@ public:
// This special form of Entry is provided for bitfields, which cannot be passed by reference.
virtual bool EntryBitBool(const char* section, const char* var, bool value, const bool defvalue = false) = 0;
virtual int EntryBitfield(const char* section, const char* var, int value, const int defvalue = 0) = 0;
int EntryFlagsBitfield(const char* section, const char* var_prefix, int value, const std::pair<int, const char*>* entries, const int defvalue = 0);
template <typename T>
void EnumEntry(const char* section, const char* var, T& value, const char* const* enumArray = nullptr, const T defvalue = (T)0)

View File

@ -47,14 +47,14 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* settings_dialog,
connect(m_ui.vu1ClampMode, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) { setClampingMode(1, index); });
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftAddSub, "EmuCore/CPU/Recompiler", "fpuSoftAddSub", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftMulDiv, "EmuCore/CPU/Recompiler", "fpuSoftMulDiv", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftSqrt, "EmuCore/CPU/Recompiler", "fpuSoftSqrt", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftMul, "EmuCore/CPU/Recompiler", "fpuSoftMul", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.eeSoftDivSqrt, "EmuCore/CPU/Recompiler", "fpuSoftDivSqrt", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftAddSub, "EmuCore/CPU/Recompiler", "vu0SoftAddSub", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftMulDiv, "EmuCore/CPU/Recompiler", "vu0SoftMulDiv", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftSqrt, "EmuCore/CPU/Recompiler", "vu0SoftSqrt", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftMul, "EmuCore/CPU/Recompiler", "vu0SoftMul", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0SoftDivSqrt, "EmuCore/CPU/Recompiler", "vu0SoftDivSqrt", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftAddSub, "EmuCore/CPU/Recompiler", "vu1SoftAddSub", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftMulDiv, "EmuCore/CPU/Recompiler", "vu1SoftMulDiv", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftSqrt, "EmuCore/CPU/Recompiler", "vu1SoftSqrt", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftMul, "EmuCore/CPU/Recompiler", "vu1SoftMul", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1SoftDivSqrt, "EmuCore/CPU/Recompiler", "vu1SoftDivSqrt", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.iopRecompiler, "EmuCore/CPU/Recompiler", "EnableIOP", true);

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>700</width>
<height>1100</height>
<height>1190</height>
</rect>
</property>
<layout class="QVBoxLayout" name="_2">
@ -19,685 +19,6 @@
<property name="wordWrap">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>790</width>
<height>1317</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="disclaimerLabel">
<property name="text">
<string>Changing these options may cause games to become non-functional. Modify at your own risk, the PCSX2 team will not provide support for configurations with these settings changed.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="eeSettings">
<property name="title">
<string extracomment="Emotion Engine = Commercial name of one of PS2's processors. Leave as-is unless there's an official name (like for Japanese).">EmotionEngine (MIPS-IV)</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="QLabel" name="eeRoundingLabel">
<property name="text">
<string extracomment="Rounding refers here to the mathematical term.">Rounding Mode:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="eeRoundingMode">
<item>
<property name="text">
<string>Nearest</string>
</property>
</item>
<item>
<property name="text">
<string>Negative</string>
</property>
</item>
<item>
<property name="text">
<string>Positive</string>
</property>
</item>
<item>
<property name="text">
<string>Chop/Zero (Default)</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="eeClampLabel">
<property name="text">
<string extracomment="Clamping: Forcing out of bounds things in bounds by changing them to the closest possible value. In this case, this refers to clamping large PS2 floating point values (which map to infinity or NaN in PCs' IEEE754 floats) to non-infinite ones.">Clamping Mode:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="eeDivRoundingMode">
<item>
<property name="text">
<string>Nearest (Default)</string>
</property>
</item>
<item>
<property name="text">
<string>Negative</string>
</property>
</item>
<item>
<property name="text">
<string>Positive</string>
</property>
</item>
<item>
<property name="text">
<string>Chop/Zero</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0" colspan="2">
<layout class="QGridLayout" name="eeSettingsMisc">
<item row="1" column="0">
<widget class="QCheckBox" name="eeWaitLoopDetection">
<property name="text">
<string>Wait Loop Detection</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="eeRecompiler">
<property name="text">
<string>Enable Recompiler</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="eeFastmem">
<property name="text">
<string>Enable Fast Memory Access</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="eeCache">
<property name="text">
<string>Enable Cache (Slow)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="eeINTCSpinDetection">
<property name="text">
<string>INTC Spin Detection</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="pauseOnTLBMiss">
<property name="text">
<string>Pause On TLB Miss</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="extraMemory">
<property name="text">
<string>Enable 128MB RAM (Dev Console)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="eeClampMode">
<item>
<property name="text">
<string comment="ClampMode">None</string>
</property>
</item>
<item>
<property name="text">
<string>Normal (Default)</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Sign: refers here to the mathematical meaning (plus/minus).">Extra + Preserve Sign</string>
</property>
</item>
<item>
<property name="text">
<string>Full</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="eeDivRoundingLabel">
<property name="text">
<string extracomment="Rounding refers here to the mathematical term.">Division Rounding Mode:</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="eeSoftFloat">
<property name="title">
<string>Software Float</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="1">
<widget class="QCheckBox" name="eeSoftMulDiv">
<property name="text">
<string>Multiplication/Division</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="eeSoftAddSub">
<property name="text">
<string>Addition/Subtraction</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="eeSoftSqrt">
<property name="text">
<string>Square Root</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="vuSettings">
<property name="title">
<string extracomment="Vector Unit/VU: refers to two of PS2's processors. Do not translate the full text or do so as a comment. Leave the acronym as-is.">Vector Units (VU)</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="3" column="0">
<widget class="QLabel" name="vu1RoundingLabel">
<property name="text">
<string>VU1 Rounding Mode:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="vu0RoundingMode">
<item>
<property name="text">
<string>Nearest</string>
</property>
</item>
<item>
<property name="text">
<string>Negative</string>
</property>
</item>
<item>
<property name="text">
<string>Positive</string>
</property>
</item>
<item>
<property name="text">
<string>Chop/Zero (Default)</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="vu1ClampLabel">
<property name="text">
<string>VU1 Clamping Mode:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="vu0RoundingLabel">
<property name="text">
<string>VU0 Rounding Mode:</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QGroupBox" name="vu1SoftFloat">
<property name="title">
<string>VU1 Software Float</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="1">
<widget class="QCheckBox" name="vu1SoftMulDiv">
<property name="text">
<string>Multiplication/Division</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="vu1SoftAddSub">
<property name="text">
<string>Addition/Subtraction</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="vu1SoftSqrt">
<property name="text">
<string>Float Square Root</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QGroupBox" name="vu0SoftFloat">
<property name="title">
<string>VU0 Software Float</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="1">
<widget class="QCheckBox" name="vu0SoftMulDiv">
<property name="text">
<string>Multiplication/Division</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="vu0SoftAddSub">
<property name="text">
<string>Addition/Subtraction</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="vu0SoftSqrt">
<property name="text">
<string>Square Root</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="vu1RoundingMode">
<item>
<property name="text">
<string>Nearest</string>
</property>
</item>
<item>
<property name="text">
<string>Negative</string>
</property>
</item>
<item>
<property name="text">
<string>Positive</string>
</property>
</item>
<item>
<property name="text">
<string>Chop/Zero (Default)</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="vu0ClampMode">
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Normal (Default)</string>
</property>
</item>
<item>
<property name="text">
<string>Extra</string>
</property>
</item>
<item>
<property name="text">
<string>Extra + Preserve Sign</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0" colspan="2">
<layout class="QGridLayout" name="vuSettingsLayout">
<item row="1" column="0">
<widget class="QCheckBox" name="vuFlagHack">
<property name="text">
<string>mVU Flag Hack</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="vu1Recompiler">
<property name="text">
<string>Enable VU1 Recompiler</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="vu0Recompiler">
<property name="text">
<string>Enable VU0 Recompiler (Micro Mode)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="instantVU1">
<property name="text">
<string>Enable Instant VU1</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="vu0ClampLabel">
<property name="text">
<string>VU0 Clamping Mode:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="vu1ClampMode">
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Normal (Default)</string>
</property>
</item>
<item>
<property name="text">
<string>Extra</string>
</property>
</item>
<item>
<property name="text">
<string>Extra + Preserve Sign</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="iopSettings">
<property name="title">
<string>I/O Processor (IOP, MIPS-I)</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="iopRecompiler">
<property name="text">
<string>Enable Recompiler</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gameSettings">
<property name="title">
<string>Game Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="gameFixes">
<property name="text">
<string>Enable Game Fixes</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="patches">
<property name="text">
<string>Enable Compatibility Patches</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="savestateSettings">
<property name="title">
<string>Savestate Settings</string>
</property>
<layout class="QGridLayout" name="savestateSettingsLayout">
<item row="3" column="1">
<widget class="QCheckBox" name="saveStateOnShutdown">
<property name="text">
<string>Save State On Shutdown</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="savestateCompressionLevel">
<item>
<property name="text">
<string>Low (Fast)</string>
</property>
</item>
<item>
<property name="text">
<string>Medium (Recommended)</string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Very High (Slow, Not Recommended)</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="savestateCompressionMethod">
<item>
<property name="text">
<string>Uncompressed</string>
</property>
</item>
<item>
<property name="text">
<string>Deflate64</string>
</property>
</item>
<item>
<property name="text">
<string>Zstandard</string>
</property>
</item>
<item>
<property name="text">
<string>LZMA2</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="savestateCompressionMethodLabel">
<property name="text">
<string>Compression Level:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="backupSaveStates">
<property name="text">
<string>Create Save State Backups</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="savestateCompressionLabel">
<property name="text">
<string>Compression Method:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="savestateSelector">
<property name="text">
<string>Use Save State Selector</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="framerateControlSettings">
<property name="title">
<string>Frame Rate Control</string>
</property>
<layout class="QGridLayout" name="framerateControlLayout">
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="palFrameRate">
<property name="suffix">
<string extracomment="hz=Hertz, as in the measuring unit. Shown after the corresponding number. Those languages who'd need to remove the space or do something in between should do so."> hz</string>
</property>
<property name="minimum">
<double>10.000000000000000</double>
</property>
<property name="maximum">
<double>300.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="ntscFrameRate">
<property name="suffix">
<string> hz</string>
</property>
<property name="minimum">
<double>10.000000000000000</double>
</property>
<property name="maximum">
<double>300.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="palLabel">
<property name="text">
<string>PAL Frame Rate:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="ntscLabel">
<property name="text">
<string>NTSC Frame Rate:</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="pineSettings">
<property name="title">
<string>PINE Settings</string>
</property>
<layout class="QGridLayout" name="pineSettingsLayout">
<item row="1" column="1">
<widget class="QLineEdit" name="pineSlot">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="pineSlotLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Slot:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="pineEnable">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacerBottom">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>3</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
@ -799,7 +120,7 @@
</item>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<layout class="QGridLayout" name="eeSettingsMisc">
<item row="1" column="0">
<widget class="QCheckBox" name="eeWaitLoopDetection">
@ -852,6 +173,36 @@
</item>
</layout>
</item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="eeSoftFloat">
<property name="title">
<string>Software Float</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="1">
<widget class="QCheckBox" name="eeSoftMul">
<property name="text">
<string>Multiplication</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="eeSoftAddSub">
<property name="text">
<string>Addition/Subtraction</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="eeSoftDivSqrt">
<property name="text">
<string>Division/Square Root</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
@ -861,7 +212,7 @@
<string extracomment="Vector Unit/VU: refers to two of PS2's processors. Do not translate the full text or do so as a comment. Leave the acronym as-is.">Vector Units (VU)</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="vu1RoundingLabel">
<property name="text">
<string>VU1 Rounding Mode:</string>
@ -892,7 +243,67 @@
</item>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="5" column="0" colspan="2">
<widget class="QGroupBox" name="vu1SoftFloat">
<property name="title">
<string>VU1 Software Float</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="1">
<widget class="QCheckBox" name="vu1SoftMul">
<property name="text">
<string>Multiplication</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="vu1SoftAddSub">
<property name="text">
<string>Addition/Subtraction</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="vu1SoftDivSqrt">
<property name="text">
<string>Division/Square Root</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QGroupBox" name="vu0SoftFloat">
<property name="title">
<string>VU0 Software Float</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="1">
<widget class="QCheckBox" name="vu0SoftMul">
<property name="text">
<string>Multiplication</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="vu0SoftAddSub">
<property name="text">
<string>Addition/Subtraction</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="vu0SoftDivSqrt">
<property name="text">
<string>Division/Square Root</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="6" column="0" colspan="2">
<layout class="QGridLayout" name="vuSettingsLayout">
<item row="1" column="0">
<widget class="QCheckBox" name="vuFlagHack">
@ -962,14 +373,14 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="vu1ClampLabel">
<property name="text">
<string>VU1 Clamping Mode:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QComboBox" name="vu1RoundingMode">
<item>
<property name="text">
@ -993,7 +404,7 @@
</item>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QComboBox" name="vu1ClampMode">
<item>
<property name="text">

View File

@ -12,6 +12,7 @@
#include <string>
#include <optional>
#include <vector>
#include <utility>
// Macro used for removing some of the redtape involved in defining bitfield/union helpers.
//
@ -621,10 +622,8 @@ struct Pcsx2Config
vu0SignOverflow : 1,
vu0Underflow : 1;
bool
vu0SoftAddSub : 1,
vu0SoftMulDiv : 1,
vu0SoftSqrt : 1;
unsigned int
vu0SoftFloat : 3;
bool
vu1Overflow : 1,
@ -632,20 +631,16 @@ struct Pcsx2Config
vu1SignOverflow : 1,
vu1Underflow : 1;
bool
vu1SoftAddSub : 1,
vu1SoftMulDiv : 1,
vu1SoftSqrt : 1;
unsigned int
vu1SoftFloat : 3;
bool
fpuOverflow : 1,
fpuExtraOverflow : 1,
fpuFullMode : 1;
bool
fpuSoftAddSub : 1,
fpuSoftMulDiv : 1,
fpuSoftSqrt : 1;
unsigned int
fpuSoftFloat : 3;
bool
EnableEECache : 1;
@ -1487,18 +1482,24 @@ namespace EmuFolders
#define CHECK_VU_SIGN_OVERFLOW(vunum) (((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0SignOverflow : EmuConfig.Cpu.Recompiler.vu1SignOverflow)
#define CHECK_VU_UNDERFLOW(vunum) (((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0Underflow : EmuConfig.Cpu.Recompiler.vu1Underflow)
#define CHECK_VU_SOFT_ADDSUB(vunum) (((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0SoftAddSub : EmuConfig.Cpu.Recompiler.vu1SoftAddSub)
#define CHECK_VU_SOFT_MULDIV(vunum) (((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0SoftMulDiv : EmuConfig.Cpu.Recompiler.vu1SoftMulDiv)
#define CHECK_VU_SOFT_SQRT(vunum) (((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0SoftSqrt : EmuConfig.Cpu.Recompiler.vu1SoftSqrt)
#define SOFT_FLOAT_ADDSUB 0x1
#define SOFT_FLOAT_MUL 0x2
#define SOFT_FLOAT_DIVSQRT 0x4
#define CHECK_VU_SOFT_ADDSUB(vunum) ((((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0SoftFloat : EmuConfig.Cpu.Recompiler.vu1SoftFloat) & SOFT_FLOAT_ADDSUB)
#define CHECK_VU_SOFT_MUL(vunum) ((((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0SoftFloat : EmuConfig.Cpu.Recompiler.vu1SoftFloat) & SOFT_FLOAT_MUL)
#define CHECK_VU_SOFT_DIVSQRT(vunum) ((((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0SoftFloat : EmuConfig.Cpu.Recompiler.vu1SoftFloat) & SOFT_FLOAT_DIVSQRT)
#define CHECK_VU_SOFT(vunum) (((vunum) == 0) ? EmuConfig.Cpu.Recompiler.vu0SoftFloat : EmuConfig.Cpu.Recompiler.vu1SoftFloat)
#define CHECK_FPU_OVERFLOW (EmuConfig.Cpu.Recompiler.fpuOverflow)
#define CHECK_FPU_EXTRA_OVERFLOW (EmuConfig.Cpu.Recompiler.fpuExtraOverflow) // If enabled, Operands are checked for infinities before being used in the FPU recs
#define CHECK_FPU_EXTRA_FLAGS 1 // Always enabled now // Sets D/I flags on FPU instructions
#define CHECK_FPU_FULL (EmuConfig.Cpu.Recompiler.fpuFullMode)
#define CHECK_FPU_SOFT_ADDSUB (EmuConfig.Cpu.Recompiler.fpuSoftAddSub)
#define CHECK_FPU_SOFT_MULDIV (EmuConfig.Cpu.Recompiler.fpuSoftMulDiv)
#define CHECK_FPU_SOFT_SQRT (EmuConfig.Cpu.Recompiler.fpuSoftSqrt)
#define CHECK_FPU_SOFT_ADDSUB (EmuConfig.Cpu.Recompiler.fpuSoftFloat & SOFT_FLOAT_ADDSUB)
#define CHECK_FPU_SOFT_MUL (EmuConfig.Cpu.Recompiler.fpuSoftFloat & SOFT_FLOAT_MUL)
#define CHECK_FPU_SOFT_DIVSQRT (EmuConfig.Cpu.Recompiler.fpuSoftFloat & SOFT_FLOAT_DIVSQRT)
#define CHECK_FPU_SOFT (EmuConfig.Cpu.Recompiler.fpuSoftFloat)
//------------ EE Recompiler defines - Comment to disable a recompiler ---------------

View File

@ -338,7 +338,7 @@ void CTC1() {
}
void CVT_S() {
if (CHECK_FPU_SOFT_ADDSUB || CHECK_FPU_SOFT_MULDIV || CHECK_FPU_SOFT_SQRT) { _FdValUl_ = PS2Float::Itof(0, _FsValSl_).raw; }
if (CHECK_FPU_SOFT_ADDSUB || CHECK_FPU_SOFT_MUL || CHECK_FPU_SOFT_DIVSQRT) { _FdValUl_ = PS2Float::Itof(0, _FsValSl_).raw; }
else
{
_FdValf_ = (float)_FsValSl_;
@ -347,14 +347,14 @@ void CVT_S() {
}
void CVT_W() {
if (CHECK_FPU_SOFT_ADDSUB || CHECK_FPU_SOFT_MULDIV || CHECK_FPU_SOFT_SQRT) { _FdValSl_ = PS2Float::Ftoi(0, _FsValUl_); }
if (CHECK_FPU_SOFT_ADDSUB || CHECK_FPU_SOFT_MUL || CHECK_FPU_SOFT_DIVSQRT) { _FdValSl_ = PS2Float::Ftoi(0, _FsValUl_); }
else if ( ( _FsValUl_ & 0x7F800000 ) <= 0x4E800000 ) { _FdValSl_ = (s32)_FsValf_; }
else if ( ( _FsValUl_ & 0x80000000 ) == 0 ) { _FdValUl_ = 0x7fffffff; }
else { _FdValUl_ = 0x80000000; }
}
void DIV_S() {
if (CHECK_FPU_SOFT_MULDIV)
if (CHECK_FPU_SOFT_DIVSQRT)
{
PS2Float divres = fpuAccurateDiv(_FsValUl_, _FtValUl_);
_FdValUl_ = divres.raw;
@ -376,7 +376,7 @@ void DIV_S() {
method provides a similar outcome and is faster. (cottonvibes)
*/
void MADD_S() {
if (CHECK_FPU_SOFT_ADDSUB && CHECK_FPU_SOFT_MULDIV)
if (CHECK_FPU_SOFT_ADDSUB && CHECK_FPU_SOFT_MUL)
{
PS2Float fmacres = fpuAccurateMulAdd(_FAValUl_, _FsValUl_, _FtValUl_);
_FdValUl_ = fmacres.raw;
@ -394,7 +394,7 @@ void MADD_S() {
}
void MADDA_S() {
if (CHECK_FPU_SOFT_ADDSUB && CHECK_FPU_SOFT_MULDIV)
if (CHECK_FPU_SOFT_ADDSUB && CHECK_FPU_SOFT_MUL)
{
PS2Float fmacres = fpuAccurateMulAdd(_FAValUl_, _FsValUl_, _FtValUl_);
_FAValUl_ = fmacres.raw;
@ -429,7 +429,7 @@ void MOV_S() {
}
void MSUB_S() {
if (CHECK_FPU_SOFT_ADDSUB && CHECK_FPU_SOFT_MULDIV)
if (CHECK_FPU_SOFT_ADDSUB && CHECK_FPU_SOFT_MUL)
{
PS2Float fmacres = fpuAccurateMulSub(_FAValUl_, _FsValUl_, _FtValUl_);
_FdValUl_ = fmacres.raw;
@ -447,7 +447,7 @@ void MSUB_S() {
}
void MSUBA_S() {
if (CHECK_FPU_SOFT_ADDSUB && CHECK_FPU_SOFT_MULDIV)
if (CHECK_FPU_SOFT_ADDSUB && CHECK_FPU_SOFT_MUL)
{
PS2Float fmacres = fpuAccurateMulSub(_FAValUl_, _FsValUl_, _FtValUl_);
_FAValUl_ = fmacres.raw;
@ -467,7 +467,7 @@ void MTC1() {
}
void MUL_S() {
if (CHECK_FPU_SOFT_MULDIV)
if (CHECK_FPU_SOFT_MUL)
{
PS2Float mulres = fpuAccurateMul(_FsValUl_, _FtValUl_);
_FdValUl_ = mulres.raw;
@ -483,7 +483,7 @@ void MUL_S() {
}
void MULA_S() {
if (CHECK_FPU_SOFT_MULDIV)
if (CHECK_FPU_SOFT_MUL)
{
PS2Float mulres = fpuAccurateMul(_FsValUl_, _FtValUl_);
_FAValUl_ = mulres.raw;
@ -506,7 +506,7 @@ void NEG_S() {
void RSQRT_S() {
clearFPUFlags(FPUflagD | FPUflagI);
if (CHECK_FPU_SOFT_SQRT)
if (CHECK_FPU_SOFT_DIVSQRT)
{
PS2Float rsqrtres = PS2Float(_FsValUl_).Rsqrt(_FtValUl_);
_FdValUl_ = rsqrtres.raw;
@ -538,7 +538,7 @@ void RSQRT_S() {
void SQRT_S() {
clearFPUFlags(FPUflagI | FPUflagD);
if (CHECK_FPU_SOFT_SQRT)
if (CHECK_FPU_SOFT_DIVSQRT)
{
PS2Float sqrtres = PS2Float(_FtValUl_).Sqrt();
_FdValUl_ = sqrtres.raw;

View File

@ -533,31 +533,34 @@ void Pcsx2Config::RecompilerOptions::LoadSave(SettingsWrapper& wrap)
SettingsWrapBitBool(EnableFastmem);
SettingsWrapBitBool(PauseOnTLBMiss);
// clang-format off
static constexpr std::pair<int, const char*> s_softfloat_variables[] = {
{SOFT_FLOAT_ADDSUB, "SoftAddSub"},
{SOFT_FLOAT_MUL, "SoftMul"},
{SOFT_FLOAT_DIVSQRT, "SoftDivSqrt"},
{0, nullptr},
};
// clang-format on
SettingsWrapBitBool(vu0Overflow);
SettingsWrapBitBool(vu0ExtraOverflow);
SettingsWrapBitBool(vu0SignOverflow);
SettingsWrapBitBool(vu0Underflow);
SettingsWrapBitBool(vu0SoftAddSub);
SettingsWrapBitBool(vu0SoftMulDiv);
SettingsWrapBitBool(vu0SoftSqrt);
vu0SoftFloat = wrap.EntryFlagsBitfield(CURRENT_SETTINGS_SECTION, "vu0", vu0SoftFloat, s_softfloat_variables);
SettingsWrapBitBool(vu1Overflow);
SettingsWrapBitBool(vu1ExtraOverflow);
SettingsWrapBitBool(vu1SignOverflow);
SettingsWrapBitBool(vu1Underflow);
SettingsWrapBitBool(vu1SoftAddSub);
SettingsWrapBitBool(vu1SoftMulDiv);
SettingsWrapBitBool(vu1SoftSqrt);
vu1SoftFloat = wrap.EntryFlagsBitfield(CURRENT_SETTINGS_SECTION, "vu1", vu1SoftFloat, s_softfloat_variables);
SettingsWrapBitBool(fpuOverflow);
SettingsWrapBitBool(fpuExtraOverflow);
SettingsWrapBitBool(fpuFullMode);
SettingsWrapBitBool(fpuSoftAddSub);
SettingsWrapBitBool(fpuSoftMulDiv);
SettingsWrapBitBool(fpuSoftSqrt);
fpuSoftFloat = wrap.EntryFlagsBitfield(CURRENT_SETTINGS_SECTION, "fpu", fpuSoftFloat, s_softfloat_variables);
}
u32 Pcsx2Config::RecompilerOptions::GetEEClampMode() const

View File

@ -710,7 +710,7 @@ static __fi PS2Float _vuAccurateOpMUL(u32 fs, u32 ft)
static __fi void _vuMUL(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateBinaryMACOp<_vuAccurateOpMUL, MACOpDst::Fd>(VU);
else
applyBinaryMACOp<_vuOpMUL, MACOpDst::Fd>(VU);
@ -718,7 +718,7 @@ static __fi void _vuMUL(VURegs* VU)
static __fi void vuMULbc(VURegs* VU, u32 bc)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateBinaryMACOpBroadcast<_vuAccurateOpMUL, MACOpDst::Fd>(VU, bc);
else
applyBinaryMACOpBroadcast<_vuOpMUL, MACOpDst::Fd>(VU, bc);
@ -734,7 +734,7 @@ static __fi void _vuMULw(VURegs* VU) { vuMULbc(VU, VU->VF[_Ft_].i.w); }
static __fi void _vuMULA(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateBinaryMACOp<_vuAccurateOpMUL, MACOpDst::Acc>(VU);
else
applyBinaryMACOp<_vuOpMUL, MACOpDst::Acc>(VU);
@ -742,7 +742,7 @@ static __fi void _vuMULA(VURegs* VU)
static __fi void vuMULAbc(VURegs* VU, u32 bc)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateBinaryMACOpBroadcast<_vuAccurateOpMUL, MACOpDst::Acc>(VU, bc);
else
applyBinaryMACOpBroadcast<_vuOpMUL, MACOpDst::Acc>(VU, bc);
@ -840,7 +840,7 @@ static __fi PS2Float _vuAccurateOpMADDA(u32 acc, u32 fs, u32 ft, bool oflw)
static __fi void _vuMADD(VURegs* VU)
{
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateTernaryMACOp<_vuAccurateOpMADD, MACOpDst::Fd>(VU);
else
applyTernaryMACOp<_vuOpMADD, MACOpDst::Fd>(VU);
@ -848,7 +848,7 @@ static __fi void _vuMADD(VURegs* VU)
static __fi void vuMADDbc(VURegs* VU, u32 bc)
{
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateTernaryMACOpBroadcast<_vuAccurateOpMADD, MACOpDst::Fd>(VU, bc);
else
applyTernaryMACOpBroadcast<_vuOpMADD, MACOpDst::Fd>(VU, bc);
@ -863,7 +863,7 @@ static __fi void _vuMADDw(VURegs* VU) { vuMADDbc(VU, VU->VF[_Ft_].i.w); }
static __fi void _vuMADDA(VURegs* VU)
{
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateAccumulatorTernaryMACOp<_vuAccurateOpMADDA, MACOpDst::Acc>(VU);
else
applyTernaryMACOp<_vuOpMADD, MACOpDst::Acc>(VU);
@ -871,7 +871,7 @@ static __fi void _vuMADDA(VURegs* VU)
static __fi void vuMADDAbc(VURegs* VU, u32 bc)
{
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateAccumulatorTernaryMACOpBroadcast<_vuAccurateOpMADDA, MACOpDst::Acc>(VU, bc);
else
applyTernaryMACOpBroadcast<_vuOpMADD, MACOpDst::Acc>(VU, bc);
@ -903,7 +903,7 @@ static __fi PS2Float _vuAccurateOpMSUBA(u32 acc, u32 fs, u32 ft, bool oflw)
static __fi void _vuMSUB(VURegs* VU)
{
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateTernaryMACOp<_vuAccurateOpMSUB, MACOpDst::Fd>(VU);
else
applyTernaryMACOp<_vuOpMSUB, MACOpDst::Fd>(VU);
@ -911,7 +911,7 @@ static __fi void _vuMSUB(VURegs* VU)
static __fi void vuMSUBbc(VURegs* VU, u32 bc)
{
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateTernaryMACOpBroadcast<_vuAccurateOpMSUB, MACOpDst::Fd>(VU, bc);
else
applyTernaryMACOpBroadcast<_vuOpMSUB, MACOpDst::Fd>(VU, bc);
@ -926,7 +926,7 @@ static __fi void _vuMSUBw(VURegs* VU) { vuMSUBbc(VU, VU->VF[_Ft_].i.w); }
static __fi void _vuMSUBA(VURegs* VU)
{
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateAccumulatorTernaryMACOp<_vuAccurateOpMSUBA, MACOpDst::Acc>(VU);
else
applyTernaryMACOp<_vuOpMSUB, MACOpDst::Acc>(VU);
@ -934,7 +934,7 @@ static __fi void _vuMSUBA(VURegs* VU)
static __fi void vuMSUBAbc(VURegs* VU, u32 bc)
{
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
applyAccurateAccumulatorTernaryMACOpBroadcast<_vuAccurateOpMSUBA, MACOpDst::Acc>(VU, bc);
else
applyTernaryMACOpBroadcast<_vuOpMSUB, MACOpDst::Acc>(VU, bc);
@ -1008,7 +1008,7 @@ static __fi void _vuMINIw(VURegs* VU) { applyMinMaxBroadcast<fp_min>(VU, VU->VF[
static __fi void _vuOPMULA(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
{
VU->ACC.i.x = VU_MACx_UPDATE(VU, vuAccurateMul(VU->VF[_Fs_].i.y, VU->VF[_Ft_].i.z));
VU->ACC.i.y = VU_MACy_UPDATE(VU, vuAccurateMul(VU->VF[_Fs_].i.z, VU->VF[_Ft_].i.x));
@ -1031,7 +1031,7 @@ static __fi void _vuOPMSUB(VURegs* VU)
else
dst = &VU->VF[_Fd_];
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0))
{
u32 ftx = VU->VF[_Ft_].i.x;
u32 fty = VU->VF[_Ft_].i.y;
@ -1121,7 +1121,7 @@ static __fi void _vuCLIP(VURegs* VU)
static __fi void _vuDIV(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0))
{
PS2Float ft = PS2Float(VU->VF[_Ft_].UL[_Ftf_]);
PS2Float fs = PS2Float(VU->VF[_Fs_].UL[_Fsf_]);
@ -1176,7 +1176,7 @@ static __fi void _vuDIV(VURegs* VU)
static __fi void _vuSQRT(VURegs* VU)
{
if (CHECK_VU_SOFT_SQRT((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0))
{
PS2Float ft = PS2Float(VU->VF[_Ft_].UL[_Ftf_]);
@ -1201,7 +1201,7 @@ static __fi void _vuSQRT(VURegs* VU)
static __fi void _vuRSQRT(VURegs* VU)
{
if (CHECK_VU_SOFT_SQRT((VU == &VU1) ? 1 : 0))
if (CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0))
{
PS2Float ft = PS2Float(VU->VF[_Ft_].UL[_Ftf_]);
PS2Float fs = PS2Float(VU->VF[_Fs_].UL[_Fsf_]);
@ -1922,7 +1922,7 @@ static __ri void _vuWAITP(VURegs* VU)
static __ri void _vuESADD(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].i.x).ESADD(PS2Float(VU->VF[_Fs_].i.y), PS2Float(VU->VF[_Fs_].i.z)).raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].i.x).ESADD(PS2Float(VU->VF[_Fs_].i.y), PS2Float(VU->VF[_Fs_].i.z)).raw; }
else
{
float p = vuDouble(VU->VF[_Fs_].i.x) * vuDouble(VU->VF[_Fs_].i.x) + vuDouble(VU->VF[_Fs_].i.y) * vuDouble(VU->VF[_Fs_].i.y) + vuDouble(VU->VF[_Fs_].i.z) * vuDouble(VU->VF[_Fs_].i.z);
@ -1933,7 +1933,7 @@ static __ri void _vuESADD(VURegs* VU)
static __ri void _vuERSADD(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].i.x).ERSADD(PS2Float(VU->VF[_Fs_].i.y), PS2Float(VU->VF[_Fs_].i.z)).raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].i.x).ERSADD(PS2Float(VU->VF[_Fs_].i.y), PS2Float(VU->VF[_Fs_].i.z)).raw; }
else
{
float p = (vuDouble(VU->VF[_Fs_].i.x) * vuDouble(VU->VF[_Fs_].i.x)) + (vuDouble(VU->VF[_Fs_].i.y) * vuDouble(VU->VF[_Fs_].i.y)) + (vuDouble(VU->VF[_Fs_].i.z) * vuDouble(VU->VF[_Fs_].i.z));
@ -1947,7 +1947,7 @@ static __ri void _vuERSADD(VURegs* VU)
static __ri void _vuELENG(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].i.x).ELENG(PS2Float(VU->VF[_Fs_].i.y), PS2Float(VU->VF[_Fs_].i.z)).raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].i.x).ELENG(PS2Float(VU->VF[_Fs_].i.y), PS2Float(VU->VF[_Fs_].i.z)).raw; }
else
{
float p = vuDouble(VU->VF[_Fs_].i.x) * vuDouble(VU->VF[_Fs_].i.x) + vuDouble(VU->VF[_Fs_].i.y) * vuDouble(VU->VF[_Fs_].i.y) + vuDouble(VU->VF[_Fs_].i.z) * vuDouble(VU->VF[_Fs_].i.z);
@ -1962,7 +1962,7 @@ static __ri void _vuELENG(VURegs* VU)
static __ri void _vuERLENG(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].i.x).ERLENG(PS2Float(VU->VF[_Fs_].i.y), PS2Float(VU->VF[_Fs_].i.z)).raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].i.x).ERLENG(PS2Float(VU->VF[_Fs_].i.y), PS2Float(VU->VF[_Fs_].i.z)).raw; }
else
{
float p = vuDouble(VU->VF[_Fs_].i.x) * vuDouble(VU->VF[_Fs_].i.x) + vuDouble(VU->VF[_Fs_].i.y) * vuDouble(VU->VF[_Fs_].i.y) + vuDouble(VU->VF[_Fs_].i.z) * vuDouble(VU->VF[_Fs_].i.z);
@ -2003,7 +2003,7 @@ static __ri PS2Float _vuCalculateAccurateEATAN(PS2Float inputvalue)
static __ri void _vuEATAN(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = _vuCalculateAccurateEATAN(PS2Float(VU->VF[_Fs_].UL[_Fsf_])).raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = _vuCalculateAccurateEATAN(PS2Float(VU->VF[_Fs_].UL[_Fsf_])).raw; }
else
{
float p = _vuCalculateEATAN(vuDouble(VU->VF[_Fs_].UL[_Fsf_]));
@ -2013,7 +2013,7 @@ static __ri void _vuEATAN(VURegs* VU)
static __ri void _vuEATANxy(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = _vuCalculateAccurateEATAN(PS2Float(VU->VF[_Fs_].i.y).Div(PS2Float(VU->VF[_Fs_].i.x))).raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = _vuCalculateAccurateEATAN(PS2Float(VU->VF[_Fs_].i.y).Div(PS2Float(VU->VF[_Fs_].i.x))).raw; }
else
{
float p = 0;
@ -2027,7 +2027,7 @@ static __ri void _vuEATANxy(VURegs* VU)
static __ri void _vuEATANxz(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = _vuCalculateAccurateEATAN(PS2Float(VU->VF[_Fs_].i.z).Div(PS2Float(VU->VF[_Fs_].i.x))).raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = _vuCalculateAccurateEATAN(PS2Float(VU->VF[_Fs_].i.z).Div(PS2Float(VU->VF[_Fs_].i.x))).raw; }
else
{
float p = 0;
@ -2051,7 +2051,7 @@ static __ri void _vuESUM(VURegs* VU)
static __ri void _vuERCPR(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).ERCPR().raw; }
if (CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).ERCPR().raw; }
else
{
float p = vuDouble(VU->VF[_Fs_].UL[_Fsf_]);
@ -2067,7 +2067,7 @@ static __ri void _vuERCPR(VURegs* VU)
static __ri void _vuESQRT(VURegs* VU)
{
if (CHECK_VU_SOFT_SQRT((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).ESQRT().raw; }
if (CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).ESQRT().raw; }
else
{
float p = vuDouble(VU->VF[_Fs_].UL[_Fsf_]);
@ -2083,7 +2083,7 @@ static __ri void _vuESQRT(VURegs* VU)
static __ri void _vuERSQRT(VURegs* VU)
{
if (CHECK_VU_SOFT_SQRT((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).ERSQRT().raw; }
if (CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).ERSQRT().raw; }
else
{
float p = vuDouble(VU->VF[_Fs_].UL[_Fsf_]);
@ -2103,7 +2103,7 @@ static __ri void _vuERSQRT(VURegs* VU)
static __ri void _vuESIN(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).ESIN().raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).ESIN().raw; }
else
{
float sinconsts[5] = {1.0f, -0.166666567325592f, 0.008333025500178f, -0.000198074136279f, 0.000002601886990f};
@ -2116,7 +2116,7 @@ static __ri void _vuESIN(VURegs* VU)
static __ri void _vuEEXP(VURegs* VU)
{
if (CHECK_VU_SOFT_MULDIV((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).EEXP().raw; }
if (CHECK_VU_SOFT_MUL((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_DIVSQRT((VU == &VU1) ? 1 : 0) && CHECK_VU_SOFT_ADDSUB((VU == &VU1) ? 1 : 0)) { VU->p.UL = PS2Float(VU->VF[_Fs_].UL[_Fsf_]).EEXP().raw; }
else
{
float consts[6] = {0.249998688697815f, 0.031257584691048f, 0.002591371303424f,