19 Commits
Author SHA1 Message Date
bmdhacks 3d15e04c6c Fix: VU sticky bits accumulate where the flags are produced, not at flush
VU_STAT_UPDATE assigned the bare ZSUO cause nibble to statusflag, throwing
the sticky field away, and _vuFMACflush re-derived the stickies from that
cause nibble on every pipeline entry it retired. That is idempotent right
up until an FSSET clears the sticky field: the stale cause then
regenerates the bit FSSET just cleared.

Traced on VUSTICKY_MICRO_FSSET_ASSIGNS_NOT_ORS. The FSSET merge itself is
correct -- it produces VI=801 -- and the bit comes back one entry later:

  [FSSET]      imm=800 sf 001 -> 801
  [FLUSH] pipe[2] flagreg=10000 entry.sf=801 VI=041 -> VI=801 (FSSET arm)
  [ADD]   pipe[3] lower VIwrite=8 snap.sf=801
  [FLUSH] pipe[3] flagreg=8     entry.sf=801 VI=801 -> VI=841 (FMAC arm)

pipe[3] is not an FMAC at all; flagreg=8 is a lower op writing integer
register VI[3]. It took the non-FSSET arm only because every retired entry
rewrites STATUS, and (sf & 0xF) << 6 turned the long-dead Z cause back
into sticky Z.

So the sticky OR moves to VU_STAT_UPDATE, where the flags are produced,
and both flush sites take the sticky field from the snapshot instead of
re-deriving it. statusflag is seeded from the whole STATUS register in
vu0ExecMicro, so carrying the sticky field in it is the documented intent
-- VU_STAT_UPDATE's original comment claimed exactly this preservation
while the code did the opposite.

Both halves are load-bearing: reverting VU_STAT_UPDATE alone fails the
Vu0AluUpper suite, reverting the flush arms alone leaves the FSSET rows
diverging.

Graduates VUSTICKY_MICRO_FSSET_CLEARS and
VUSTICKY_MICRO_FSSET_ASSIGNS_NOT_ORS from kMicroDivergences, which no
longer holds any interp-only row.

Idea by pstef.
2026-08-02 17:03:02 -07:00
bmdhacks bcf55312d4 Fix: VU0 macro flag merge keeps the D/I cause and accumulates sticky D/I
Two mask defects in the COP2 macro flag merge, both against the console
and against the arm64 recompiler:

SYNCMSFLAGS preserved only 0xFC0, so every macro FMAC cleared the D/I
cause pair (0x30) that belongs to the div unit. VU_STAT_UPDATE assigns
statusflag outright, so those bits have to be carried from VI -- arm64
does the equivalent, keeping its denormalized bits 18-19 across
cop2EmitFlagUpdate, which EeVu0Cop2MacroLazyStatus.DivCurrentDIBitsSurviveFmac
already pinned.

SYNCFDIV preserved only 0x3CF, clearing sticky IS/DS and re-deriving them
from the current cause, so sticky D/I could never accumulate across two
div ops nor outlive a clean one.

Graduates eight interp rows from kMacroStatusDivergences:
VUSTICKY_DIV_DI_ACCUMULATE, VUSTICKY_FMAC_KEEPS_DI,
VUSTICKY_DI_ACCUMULATE_SQRT_DIV and VUSTICKY_DI_CAUSE_REPLACED_STICKY_KEPT,
slots 2 and 3 of each.

VUSTICKY_CLEAN_DIV_KEEPS_STICKY_DI stays recorded for both engines: its
slot-1 VRSQRT of -0 raises only D where hardware raises D and I, and
slots 2-3 are that missing bit carried forward -- a different defect that
happened to share the old reason text, now corrected.

Also drops VU_STAT_UPDATE's comment claiming it saves the sticky flags
and D/I settings; it assigns and saves neither, which is precisely why
the merge masks have to.

Idea by pstef.
2026-08-02 17:03:02 -07:00
SternXD d983b2b066 Copyright: Change year from 2002-2025 to 2002-2026 2026-01-15 00:22:32 +01:00
TheTechnician27 23fd57f641 Copyright: Change year from 2002-2024 to 2002-2025 2025-01-20 05:07:26 +01:00
GovanifY 132431b7c8 headers: relicense to GPL-3.0+
also update to 2024 while i'm at it
2024-07-30 17:17:13 -04:00
Stenzek d9abe10308 Misc: Remove explicit PCH include, switch to SPDX 2023-12-24 14:03:14 +10:00
Stenzek ff82232e27 Config: Add separate VU0/VU1 round/clamp mode options 2022-12-28 16:36:36 +00:00
refractionpcsx2 52943d8399 VU Int: Link in clamping settings from UI
The only settings are either None or every other option is On (basically Extra + Preserve Sign)
2021-09-12 16:12:31 +01:00
refractionpcsx2 2e2d6ba35d VU Int: IALU stalls, improve VI backup emulation 2021-09-12 16:12:31 +01:00
refractionpcsx2 067faccdd2 VU: Initial work to overhaul VU interpreter
Still a bit janky in some games and subject to changes
2021-09-12 16:12:31 +01:00
Jake.Stine 8375b0a989 Refactoring:
* Added __fi and __ri, which are abbreviations for __forceinline and __releaseinline.
 * Added some static qualifiers to functions in mVU, MMI ops, and others where appropriate.
 * Removed some unnecessary __fastcall qualifiers (since GCC gets funny sometimes when you combine __fastcall and inlining).
 * Made _1mb, _16mb, _1gb values common to all emulation code (moved from newVif/mvu to Common.h) -- they're useful! :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3624 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-09 04:10:38 +00:00
Jake.Stine 70d47bf240 Copyright 2010 : PCSX2 and plugins! (notable exception: didn't update copyright info in any Gabest plugins)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2937 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-05-03 14:08:02 +00:00
sudonim1 4457fe40fc Removed all trailing whitespace in *.c *.cpp *.h because it irritates me.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2897 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-25 00:31:27 +00:00
arcum42 ba37f31849 Trim and tweak a bunch of includes, and a few headers.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2197 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-14 12:02:56 +00:00
Jake.Stine f460985004 Same general cleanups (mostly to the VU interpreters), but on trunk this time. :) Also Fixes Issue 417 (I hope)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1900 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-21 14:19:49 +00:00
Jake.Stine d2fbb22076 Upgraded PCSX2 core and utilities to GPLv3.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1783 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-08 12:08:10 +00:00
Jake.Stine fe6f45e45e Updated the Copyright to reflect the passing of another year. :)
Updated the pcsx2_suite_2008.sln; changed SPU2ghz to SPU2-X.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@502 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-15 23:23:46 +00:00
Jake.Stine 6ebfae8ef1 Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official.
Added interface.cpp (plugin/pcsx2 interface) and savestate.cpp to SPU2ghz, to help clean up SPU2.cpp.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@463 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-09 21:15:56 +00:00
refraction aa94c30dc3 Should be the last of the trunk, gotta finish the branches/tags, but thats the main bulk transferred.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@426 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-06 20:04:37 +00:00