Commit Graph

95 Commits

Author SHA1 Message Date
Nekotekina
2d38d8a639 Fix NEVER_INLINE attribute
Similarly to FORCE_INLINE, it doesn't imply inline on some compilers.
2020-11-04 14:59:25 +03:00
Nekotekina
c491b73f3a SPU: improve accurate DMA
Remove vm::reservation_lock from it.
Use lock bits to prevent memory clobbering in GETLLAR.
Improve u128 for MSVC since it's used for bitlocking.
Improve 128 bit atomics for the same reason.
Improve vm::reservation_op and friends.
2020-10-28 03:47:41 +03:00
Nekotekina
d344701fd5 atomic.cpp: add sparse atomics
Set alignment as second template argument (typically cache line).
2020-10-26 01:15:31 +03:00
Eladash
c628147521 cellSpurs: Implement more HLE functions (part 1) 2020-10-07 01:12:21 +03:00
Eladash
25dee4a78e Fix bitops test 2020-08-17 17:36:27 +01:00
Bevan Weiss
01d3585bf3 Bring back the non-compliant define, but version limited
As noted, we've done something we shouldn't have with MSVC compiler specific defines.  But to avoid breaking the MSVC build environment, leave this define in there until the MSVC version when it is actually exposed by the compiler itself (v16.8).
2020-08-14 18:34:34 +01:00
Bevan Weiss
a11afe05bf MSVC changes
Add support for compilation on x64 toolchain (x86 cl.exe was running out of heap space in vm.cpp)

Also took the opportunity to change compile optimisation from /Ox to /O2, as /O2 provides better optimisation than does /Ox

