add split_map class for mapping keys to values in a way that optimizes for frequent searches and infrequent insertions/removals remove jump table implementation of GetColorRenderTargetFormatComponentCount, it was appearing relatively high in profiles. instead pack the component counts into a single 32 bit word, which is indexed by shifting Add cvar to align all basic blocks to a boundary Add mmio aware load paths liberally apply XE_RESTRICT in ringbuffer related code Removed the IS_TRUE and IS_FALSE opcodes, they were pointless duplicates of COMPARE_EQ/COMPARE_NE and i want to simplify our set of opcodes for future backends More work on LVSR/LVSL/STVR/STVL opcodes Optimized X64 translated code emission, now only compute instrkey once Add code for pre-computing integer division magic numbers Optimized GetHostViewportInfo a little Move args for GetHostViewportInfo into a class, cache the result and compare for future queries. moved GetHostViewportInfo far lower on the profile Add (currently not functional, and very racy) asynchronous memcpy code. will improve it and actually use it in future commits. Add non-temporal memcpy function for huge page-aligned allocations. Used for copying to shared memory/readback hoist are_accumulated_render_targets_valid_ check out of loop in render_target_cache already bound check. Add stosb/movsb code for small constant memcpys/memsets that arent worth the overhead of memcpy/memset
56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
/**
|
|
******************************************************************************
|
|
* Xenia : Xbox 360 Emulator Research Project *
|
|
******************************************************************************
|
|
* Copyright 2014 Ben Vanik. All rights reserved. *
|
|
* Released under the BSD license - see LICENSE in the root for more details. *
|
|
******************************************************************************
|
|
*/
|
|
|
|
#ifndef XENIA_CPU_BACKEND_X64_X64_SEQUENCES_H_
|
|
#define XENIA_CPU_BACKEND_X64_X64_SEQUENCES_H_
|
|
|
|
#include "xenia/base/logging.h"
|
|
#include "xenia/cpu/hir/instr.h"
|
|
|
|
#include <unordered_map>
|
|
#define assert_impossible_sequence(name) \
|
|
assert_always("impossible sequence hit" #name); \
|
|
XELOGE("impossible sequence hit: {}", #name)
|
|
|
|
namespace xe {
|
|
namespace cpu {
|
|
namespace backend {
|
|
namespace x64 {
|
|
|
|
class X64Emitter;
|
|
|
|
typedef bool (*SequenceSelectFn)(X64Emitter&, const hir::Instr*, uint32_t ikey);
|
|
extern std::unordered_map<uint32_t, SequenceSelectFn> sequence_table;
|
|
|
|
template <typename T>
|
|
bool Register() {
|
|
sequence_table.insert({T::head_key(), T::Select});
|
|
return true;
|
|
}
|
|
|
|
template <typename T, typename Tn, typename... Ts>
|
|
static bool Register() {
|
|
bool b = true;
|
|
b = b && Register<T>(); // Call the above function
|
|
b = b && Register<Tn, Ts...>(); // Call ourself again (recursively)
|
|
return b;
|
|
}
|
|
#define EMITTER_OPCODE_TABLE(name, ...) \
|
|
const auto X64_INSTR_##name = Register<__VA_ARGS__>();
|
|
|
|
bool SelectSequence(X64Emitter* e, const hir::Instr* i,
|
|
const hir::Instr** new_tail);
|
|
|
|
} // namespace x64
|
|
} // namespace backend
|
|
} // namespace cpu
|
|
} // namespace xe
|
|
|
|
#endif // XENIA_CPU_BACKEND_X64_X64_SEQUENCES_H_
|