Commit Graph

33920 Commits

Author SHA1 Message Date
ecbf6fff74 Jit64: boolX - Mark locals as const 2021-01-28 23:52:21 +01:00
2d3c7fca8d Jit64: boolX - Optimize or for size
OR allows for a more compact representation for constants that can be
represented by a signed 8-bit integer, while MOV does not. By letting
MOV handle the larger constants we can occasionally save a byte.

Before:
45 8B F5             mov         r14d,r13d
41 81 CE 00 80 01 00 or          r14d,18000h

After:
41 BE 00 80 01 00    mov         r14d,18000h
45 0B F5             or          r14d,r13d
2021-01-28 23:16:48 +01:00
62f80a008c Jit64: boolX - Special case or with 0
Bitwise or with zero is just a fancy MOV, really.

- Example 1
Before:
41 BA 00 00 00 00    mov         r10d,0
45 0B D1             or          r10d,r9d

After:
45 8B D1             mov         r10d,r9d

- Example 2
Before:
41 83 CA 00          or          r10d,0

After:
Nothing!
2021-01-28 23:16:48 +01:00
356172bc98 Jit64: boolX - Optimize and for size
AND allows for a more compact representation for constants that can be
represented by a signed 8-bit integer, while MOV does not. By letting
MOV handle the larger constants we can occasionally save a byte.

Before:
41 8B FE             mov         edi,r14d
81 E7 FF FE FF FF    and         edi,0FFFFFEFFh

After:
BF FF FE FF FF       mov         edi,0FFFFFEFFh
41 23 FE             and         edi,r14d
2021-01-28 23:16:48 +01:00
b760a56a9a Jit64: boolX - Special case and with 0xFFFFFFFF
Bitwise and with all ones doesn't accomplish much.

Before:
41 8B F5             mov         esi,r13d
83 E6 FF             and         esi,0FFFFFFFFh

After:
41 8B F5             mov         esi,r13d
2021-01-28 23:16:48 +01:00
34dbfd92db Jit64: boolX - Special case and with 0
Bitwise and with zero is always zero.

Before:
45 8B F8             mov         r15d,r8d
41 83 E7 00          and         r15d,0

After:
Nothing, register a is set to constant 0.
2021-01-28 23:16:48 +01:00
131163d33b Jit64: boolX - Remove andcx immediate checks
All cases involving immediate values are now guaranteed to be handled
elsewhere, making these checks redundant.
2021-01-28 23:16:48 +01:00
845d7cd51f Jit64: boolX - Optimize xor for size
XOR allows for a more compact representation for constants that can be
represented by a signed 8-bit integer, while MOV does not. By letting
MOV handle the larger constants we can occasionally save a byte.

Before:
44 89 F7             mov         edi,r14d
81 F7 A0 52 57 01    xor         edi,15752A0h

After:
BF A0 52 57 01       mov         edi,15752A0h
41 33 FE             xor         edi,r14d
2021-01-28 23:16:48 +01:00
c3775588df Jit64: boolX - Special case xor with 0xFFFFFFFF
Ever so slightly shorter.

When the condition register needs updating, we still prefer xor over
not+test.

Before:
45 8B F5             mov         r14d,r13d
41 83 F6 FF          xor         r14d,0FFFFFFFFh

After:
45 8B F5             mov         r14d,r13d
41 F7 D6             not         r14d
2021-01-28 23:16:31 +01:00
c9011e9d2c Jit64: boolX - Special case xor with 0
No computation necessary, but we may need a MOV.

Before:
8B FE                mov         edi,esi
83 F7 00             xor         edi,0

After:
8B FE                mov         edi,esi
2021-01-28 23:09:14 +01:00
3677a5035c Jit64: boolX - Precompute complement for eqvx
In the case of eqvx, the final complement can always be baked directly
into the immediate value.

Before:
45 8B EF             mov         r13d,r15d
41 F7 D5             not         r13d
41 83 F5 04          xor         r13d,4

After:
45 8B EF             mov         r13d,r15d
41 83 F5 FB          xor         r13d,0FFFFFFFBh
2021-01-28 23:06:00 +01:00
26f70657bc Jit64: boolX - Precompute complement of b
PowerPC instructions andcx and orcx complement the value of register b
before performing their respective bitwise operation. If this register
happens to contain a known value, we can precompute the complement,
allowing us to generate simpler code.

