rpcsx/rpcs3/util/sysinfo.hpp

83 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
2020-12-12 13:01:29 +01:00
#include "util/types.hpp"
#include <string>
namespace utils
{
2017-11-09 18:33:18 +01:00
bool has_ssse3();
bool has_sse41();
2017-11-09 18:33:18 +01:00
bool has_avx();
2017-12-16 01:19:21 +01:00
bool has_avx2();
2017-11-09 18:33:18 +01:00
bool has_rtm();
2017-07-18 19:03:47 +02:00
bool has_tsx_force_abort();
bool has_rtm_always_abort();
2018-06-13 13:54:16 +02:00
bool has_mpx();
bool has_avx512();
2017-12-16 01:19:21 +01:00
bool has_avx512_icl();
bool has_avx512_vnni();
2018-01-16 12:32:57 +01:00
bool has_xop();
2019-11-14 17:09:34 +01:00
bool has_clwb();
bool has_invariant_tsc();
bool has_fma3();
bool has_fma4();
bool has_erms();
bool has_fsrm();
2020-02-20 03:55:25 +01:00
std::string get_cpu_brand();
std::string get_system_info();
std::string get_firmware_version();
std::string get_OS_version();
int get_maxfiles();
bool get_low_power_mode();
ullong get_tsc_freq();
2020-02-20 03:55:25 +01:00
u64 get_total_memory();
u32 get_thread_count();
2020-12-09 19:29:48 +01:00
u32 get_cpu_family();
u32 get_cpu_model();
// A threshold of 0xFFFFFFFF means that the rep movsb is expected to be slow on this platform
u32 get_rep_movsb_threshold();
extern const u64 main_tid;
PPU LLVM arm64+macOS port (#12115) * BufferUtils: use naive function pointer on Apple arm64 Use naive function pointer on Apple arm64 because ASLR breaks asmjit. See BufferUtils.cpp comment for explanation on why this happens and how to fix if you want to use asmjit. * build-macos: fix source maps for Mac Tell Qt not to strip debug symbols when we're in debug or relwithdebinfo modes. * LLVM PPU: fix aarch64 on macOS Force MachO on macOS to fix LLVM being unable to patch relocations during codegen. Adds Aarch64 NEON intrinsics for x86 intrinsics used by PPUTranslator/Recompiler. * virtual memory: use 16k pages on aarch64 macOS Temporary hack to get things working by using 16k pages instead of 4k pages in VM emulation. * PPU/SPU: fix NEON intrinsics and compilation for arm64 macOS Fixes some intrinsics usage and patches usages of asmjit to properly emit absolute jmps so ASLR doesn't cause out of bounds rel jumps. Also patches the SPU recompiler to properly work on arm64 by telling LLVM to target arm64. * virtual memory: fix W^X toggles on macOS aarch64 Fixes W^X on macOS aarch64 by setting all JIT mmap'd regions to default to RW mode. For both SPU and PPU execution threads, when initialization finishes we toggle to RX mode. This exploits Apple's per-thread setting for RW/RX to let us be technically compliant with the OS's W^X enforcement while not needing to actually separate the memory allocated for code/data. * PPU: implement aarch64 specific functions Implements ppu_gateway for arm64 and patches LLVM initialization to use the correct triple. Adds some fixes for macOS W^X JIT restrictions when entering/exiting JITed code. * PPU: Mark rpcs3 calls as non-tail Strictly speaking, rpcs3 JIT -> C++ calls are not tail calls. If you call a function inside e.g. an L2 syscall, it will clobber LR on arm64 and subtly break returns in emulated code. Only JIT -> JIT "calls" should be tail. * macOS/arm64: compatibility fixes * vm: patch virtual memory for arm64 macOS Tag mmap calls with MAP_JIT to allow W^X on macOS. Fix mmap calls to existing mmap'd addresses that were tagged with MAP_JIT on macOS. Fix memory unmapping on 16K page machines with a hack to mark "unmapped" pages as RW. * PPU: remove wrong comment * PPU: fix a merge regression * vm: remove 16k page hacks * PPU: formatting fixes * PPU: fix arm64 null function assembly * ppu: clean up arch-specific instructions
2022-06-14 14:28:38 +02:00
#ifdef LLVM_AVAILABLE
#if defined(ARCH_X64)
const std::string c_llvm_default_triple = "x86_64-unknown-linux-gnu";
#elif defined(ARCH_ARM64)
const std::string c_llvm_default_triple = "arm64-unknown-linux-gnu";
#else
const std::string c_llvm_default_triple = "Unimplemented!"
#endif
#endif
}