Add OPCODE_NEGATED_MUL_ADD/OPCODE_NEGATED_MUL_SUB
Proper handling of nans for VMX max/min on x64 (minps/maxps has special behavior depending on the operand order that vmx does not have for vminfp/vmaxfp) Add extremely unintrusive guest code profiler utilizing KUSER_SHARED systemtime. This profiler is disabled on platforms other than windows, and on windows is disabled by default by a cvar Repurpose GUEST_SCRATCH64 stack offset to instead be for storing guest function profile times, define GUEST_SCRATCH as 0 instead, since thats already meant to be a scratch area Fix xenia silently closing on config errors/other fatal errors by setting has_console_attached_'s default to false Add alternative code path for guest clock that uses kusershared systemtime instead of QueryPerformanceCounter. This is way faster and I have tested it and found it to be working, but i have disabled it because i do not know how well it works on wine or on processors other than mine Significantly reduce log spam by setting XELOGAPU and XELOGGPU to be LogLevel::Debug Changed some LOGI to LOGD in places to reduce log spam Mark VdSwap as kHighFrequency, it was spamming up logs Make logging calls less intrusive for the caller by forcing the test of log level inline and moving the format/AppendLogLine stuff to an outlined cold function Add swcache namespace for software cache operations like prefetches, streaming stores and streaming loads. Add XE_MSVC_REORDER_BARRIER for preventing msvc from propagating a value too close to its store or from its load Add xe_unlikely_mutex for locks we know have very little contention add XE_HOST_CACHE_LINE_SIZE and XE_RESTRICT to platform.h Microoptimization: Changed most uses of size_t to ring_size_t in RingBuffer, this reduces the size of the inlined ringbuffer operations slightly by eliminating rex prefixes, depending on register allocation Add BeginPrefetchedRead to ringbuffer, which prefetches the second range if there is one according to the provided PrefetchTag added inline_loadclock cvar, which will directly use the value of the guest clock from clock.cc in jitted guest code. off by default change uses of GUEST_SCRATCH64 to GUEST_SCRATCH Add fast vectorized xenos_half_to_float/xenos_float_to_half (currently resides in x64_seq_vector, move to gpu code maybe at some point) Add fast x64 codegen for PackFloat16_4/UnpackFloat16_4. Same code can be used for Float16_2 in future commit. This should speed up some games that use these functions heavily Remove cvar for toggling old float16 behavior Add VRSAVE register, support mfspr/mtspr vrsave Add cvar for toggling off codegen for trap instructions and set it to true by default. Add specialized methods to CommandProcessor: WriteRegistersFromMem, WriteRegisterRangeFromRing, and WriteOneRegisterFromRing. These reduce the overall cost of WriteRegister Use a fixed size vmem vector for upload ranges, realloc/memsetting on resize in the inner loop of requestranges was showing up on the profiler (the search in requestranges itself needs work) Rename fixed_vmem_vector to better fit xenia's naming convention Only log unknown register writes in WriteRegister if DEBUG :/. We're stuck on MSVC with c++17 so we have no way of influencing the branch ordering for that function without profile guided optimization Remove binding stride assert in shader_translator.cc, triangle told me its leftover ogl stuff Mark xe::FatalError as noreturn If a controller is not connected, delay by 1.1 seconds before checking if it has been reconnected. Asking Xinput about a controller slot that is unused is extremely slow, and XinputGetState/SetState were taking up an enormous amount of time in profiles. this may have caused a bit of input lag Protect accesses to input_system with a lock Add proper handling for user_index>= 4 in XamInputGetState/SetState, properly return zeroed state in GetState Add missing argument to NtQueryVirtualMemory_entry Fixed RtlCompareMemoryUlong_entry, it actually does not care if the source is misaligned, and for length it aligns down Fixed RtlUpperChar and RtlLowerChar, added a table that has their correct return values precomputed
This commit is contained in:
@@ -35,7 +35,9 @@
|
||||
#undef GetFirstChild
|
||||
|
||||
#define XE_USE_NTDLL_FUNCTIONS 1
|
||||
#define XE_USE_KUSER_SHARED 1
|
||||
//chrispy: disabling this for now, more research needs to be done imo, although it does work very well on my machine
|
||||
//
|
||||
#define XE_USE_KUSER_SHARED 0
|
||||
#if XE_USE_NTDLL_FUNCTIONS == 1
|
||||
/*
|
||||
ntdll versions of functions often skip through a lot of extra garbage in
|
||||
@@ -61,142 +63,19 @@
|
||||
#define XE_NTDLL_IMPORT(name, cls, clsvar) static constexpr bool clsvar = false
|
||||
|
||||
#endif
|
||||
|
||||
#if XE_USE_KUSER_SHARED==1
|
||||
// KUSER_SHARED
|
||||
struct __declspec(align(4)) _KSYSTEM_TIME {
|
||||
unsigned int LowPart;
|
||||
int High1Time;
|
||||
int High2Time;
|
||||
};
|
||||
enum _NT_PRODUCT_TYPE {
|
||||
NtProductWinNt = 0x1,
|
||||
NtProductLanManNt = 0x2,
|
||||
NtProductServer = 0x3,
|
||||
};
|
||||
enum _ALTERNATIVE_ARCHITECTURE_TYPE {
|
||||
StandardDesign = 0x0,
|
||||
NEC98x86 = 0x1,
|
||||
EndAlternatives = 0x2,
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct $3D940D5D03EF7F98CEE6737EDE752E57 {
|
||||
__int8 _bf_0;
|
||||
};
|
||||
|
||||
union $DA7A7E727E24E4DD62317E27558CCADA {
|
||||
unsigned __int8 MitigationPolicies;
|
||||
$3D940D5D03EF7F98CEE6737EDE752E57 __s1;
|
||||
};
|
||||
struct __declspec(align(4)) $4BF4056B39611650D41923F164DAFA52 {
|
||||
__int32 _bf_0;
|
||||
};
|
||||
|
||||
union __declspec(align(4)) $BB68545E345A5F8046EF3BC0FE928142 {
|
||||
unsigned int SharedDataFlags;
|
||||
$4BF4056B39611650D41923F164DAFA52 __s1;
|
||||
};
|
||||
union $5031D289C483414B89DA3F368D1FE62C {
|
||||
volatile _KSYSTEM_TIME TickCount;
|
||||
volatile unsigned __int64 TickCountQuad;
|
||||
unsigned int ReservedTickCountOverlay[3];
|
||||
};
|
||||
struct $F91ACE6F13277DFC9425B9B8BBCB30F7 {
|
||||
volatile unsigned __int8 QpcBypassEnabled;
|
||||
unsigned __int8 QpcShift;
|
||||
};
|
||||
|
||||
union __declspec(align(2)) $3C927F8BB7EAEE13CF0CFC3E60EDC8A9 {
|
||||
unsigned __int16 QpcData;
|
||||
$F91ACE6F13277DFC9425B9B8BBCB30F7 __s1;
|
||||
};
|
||||
|
||||
struct __declspec(align(8)) _KUSER_SHARED_DATA {
|
||||
unsigned int TickCountLowDeprecated;
|
||||
unsigned int TickCountMultiplier;
|
||||
volatile _KSYSTEM_TIME InterruptTime;
|
||||
volatile _KSYSTEM_TIME SystemTime;
|
||||
volatile _KSYSTEM_TIME TimeZoneBias;
|
||||
unsigned __int16 ImageNumberLow;
|
||||
unsigned __int16 ImageNumberHigh;
|
||||
wchar_t NtSystemRoot[260];
|
||||
unsigned int MaxStackTraceDepth;
|
||||
unsigned int CryptoExponent;
|
||||
unsigned int TimeZoneId;
|
||||
unsigned int LargePageMinimum;
|
||||
unsigned int AitSamplingValue;
|
||||
unsigned int AppCompatFlag;
|
||||
unsigned __int64 RNGSeedVersion;
|
||||
unsigned int GlobalValidationRunlevel;
|
||||
volatile int TimeZoneBiasStamp;
|
||||
unsigned int NtBuildNumber;
|
||||
_NT_PRODUCT_TYPE NtProductType;
|
||||
unsigned __int8 ProductTypeIsValid;
|
||||
unsigned __int8 Reserved0[1];
|
||||
unsigned __int16 NativeProcessorArchitecture;
|
||||
unsigned int NtMajorVersion;
|
||||
unsigned int NtMinorVersion;
|
||||
unsigned __int8 ProcessorFeatures[64];
|
||||
unsigned int Reserved1;
|
||||
unsigned int Reserved3;
|
||||
volatile unsigned int TimeSlip;
|
||||
_ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
|
||||
unsigned int BootId;
|
||||
_LARGE_INTEGER SystemExpirationDate;
|
||||
unsigned int SuiteMask;
|
||||
unsigned __int8 KdDebuggerEnabled;
|
||||
$DA7A7E727E24E4DD62317E27558CCADA ___u33;
|
||||
unsigned __int8 Reserved6[2];
|
||||
volatile unsigned int ActiveConsoleId;
|
||||
volatile unsigned int DismountCount;
|
||||
unsigned int ComPlusPackage;
|
||||
unsigned int LastSystemRITEventTickCount;
|
||||
unsigned int NumberOfPhysicalPages;
|
||||
unsigned __int8 SafeBootMode;
|
||||
unsigned __int8 VirtualizationFlags;
|
||||
unsigned __int8 Reserved12[2];
|
||||
$BB68545E345A5F8046EF3BC0FE928142 ___u43;
|
||||
unsigned int DataFlagsPad[1];
|
||||
unsigned __int64 TestRetInstruction;
|
||||
__int64 QpcFrequency;
|
||||
unsigned int SystemCall;
|
||||
unsigned int SystemCallPad0;
|
||||
unsigned __int64 SystemCallPad[2];
|
||||
$5031D289C483414B89DA3F368D1FE62C ___u50;
|
||||
unsigned int TickCountPad[1];
|
||||
unsigned int Cookie;
|
||||
unsigned int CookiePad[1];
|
||||
__int64 ConsoleSessionForegroundProcessId;
|
||||
unsigned __int64 TimeUpdateLock;
|
||||
unsigned __int64 BaselineSystemTimeQpc;
|
||||
unsigned __int64 BaselineInterruptTimeQpc;
|
||||
unsigned __int64 QpcSystemTimeIncrement;
|
||||
unsigned __int64 QpcInterruptTimeIncrement;
|
||||
unsigned __int8 QpcSystemTimeIncrementShift;
|
||||
unsigned __int8 QpcInterruptTimeIncrementShift;
|
||||
unsigned __int16 UnparkedProcessorCount;
|
||||
unsigned int EnclaveFeatureMask[4];
|
||||
unsigned int TelemetryCoverageRound;
|
||||
unsigned __int16 UserModeGlobalLogger[16];
|
||||
unsigned int ImageFileExecutionOptions;
|
||||
unsigned int LangGenerationCount;
|
||||
unsigned __int64 Reserved4;
|
||||
volatile unsigned __int64 InterruptTimeBias;
|
||||
volatile unsigned __int64 QpcBias;
|
||||
unsigned int ActiveProcessorCount;
|
||||
volatile unsigned __int8 ActiveGroupCount;
|
||||
unsigned __int8 Reserved9;
|
||||
$3C927F8BB7EAEE13CF0CFC3E60EDC8A9 ___u74;
|
||||
_LARGE_INTEGER TimeZoneBiasEffectiveStart;
|
||||
_LARGE_INTEGER TimeZoneBiasEffectiveEnd;
|
||||
_XSTATE_CONFIGURATION XState;
|
||||
};
|
||||
static constexpr unsigned KUSER_SIZE = sizeof(_KUSER_SHARED_DATA);
|
||||
|
||||
static_assert(KUSER_SIZE == 1808, "yay");
|
||||
#pragma pack(pop)
|
||||
|
||||
static _KUSER_SHARED_DATA* KUserShared() {
|
||||
return (_KUSER_SHARED_DATA*)0x7FFE0000;
|
||||
static constexpr size_t KSUER_SHARED_SYSTEMTIME_OFFSET = 0x14;
|
||||
static unsigned char* KUserShared() { return (unsigned char*)0x7FFE0000ULL; }
|
||||
static volatile _KSYSTEM_TIME* GetKUserSharedSystemTime() {
|
||||
return reinterpret_cast<volatile _KSYSTEM_TIME*>(
|
||||
KUserShared() + KSUER_SHARED_SYSTEMTIME_OFFSET);
|
||||
}
|
||||
#endif
|
||||
#endif // XENIA_BASE_PLATFORM_WIN_H_
|
||||
|
||||
Reference in New Issue
Block a user