- andcx
Before:
BF 00 01 00 00       mov         edi,100h
F7 D7                not         edi
41 23 FE             and         edi,r14d

After:
41 8B FE             mov         edi,r14d
81 E7 FF FE FF FF    and         edi,0FFFFFEFFh

- orc
Before:
41 BE 04 00 00 00    mov         r14d,4
41 F7 D6             not         r14d
45 0B F5             or          r14d,r13d

After:
45 8B F5             mov         r14d,r13d
41 83 CE FB          or          r14d,0FFFFFFFBh
2021-01-28 23:04:35 +01:00
LC
caff472dbf Merge pull request #9459 from iwubcode/freelook_state_lock
FreeLookManager: acquire global input lock
2021-01-21 12:07:58 -05:00
af7384002f FreeLookManager: acquire global input lock before accessing individual FreeLook control states 2021-01-20 12:25:21 -06:00
ebf3b5faf4 Merge pull request #9451 from Sintendo/jit64boolxrw
Jit64: boolx - Eliminate read dependency
2021-01-19 15:40:43 +01:00
LC
04ccd4cb80 Merge pull request #9446 from Dentomologist/convert_shifttype_to_enum_class
Arm64Emitter: Convert ShiftType to enum class
2021-01-18 05:26:22 -05:00
e3237661ec Arm64Emitter: Convert ShiftType to enum class 2021-01-17 16:21:38 -08:00
8964612577 Jit64: boolx - Eliminate read dependency
For certain occurrences of nandx/norx, we declare a ReadWrite constraint
on the destination register, even though the value of the destination
register is irrelevant. This false dependency would force the RegCache
to generate a redundant MOV when the destination register wasn't already
assigned to a host register.

Example 1:
BF 00 00 00 00       mov         edi,0
8B FE                mov         edi,esi
F7 D7                not         edi

