Commit Graph

85 Commits

Author SHA1 Message Date
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
Nekotekina 56a165ecdc Rearrange atomic operator internals 2018-08-25 01:15:47 +03:00
Nekotekina 76bac80dde Add MATCH macro 2018-08-24 16:44:19 +03:00
Nekotekina 6cc7d1fb26 Use std::void_t 2018-08-24 16:44:19 +03:00
Nekotekina 2b5cf2455f SPU: improve TSX usage
Reduce transaction failure amount
Remove vm::try_to_lock
2018-04-06 21:47:54 +03:00
Nekotekina 89fba1c385 ppu_acontext draft 2017-10-28 23:24:08 +03:00
Zangetsu38 5146f3ec47 Fix compile VS 2017-10-16 18:42:03 +03:00
Nekotekina c1450ad616 Reenable thread_local for all platforms 2017-08-24 16:27:07 +03:00
Nekotekina 613214cdca Improve error formatting 2017-08-08 22:17:51 +03:00
Nekotekina 22af341ad3 umulh64, mulh64 moved; added ror8/16/32 2017-06-29 17:48:55 +03:00
Nekotekina 0df861d7b5 Added uptr type 2017-06-23 20:09:33 +03:00