Also, we shouldn't be explicitely setting compiler tool defines (__cpp_lib_bitops), so remove that from types.h
2020-08-14 18:34:34 +01:00
Bevan Weiss
c5d39ace2b
Update types.h to fix static_cast test (#8627)
Trivial fix up to resolve invalid is_constructible test (To,To) to match desired (To,From)
2020-07-25 09:46:47 +01:00
Eladash
c1a80b8146 Minor fixup after #8501 2020-07-16 21:52:08 +03:00
Eladash
58e2465369 Make std::bit_cast hack-implementation constexpr in simple cases 2020-07-14 12:14:44 +03:00
Eladash
d9e3f0ccfa types.h: Fix ASSUME macro side-effects mismatch between compilers 2020-06-29 03:10:05 +01:00
Eladash
9cb4402c16 Make error_code::value member private 2020-06-27 09:02:55 +01:00
Nekotekina
ae519200ed Implement std::countl_zero and friends
Trying to fix macos build.
2020-05-18 00:51:57 +03:00
Nekotekina
d0c199d455 Replace utils::cnttz{32,64} with std::countr_{zero,one}
Make #include <bit> mandatory.
2020-04-14 16:05:58 +03:00
Eladash
926e0467cf Another ::as_rvalue fixup 2020-04-13 04:34:10 +01:00
Eladash
8e61c65c0d Fixup ::as_rvalue 2020-04-11 22:55:55 +03:00
Eladash
141d62fbf9 Implement ::as_rvalue 2020-04-11 21:58:36 +03:00
Nekotekina
b33648fd14 Implement SAFE_BUFFERS as __attribute__((no_stack_protector))
It was doing nothing outside of MSVC. Still seems doing nothing.
2020-03-25 11:18:48 +03:00
Nekotekina
aa5c6c4d2b Cleanup std::is_pod usage (deprecated in C++20) 2020-03-18 18:28:46 +03:00
Nekotekina
4d1f818162 umax: restore "natural" operation order 2020-02-20 17:13:41 +03:00
Nekotekina
2f255a528e Another attempt on umax 2020-02-20 15:18:31 +03:00
Nekotekina
0cf35e3b22 Implement umax global variable (max unsigned value)
Implements operators == and != comparisons.
2020-02-19 22:54:58 +03:00
Nekotekina
6a1a0bf48d Use std::endian for endianness test
Remove legacy IS_LE_MACHINE IS_BE_MACHINE macro.
2020-02-17 21:33:24 +03:00
Nekotekina
c0f80cfe7a Use attributes for LIKELY/UNLIKELY
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Megamouse
ef6f565dbd silence some annoying warnings 2019-12-28 15:40:57 +01:00
Nekotekina
baf9a20c08 Fix UB in to_u8
Possible signed shift overflow.
2019-12-23 22:56:18 +03:00
Eladash
db4041e079 Implement rounded_div
Round-to-nearest integral based division, optimized for unsigned integral.
Used in sceNpTrophyGetGameProgress.
Do not allow signed values for aligned_div(), align().
2019-12-20 14:47:04 +03:00
Emmanuel Gil Peyrot
ef368c5171 rsx: Replace gsl::byte with C++17’s std::byte 2019-11-09 19:30:05 +01:00
Nekotekina
b338014639 Don't throw in operators _u16 _u32 _u64 2019-11-08 19:27:11 +03:00
Nekotekina
bd1a24b894 Tidy endianness support (se_t) implementation
Move se_t and se_storage to util/endian.hpp
Use single template instead of two specializations.
Add minor optimization for MSVC.
Remove v128 dependency.
Try to enable intrinsics for unaligned data.
Fix minor bug in u16/u32/u64 specializations.
2019-09-28 15:39:50 +03:00
Nekotekina
aaf1b4c668 Fix gcc warning in bit_cast 2019-09-08 19:27:29 +03:00
Nekotekina
ec2db8edbc Correct get_int_t to get_uint_t.
Add get_sint_t.
2019-07-29 00:12:07 +03:00
Eladash
d57b4dc8f3 rsx: Refactor rsx_decode.h and bugfixes 2019-07-09 11:52:34 +03:00
Nekotekina
db4bc6f6be Add RESTRICT macro
Applied as C keyword 'restrict'
2019-07-08 19:43:16 +03:00
Eladash
1ee7b91646 Refactoring (#6143)
Prefer vm::ptr<>::ptr over vm::get_addr.
    Prefer vm::_ptr/base over vm::g_base_addr with offset.
    Added methods atomic_t<>::bts and atomic_t<>::btr .
    Removed obsolute rsx:🧵:Read/WriteIO32 methods.
    Removed wrong check in semaphore_release.
    Added handling for PUTRx commands for RawSPU MFC proxy.
    Prefer overloaded methods of v128 instead of _mm_... in VPKSHUS ppu interpreter precise.
    Fixed more potential overflows that may result in wrong behaviour.
    Added io/size alignment check for sys_rsx_context_iounmap.
    Added rsx::constants::local_mem_base which represents RSX local memory base address.
    Removed obsolute rsx:🧵:main_mem_addr/ioSize/ioAddress members.
2019-06-29 01:27:49 +03:00
Nekotekina
dfd50d0185 Implement std::bit_cast<>
Partial implementation of std::bit_cast from C++20.
Also fix most strict-aliasing rule break warnings (gcc).
2019-06-02 23:22:16 +03:00
Nekotekina
5d33d9a3d9 Enable most warnings in GCC 2019-05-11 02:13:19 +03:00
Nekotekina
7f6a410770 Add dummy __has_builtin macro, use rotate builtins if possible 2019-03-01 00:08:19 +03:00
Rui Pinheiro
a07cbaca8e Update ASSUME, add ASSERT and AUDIT
- ASSUME now uses __builtin_assume in clang
- ASSERT defined as a wrapper around verify
- AUDIT aliases ASSERT when _DEBUG or _AUDIT are set, otherwise empty
2018-09-24 15:26:40 +03:00
Nekotekina
fb5cdf9769 atomic_t<>: extend fetch_op to support cancellation
Use std::invoke inside atomic_op/fetch_op
Remove op_fetch because it's easily replaced
Add fetch_dec_sat algorithm (conditional decrement)
2018-09-08 00:32:04 +03:00
Nekotekina
ed9fb8405b Move rotate/cntlz/cnttz helpers to Utilities/asm.h 2018-09-08 00:32:04 +03:00
Nekotekina
ee96807305 Remove explicit_bool_t, ignore, multicast<>
Remove vm::ptr operator %
This was a bad idea but explicit_bool_t was created almost for it
Other removed types are unused and have little to no meaning
2018-09-08 00:32:04 +03:00
Nekotekina
ce4c4696dd Try to get rid of SIZE_32 macro 2018-09-03 21:40:36 +03:00
Nekotekina
8abe6489ed Mega-cleanup for atomic_t<> and named bit-sets bs_t<>
Remove "atomic operator" classes
Remove test, test_and_set, test_and_reset, test_and_complement global functions
Simplify atomic_t<> with constexpr if, remove some garbage
Redesign bs_t<> to use class, mark its methods constexpr
Implement atomic_bs_t<> for optimizations
Remove unused __bitwise_ops concept (should be in other header anyway)
Bitsets can now be tested via safe bool conversion
2018-09-03 21:40:36 +03:00
Nekotekina
01b4c68238 Remove EXPECTS/ENSURES macro 2018-09-03 21:40:36 +03:00
Nekotekina
69f0ad0d68 Remove ALIGN_32 macro
It's never used in expressions like SIZE_32(T) * n, so it doesn't help to fix any warning issued due to truncation.
2018-09-03 21:40:36 +03:00
Dzmitry Malyshau
c452b43ebc Basic support for Vulkan Portability on OSX 2018-08-28 21:20:11 +03:00
Nekotekina
84abb9923a Don't use std::aligned_storage
Don't need its limiting behaviour anyway
2018-08-25 15:47:03 +03:00
Nekotekina
1c6c24f8ac Update GSL and yaml-cpp submodules 2018-08-25 01:15:47 +03:00
Nekotekina
3aa6741b8c Simplify error_code 2018-08-25 01:15:47 +03:00