Example 2:
8B 7D 80             mov         edi,dword ptr [rbp-80h]
8B FE                mov         edi,esi
F7 D7                not         edi
2021-01-17 21:32:28 +01:00
e62fa1ea9f Translation resources sync with Transifex 2021-01-17 18:55:27 +01:00
f383397c9c Merge pull request #9447 from Dentomologist/convert_indextype_to_enum_class
Arm64Emitter: Convert IndexType to enum class
2021-01-17 12:23:53 +01:00
LC
be74e35a0a Merge pull request #9443 from Simonx22/update-gradle
Android: Update Gradle Plugin to 4.1.1
2021-01-16 06:55:10 -05:00
LC
1476c10a87 Merge pull request #9445 from Simonx22/update-dependencies
Android: Update dependencies to the latest version
2021-01-16 06:54:45 -05:00
7d73da717c Merge pull request #9444 from Simonx22/remove-duplicate-keys
gradle.properties: Remove duplicate property keys
2021-01-16 12:34:00 +01:00
70c54065ab Arm64Emitter: Convert IndexType to enum class 2021-01-15 23:27:11 -08:00
5b98336e54 Android: Update dependencies to the latest version 2021-01-15 19:55:57 -05:00
8f2a2f3cda Android: Update Gradle Plugin to 4.1.1 2021-01-15 19:53:08 -05:00
67bc2f9f76 gradle.properties: Remove duplicate property keys 2021-01-16 01:12:31 +01:00
LC
aba179e4ba Merge pull request #9385 from MerryMage/more-bmi2
Jit_Integer: Use SHLX, SHRX, SARX
2021-01-14 21:40:45 -05:00
LC
0c2bc3582d Merge pull request #9425 from Sintendo/jit64subfx
Jit64: subfx optimizations
2021-01-14 21:40:05 -05:00
LC
8f67a1961f Merge pull request #9442 from Stevoisiak/patch-1
Contributing.md: Code comment for do-while sample
2021-01-14 18:45:00 -05:00
c121dc3410 Contributing.md: Code comment for do-while sample 2021-01-14 13:58:55 -05:00
LC
7fdd4afd9c Merge pull request #9437 from Pokechu22/GX_CMD_UNKNOWN_METRICS
Use GX_CMD_UNKNOWN_METRICS instead of magic number 0x44
2021-01-12 04:09:54 -05:00
d55f9369c7 Use GX_CMD_UNKNOWN_METRICS instead of magic number 0x44 2021-01-11 12:41:04 -08:00
LC
79a234eff7 Merge pull request #9435 from shuffle2/constexpr-error
BitUtils: cleanup constexpr usage for msvc clz
2021-01-10 14:58:20 -05:00
fc65f65891 BitUtils: cleanup constexpr usage for msvc clz 2021-01-10 10:06:30 -08:00
LC
87debc6641 Merge pull request #9433 from shuffle2/constexpr-error
BitUtils: loosen clz to inline on msvc/arm64
2021-01-10 03:45:59 -05:00
65ecf1e43e BitUtils: loosen clz to inline on msvc/arm64 2021-01-09 23:44:00 -08:00
LC
a613c2a5e4 Merge pull request #9429 from Sintendo/jit64fixoverflow
Jit64: Fix FinalizeCarryOverflow XER[OV/SO]
2021-01-10 01:58:06 -05:00
LC
59fa613020 Merge pull request #9431 from shuffle2/msvc-gdbstub
msbuild: enable USE_GDBSTUB
2021-01-10 01:56:46 -05:00
LC
75e19a0c29 Merge pull request #9430 from shuffle2/vsupdate
Bump msvc version check and revert a msvc workaround
2021-01-10 01:46:28 -05:00
LC
1f0e3371a3 Merge pull request #9432 from shuffle2/constexpr-error
BitUtils: initialize variables
2021-01-10 01:44:58 -05:00
f0a6244768 msbuild: enable USE_GDBSTUB
this does nothing about it actually being usable
2021-01-09 22:26:55 -08:00
1e5e5ea855 BitUtils: initialize variables
fixes C3615 on some msvc/cmake configs
2021-01-09 22:18:29 -08:00
cce275c16e Revert "msvc: temporary workaround for C4789 false positive"
This reverts commit deb73d0167.
2021-01-09 19:22:36 -08:00
c8316f70a4 msvc: bump _MSC_FULL_VER check to 192829335 2021-01-09 19:21:03 -08:00
305cd31bd9 Jit64: Fix FinalizeCarryOverflow XER[OV/SO]
FinalizeCarryOverflow didn't maintain XER[OV/SO] properly due to an
oversight. Here's the code it would generate:

0:  9c                      pushf
1:  80 65 3b fe             and    BYTE PTR [rbp+0x3b],0xfe
5:  71 04                   jno    b <jno>
7:  c6 45 3b 03             mov    BYTE PTR [rbp+0x3b],0x3
000000000000000b <jno>:
b:  9d                      popf

At first glance it seems reasonable. The host flags are carefully
preserved with PUSHF. The AND instruction clears XER[OV]. Next, an
conditional branch checks the host's overflow flag and, if needed, skips
over a MOV that sets XER[OV/SO]. Finally, host flags are restored with
POPF.

However, the AND instruction also clears the host's overflow flag. As a
result, the branch that follows it is always taken and the MOV is always
skipped. The end result is that XER[OV] is always cleared while XER[SO]
is left unchanged.

Putting POPF immediately after the AND would fix this, but we already
have GenerateOverflow doing it correctly (and without the PUSHF/POPF
shenanigans too). So let's just use that instead.
2021-01-09 22:52:18 +01:00
0776263c5e Merge pull request #9428 from JosJuice/tv-folder-picker
Android: Use old folder picker on Android TV
2021-01-09 11:54:02 +01:00
116a5a79da Android: Use old folder picker on Android TV
See the comment I added to the code. This is a rather serious
issue for Android TV users from what I've heard.
2021-01-08 16:27:33 +01:00
4cdcbb6ab2 Merge pull request #9308 from smurf3tte/re23_patch
Patches for Resident Evil 2/3 audio issues
2021-01-06 01:52:15 +01:00
0b1db65aa1 Merge pull request #9405 from Filoppi/patch-7
Rename "Use Fullscreen" setting to "Start in Fullscreen"
2021-01-06 01:44:46 +01:00