summaryrefslogtreecommitdiff
path: root/Source/Core/Common/x64Emitter.cpp
AgeCommit message (Collapse)Author
2024-07-21Emitters: Define Trivial Getters Inlinemitaclaw
2023-06-17xEmitter: Convert PrefetchLevel to enum classDentomologist
2023-06-12XEmitter: Add enum class JumpDentomologist
Replace the bool parameter force5bytes in J, JMP, and J_CC with an enum class Jump::Short/Near. Many callers set that parameter to the literal 'true', which was unclear if you didn't already know what it did.
2022-01-09Common/Assert: Switch to fmtPokechu22
2021-12-10Treewide: Adjust order of includesPokechu22
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-06-28x64Emitter: remove unused x87 instructionsTillmann Karras
2020-12-02General: Convert PanicAlerts over to fmt equivalentLioncash
Converts lingering panic alert calls over to the fmt-capable ones.
2020-10-23Common: Migrate logging to fmtLioncash
Continues the migration of our code over to the fmt logger.
2020-08-24x64Emitter: Check end of allocated space when emitting code.Admiral H. Curtiss
2020-01-13X64Emitter: Remove obsolete TODOSintendo
TODO was already taken care of in PR #941.
2020-01-13x64Emitter: Refactor OpArg::WriteRestSintendo
Shorter, displacement is now handled in one location.
2020-01-13x64Emitter: Avoid 8-bit displacement when possibleSintendo
Due to the way the ModRM encoding works on x86, memory addressing combinations involving RBP or R13 need an additional byte for an 8-bit displacement of zero. However, this was also applied in cases where it is unnecessary, effectively wasting a byte. - MatR with RSP or R12 8B 44 24 00 mov eax,dword ptr [rsp] 8B 04 24 mov eax,dword ptr [rsp] - MRegSum with base != RBP or R13 46 8D 7C 37 00 lea r15d,[rdi+r14] 46 8D 3C 37 lea r15d,[rdi+r14] - MComplex without offset 8B 4C CA 00 mov ecx,dword ptr [rdx+rcx*8] 8B 0C CA mov ecx,dword ptr [rdx+rcx*8]
2019-05-29x64Emitter: Short MOVs for 32bit immediatesSintendo
Prior to this commit, the emitter would emit a 7-byte instruction when loading a 32-bit immediate to a 64-bit register. 0: 48 c7 c0 ff ff ff 7f mov rax,0x7fffffff With this change, it will check if it can instead emit a load to a 32-bit register, which takes only 5 or 6 bytes. 0: b8 ff ff ff 7f mov eax,0x7fffffff
2019-05-22Merge pull request #8027 from MerryMage/MOVAPSConnor McLaughlin
Jit64: Prefer MOVAPS where possible
2019-05-06Reformat repo to clang-format 7.0 rulesTechjar
2019-04-27x64Emitter: Prefer MOVAPS to MOVSDMerryMage
* The high half of regOp is immediately overwritten so the value in it is irrelevant. * MOVSD produces an unnecessary dependency on the high half of regOp. * MOVAPS is implemented as a register rename on modern microarchitectures.
2019-04-27x64Emitter: Prefer MOVAPS to MOVAPDMerryMage
There is no reason to use MOVAPD over MOVAPS, for two reasons: * There has never been a microarchitecture with separate single and double domains. * MOVAPD is one byte longer than MOVAPS
2018-12-26x64Emitter: Add some single-precision instructionsMerryMage
2018-10-06Merge pull request #7414 from Sintendo/shortmovsTilka
x64Emitter: emit shorter MOVs for 64-bit immediates
2018-09-29x64Emitter: nit, use helper method in CMP_or_TESTSintendo
2018-09-16x64Emitter: short MOV for 64bit immediates (2)Sintendo
Prior to this commit, the emitter would unconditionally emit a 10-byte instruction known as MOVABS when loading a 64-bit immediate to a register. 0: 48 b8 ef be ad de 00 movabs rax,0xdeadbeef 7: 00 00 00 With this change, it will instead rely on the fact that on x64 writes to 32-bit registers are automatically zero extended to 64-bits, allowing us to emit a 5 or 6-bytes instruction with the same effect for certain immediates. 0: b8 ef be ad de mov eax,0xdeadbeef
2018-09-14x64Emitter: short MOV for 64bit immediates (1)Sintendo
Prior to this commit, the emitter would unconditionally emit a 10-byte instruction known as MOVABS when loading a 64-bit immediate to a register. 0: 48 b8 ef be ad de ff movabs rax,0xffffffffdeadbeef 7: ff ff ff With this change, it will instead emit a 7-byte instruction when it is possible to express the 64-bit immediate using a signed 32-bit value. 0: 48 c7 c0 ef be ad de mov rax,0xffffffffdeadbeef
2018-05-06x64Emitter: Use an enum class to represent FixupBranch branch typesLioncash
Gets rid of the use of magic values and replaces them with strongly typed symbolic names.
2018-04-12x64Emitter: Make the Align* functions return a non-const data pointerLioncash
There's no real requirement to make this const, and this should also be decided by the calling code, considering we had places that would simply cast away the const and carry on.
2018-04-12Reformat all the things!spycrab
2018-03-18x64Emitter: Make FloatOp and NormalOp enum classesLioncash
Reduces the amount of identifiers placed in the Gen namespace internally.
2018-03-18x64Emitter: Move FloatOp and NormalOp enums to the cpp fileLioncash
These are only used internally. This also allows us to eliminate some symbols that get dumped into the exposed Gen namespace. By extension this also hides the Write[X] functions from OpArg's public interface. This is only used internally by XEmitter, so they shouldn't be usable by anything else.
2018-03-16Assert: Remove unused parameter from DEBUG_ASSERTLioncash
This brings the macro in line with the regular ASSERT macro, which only has one macro parameter.
2018-03-14Assert: Uppercase assertion macrosLioncash
Macros should be all upper-cased. This is also kind of a wart that's been sticking out for quite a while now (we avoid prefixing underscores).
2017-04-12x64Emitter: Allow code alignment to arbitrary power of 2MerryMage
2017-01-28Jit64: Enable branch following.degasus
2016-08-31x64Emitter: Generify ABI_CallFunction variantsLioncash
Gets rid of the need to cast to void* just to use the functions.
2016-07-01Jit: Remove unsafe MOV optimizationhthh
This optimization broke arithXex in rare cases by emitting XOR where MOV was expected.
2016-06-27Add MOV optimization and MOV_sumMatt Mastracci
Replaces incarnations of the A=B+C pattern throughout the code so we can apply optimizations consistently.
2016-06-27Refactor fastmem/trampoline code.Matt Mastracci
Simplication to avoid reading back the generated instructions, allowing us to handle all possible cases.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2015-09-17x64Emitter: Remove pointer castLioncash
No more ubsan asserts in the JIT and x64 emitter code paths when running starfield.
2015-09-11Partially revert "General: Toss out PRI macro usage"Lioncash
2015-09-05General: Toss out PRI macro usageLioncash
Now that VS supports more printf specifiers, these aren't necessary
2015-08-26Jit64: some byte-swapping changesTillmann Karras
2015-08-23x64Emitter: add RCPPS and RCPSS SSE instructionsaroulin
2015-08-21x64Emitter: Remove pointer casts from Write{8,16,32,64} functionsLioncash
This also silences quite a few ubsan asserts from firing when the emitter is being used.
2015-08-20x64Emitter: Remove unused codeLioncash
2015-08-14x64Emitter: don't check flags for most BMI2 opsTillmann Karras
With the exception of BZHI, BMI2 instructions don't affect flags, so don't check if they're locked.
2015-08-14x64Emitter: check for immediates in BMI opsTillmann Karras
2015-08-06x64Emitter: add MOVSLDUP/MOVSHDUPTillmann Karras
2015-06-07zfreeze: cache vertex positionsTillmann Karras
Suggested by degasus.
2015-06-02XEmitter: add FMA4 instructionsTillmann Karras
2015-05-29x64Emitter: Pass some OpArg parameters by const referenceLioncash
Considering OpArg is a struct, passing by value creates unnecessary copies.