dolphin/Source
Sintendo 17db359979 Jit64: srwx - Optimize shift by constant
More efficient code can be generated if the shift amount is known at
compile time. Similar optimizations were present in JitArm64 already,
but were missing in Jit64.

- By using an 8-bit immediate we can eliminate the need for ECX as a
  scratch register, thereby reducing register pressure and occasionally
  eliminating a spill.

Before:
B9 18 00 00 00       mov         ecx,18h
45 8B C1             mov         r8d,r9d
49 D3 E8             shr         r8,cl

After:
45 8B C1             mov         r8d,r9d
41 C1 E8 18          shr         r8d,18h

- PowerPC has strange shift amount masking behavior which is emulated
  using 64-bit shifts, even though we only care about a 32-bit result.
  If the shift amount is known, we can handle this special case
  separately, and use 32-bit shift instructions otherwise.

Before:
B9 F8 FF FF FF       mov         ecx,0FFFFFFF8h
45 8B C1             mov         r8d,r9d
49 D3 E8             shr         r8,cl

After:
Nothing, register is set to constant zero.

- A shift by zero becomes a simple MOV.

Before:
B9 00 00 00 00       mov         ecx,0
45 8B C1             mov         r8d,r9d
49 D3 E8             shr         r8,cl

After:
45 8B C1             mov         r8d,r9d
2020-12-25 19:30:51 +01:00
..
Android Merge pull request #9357 from JosJuice/android-one-settings-entrypoint 2020-12-24 12:46:43 -05:00
Core Jit64: srwx - Optimize shift by constant 2020-12-25 19:30:51 +01:00
DSPSpy DSPSpy: sync Makefile with current devkitPro template 2020-06-08 04:21:41 +01:00
DSPTool msbuild: re-enable standalone vcxproj processing 2020-08-22 16:17:50 -07:00
PCH Merge pull request #9091 from shuffle2/pch 2020-10-29 21:29:28 +01:00
UnitTests Merge pull request #9307 from Dentomologist/add-deleted-file-missing-warning-flag 2020-12-11 02:06:28 +01:00
VSProps DolphinQt: Stop using qtmain 2020-09-21 17:27:10 +02:00
.clang-format Require clang-format 9 and reformat source code 2020-01-08 22:18:15 +01:00
CMakeLists.txt Turn format string issues into compile-time errors 2020-12-04 18:06:02 +01:00
dolphin-emu.sln Externals: Add zstd 2020-05-13 20:53:10 +02:00