pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

VU: Expand IBit hack to work for immediates on several instructions

Open refractionpcsx2 opened this issue 10 months ago • 2 comments

Description of Changes

Expand the IBit hack to several commands using immediates, to help reduce recompilation on games which modify these values a lot.

Rationale behind Changes

Games like Shellshock - Nam '67 and Killzone modify their VU programs a lot, changing immediate values and nothing else in several cases, This expands the IBit hack to try and ignore these differences and load the values from RAM instead of compiling new program.

Suggested Testing Steps

Test Shellshock - Nam '67, Killzone, Scarface and Crash Tag Team racing. If you know any other games that recompile constantly, try enabling the IBit gamefix and see if that helps.

Reduces VU compilation in Killzone by about half Reduces VU compilation in Shellshock - Nam '67 by roughly 10% (reduces hitching by a bit)

refractionpcsx2 avatar Apr 21 '24 07:04 refractionpcsx2

Returning nullopt in mVUoptimizeConstantAddr() would be cleaner, but I can't remember every place I added that to.

Assembly changes LGTM, untested.

stenzek avatar Apr 23 '24 10:04 stenzek

Returning nullopt in mVUoptimizeConstantAddr() would be cleaner, but I can't remember every place I added that to.

Assembly changes LGTM, untested.

Done :)

refractionpcsx2 avatar Apr 26 '24 09:04 refractionpcsx2