925 Commits

Author SHA1 Message Date
Unknown W. Brackets
0a5b1c030b arm64: Implement ext and ins. 2015-06-28 08:45:17 -07:00
Unknown W. Brackets
f355600c20 arm64: Handle negative MOVI2F more correctly.
Both -0.0 and some negated constant values were handled wrong.
2015-06-27 20:13:41 -07:00
Unknown W. Brackets
3110d6f928 Show some cpu name if possible on Android. 2015-06-26 21:55:51 -07:00
Unknown W. Brackets
b3aa6d89e9 Fix UBFX encoding (thanks SonicAdvance1.) 2015-06-26 21:27:03 -07:00
Henrik Rydgard
2c05334d47 ARM64: Fix bug where we didn't save the FP registers correctly in the vertex decoder.
Also port a few ops from dolphin's ARM64 emitter.
2015-06-14 12:56:44 +02:00
Henrik Rydgård
2a1f6bca97 Fix NEON 4444 CheckAlpha, workaround for failed bNEON detection on ARM64 2015-05-31 12:29:08 +02:00
Jan Beich
d0c5c1e659 Common: also use sysctl(3) code on GNU/kFreeBSD 2015-05-26 14:11:23 +00:00
Jan Beich
9887244759 Common: implement GetExeDirectory on some BSDs 2015-05-26 15:20:12 +03:00
Jan Beich
2eb1d578dd Common: check against MAP_FAILED on every Unix after mmap()
This is required by POSIX but may matter only in MAX_FIXED case.
2015-05-26 15:20:11 +03:00
Jan Beich
b24b12f4a0 Common: DragonFly needs MAP_NOSYNC as well 2015-05-26 15:20:11 +03:00
Jan Beich
61c106c57f Common: avoid redefining bswap* via <sys/types.h> on BSDs
In file included from Common/CPUDetect.cpp:27:
In file included from Common/Common.h:139:
Common/Swap.h:76:23: error:
      C++ requires a type specifier for all declarations
inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); }
                      ^
/usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16'
                        ^
/usr/include/x86/endian.h:74:16: note: expanded from macro '__bswap16'
        ((__uint16_t)(__builtin_constant_p(x) ? \
                      ^
In file included from Common/CPUDetect.cpp:27:
In file included from Common/Common.h:139:
Common/Swap.h:76:23: error:
      expected ')'
/usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16'
                        ^
/usr/include/x86/endian.h:74:40: note: expanded from macro '__bswap16'
        ((__uint16_t)(__builtin_constant_p(x) ? \
                                              ^
Common/Swap.h:76:23: note:
      to match this '('
/usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16'
                        ^
/usr/include/x86/endian.h:74:15: note: expanded from macro '__bswap16'
        ((__uint16_t)(__builtin_constant_p(x) ? \
                     ^
In file included from Common/CPUDetect.cpp:27:
In file included from Common/Common.h:139:
Common/Swap.h:76:59: error:
      use of undeclared identifier 'x'
inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); }
                                                          ^
Common/Swap.h:76:70: error:
      use of undeclared identifier 'x'
inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); }
                                                                     ^
Common/Swap.h:77:21: error:
      expected ')'
inline unsigned int bswap32(unsigned int x) { return (x >> 24) | ((x & 0xFF0...
                    ^
/usr/include/sys/endian.h:60:20: note: expanded from macro 'bswap32'
                        ^
/usr/include/x86/endian.h:77:27: note: expanded from macro '__bswap32'
        (__builtin_constant_p(x) ?      \
                                 ^
Common/Swap.h:77:21: note:
      to match this '('
/usr/include/sys/endian.h:60:20: note: expanded from macro 'bswap32'
                        ^
/usr/include/x86/endian.h:77:2: note: expanded from macro '__bswap32'
        (__builtin_constant_p(x) ?      \
        ^
In file included from Common/CPUDetect.cpp:27:
In file included from Common/Common.h:139:
Common/Swap.h:77:21: error:
      functions that differ only in their return type cannot be overloaded
inline unsigned int bswap32(unsigned int x) { return (x >> 24) | ((x & 0xFF0...
                    ^
/usr/include/sys/endian.h:60:20: note: expanded from macro 'bswap32'
                        ^
/usr/include/x86/endian.h:77:3: note: expanded from macro '__bswap32'
        (__builtin_constant_p(x) ?      \
         ^
native/base/basictypes.h:92:44: note:
      previous implicit declaration is here
inline uint16 swap16(uint16 _data) {return bswap16(_data);}
                                           ^
/usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16'
                        ^
/usr/include/x86/endian.h:74:16: note: expanded from macro '__bswap16'
        ((__uint16_t)(__builtin_constant_p(x) ? \
                      ^
In file included from Common/CPUDetect.cpp:27:
In file included from Common/Common.h:139:
Common/Swap.h:78:27: error:
      expected ')'
inline unsigned long long bswap64(unsigned long long x) { return ((unsigned ...
                          ^
/usr/include/sys/endian.h:61:20: note: expanded from macro 'bswap64'
                        ^
/usr/include/x86/endian.h:80:27: note: expanded from macro '__bswap64'
        (__builtin_constant_p(x) ?      \
                                 ^
Common/Swap.h:78:27: note:
      to match this '('
/usr/include/sys/endian.h:61:20: note: expanded from macro 'bswap64'
                        ^
/usr/include/x86/endian.h:80:2: note: expanded from macro '__bswap64'
        (__builtin_constant_p(x) ?      \
        ^
In file included from Common/CPUDetect.cpp:27:
In file included from Common/Common.h:139:
Common/Swap.h:78:27: error:
      functions that differ only in their return type cannot be overloaded
inline unsigned long long bswap64(unsigned long long x) { return ((unsigned ...
                          ^
/usr/include/sys/endian.h:61:20: note: expanded from macro 'bswap64'
                        ^
/usr/include/x86/endian.h:80:3: note: expanded from macro '__bswap64'
        (__builtin_constant_p(x) ?      \
         ^
native/base/basictypes.h:92:44: note:
      previous implicit declaration is here
inline uint16 swap16(uint16 _data) {return bswap16(_data);}
                                           ^
/usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16'
                        ^
/usr/include/x86/endian.h:74:16: note: expanded from macro '__bswap16'
        ((__uint16_t)(__builtin_constant_p(x) ? \
                      ^
8 errors generated.
2015-05-26 15:20:11 +03:00
Jan Beich
05e5085f68 Common: drop bogus #ifdef for FreeBSD
Common/CPUDetect.cpp:70:2: error: use of undeclared identifier '__cpuidex'; did you mean 'do_cpuidex'?
        __cpuidex((int *)regs, cpuid_leaf, ecxval);
        ^~~~~~~~~
        do_cpuidex
Common/CPUDetect.cpp:69:6: note: 'do_cpuidex' declared here
void do_cpuidex(u32 regs[4], u32 cpuid_leaf, u32 ecxval) {
     ^
Common/CPUDetect.cpp:70:12: error: cannot initialize a parameter of type 'u32 *' (aka 'unsigned int *') with an rvalue of type 'int *'
        __cpuidex((int *)regs, cpuid_leaf, ecxval);
                  ^~~~~~~~~~~
Common/CPUDetect.cpp:69:21: note: passing argument to parameter 'regs' here
void do_cpuidex(u32 regs[4], u32 cpuid_leaf, u32 ecxval) {
                    ^
Common/CPUDetect.cpp:73:2: error: use of undeclared identifier '__cpuid'; did you mean 'do_cpuid'?
        __cpuid((int *)regs, cpuid_leaf);
        ^~~~~~~
        do_cpuid
Common/CPUDetect.cpp:72:6: note: 'do_cpuid' declared here
void do_cpuid(u32 regs[4], u32 cpuid_leaf) {
     ^
Common/CPUDetect.cpp:73:10: error: cannot initialize a parameter of type 'u32 *' (aka 'unsigned int *') with an rvalue of type 'int *'
        __cpuid((int *)regs, cpuid_leaf);
                ^~~~~~~~~~~
Common/CPUDetect.cpp:72:19: note: passing argument to parameter 'regs' here
void do_cpuid(u32 regs[4], u32 cpuid_leaf) {
                  ^
4 errors generated.
2015-05-26 15:20:11 +03:00
Jan Beich
59a21dbfcb Common: try to unbreak StdMutex.h on more C++11 compilers
Clang still pretends as GCC 4.2.1 even with libc++ or newer libstdc++.

In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
In file included from Common/LogManager.h:26:
Common/StdMutex.h:197:28: error:
      reference to 'adopt_lock_t' is ambiguous
        lock_guard(mutex_type& m, adopt_lock_t)
                                  ^
Common/StdMutex.h:183:6: note:
      candidate found by name lookup is 'std::adopt_lock_t'
enum adopt_lock_t { adopt_lock };
     ^
/usr/include/c++/v1/__mutex_base:55:25: note: candidate found by name lookup is
      'std::__1::adopt_lock_t'
struct _LIBCPP_TYPE_VIS adopt_lock_t {};
                        ^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
In file included from Common/LogManager.h:26:
Common/StdMutex.h:230:29: error:
      reference to 'defer_lock_t' is ambiguous
        unique_lock(mutex_type& m, defer_lock_t)
                                   ^
Common/StdMutex.h:181:6: note:
      candidate found by name lookup is 'std::defer_lock_t'
enum defer_lock_t { defer_lock };
     ^
/usr/include/c++/v1/__mutex_base:53:25: note: candidate found by name lookup is
      'std::__1::defer_lock_t'
struct _LIBCPP_TYPE_VIS defer_lock_t {};
                        ^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
In file included from Common/LogManager.h:26:
Common/StdMutex.h:234:29: error:
      reference to 'try_to_lock_t' is ambiguous
        unique_lock(mutex_type& m, try_to_lock_t)
                                   ^
Common/StdMutex.h:182:6: note:
      candidate found by name lookup is 'std::try_to_lock_t'
enum try_to_lock_t { try_to_lock };
     ^
/usr/include/c++/v1/__mutex_base:54:25: note: candidate found by name lookup is
      'std::__1::try_to_lock_t'
struct _LIBCPP_TYPE_VIS try_to_lock_t {};
                        ^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
In file included from Common/LogManager.h:26:
Common/StdMutex.h:238:29: error:
      reference to 'adopt_lock_t' is ambiguous
        unique_lock(mutex_type& m, adopt_lock_t)
                                   ^
Common/StdMutex.h:183:6: note:
      candidate found by name lookup is 'std::adopt_lock_t'
enum adopt_lock_t { adopt_lock };
     ^
/usr/include/c++/v1/__mutex_base:55:25: note: candidate found by name lookup is
      'std::__1::adopt_lock_t'
struct _LIBCPP_TYPE_VIS adopt_lock_t {};
                        ^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
In file included from Common/LogManager.h:26:
Common/StdMutex.h:345:6: warning:
      variable templates are a C++14 extension [-Wc++14-extensions]
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y)
     ^
Common/StdMutex.h:345:6: error:
      variable has incomplete type 'void'
Common/StdMutex.h:345:11: error:
      reference to 'unique_lock' is ambiguous
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y)
          ^
Common/StdMutex.h:215:7: note:
      candidate found by name lookup is 'std::unique_lock'
class unique_lock
      ^
/usr/include/c++/v1/__mutex_base:96:29: note: candidate found by name lookup is
      'std::__1::unique_lock'
class _LIBCPP_TYPE_VIS_ONLY unique_lock
                            ^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
In file included from Common/LogManager.h:26:
Common/StdMutex.h:345:23: error:
      'Mutex' does not refer to a value
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y)
                      ^
Common/StdMutex.h:344:17: note:
      declared here
template <class Mutex>
                ^
Common/StdMutex.h:345:31: error:
      use of undeclared identifier 'x'
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y)
                              ^
Common/StdMutex.h:345:34: error:
      reference to 'unique_lock' is ambiguous
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y)
                                 ^
Common/StdMutex.h:215:7: note:
      candidate found by name lookup is 'std::unique_lock'
class unique_lock
      ^
/usr/include/c++/v1/__mutex_base:96:29: note: candidate found by name lookup is
      'std::__1::unique_lock'
class _LIBCPP_TYPE_VIS_ONLY unique_lock
                            ^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
In file included from Common/LogManager.h:26:
Common/StdMutex.h:345:46: error:
      'Mutex' does not refer to a value
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y)
                                             ^
Common/StdMutex.h:344:17: note:
      declared here
template <class Mutex>
                ^
Common/StdMutex.h:345:54: error:
      use of undeclared identifier 'y'
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y)
                                                     ^
Common/StdMutex.h:345:56: error:
      expected ';' at end of declaration
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y)
                                                       ^
                                                       ;
Common/StdMutex.h:346:1: error:
      expected unqualified-id
{
^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
Common/LogManager.h:54:7: error:
      reference to 'mutex' is ambiguous
        std::mutex m_log_lock;
             ^
/usr/include/c++/v1/__mutex_base:27:24: note: candidate found by name lookup is
      'std::__1::mutex'
class _LIBCPP_TYPE_VIS mutex
                       ^
Common/StdMutex.h:107:7: note:
      candidate found by name lookup is 'std::mutex'
class mutex
      ^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
Common/LogManager.h:116:7: error:
      reference to 'mutex' is ambiguous
        std::mutex m_listeners_lock;
             ^
/usr/include/c++/v1/__mutex_base:27:24: note: candidate found by name lookup is
      'std::__1::mutex'
class _LIBCPP_TYPE_VIS mutex
                       ^
Common/StdMutex.h:107:7: note:
      candidate found by name lookup is 'std::mutex'
class mutex
      ^
In file included from Common/ConsoleListener.cpp:33:
In file included from Common/ConsoleListener.h:20:
Common/LogManager.h:131:7: error:
      reference to 'mutex' is ambiguous
        std::mutex log_lock_;
             ^
/usr/include/c++/v1/__mutex_base:27:24: note: candidate found by name lookup is
      'std::__1::mutex'
class _LIBCPP_TYPE_VIS mutex
                       ^
Common/StdMutex.h:107:7: note:
      candidate found by name lookup is 'std::mutex'
class mutex
      ^
1 warning and 16 errors generated.
2015-05-26 15:20:11 +03:00
Jan Beich
5f278b2d94 Unbreak build with SSE 4.1 (clang -march=penryn)
Common/ColorConv.cpp:199:33: error: use of undeclared identifier '_mm_packus_epi32';
      did you mean '_mm_packs_epi32'?
                _mm_store_si128(&dstp[i / 2], _mm_packus_epi32(c1, c2));
                                              ^~~~~~~~~~~~~~~~
                                              _mm_packs_epi32
/usr/bin/../lib/clang/3.6.0/include/emmintrin.h:1254:1: note: '_mm_packs_epi32'
      declared here
_mm_packs_epi32(__m128i __a, __m128i __b)
^
Common/ColorConv.cpp:241:33: error: use of undeclared identifier '_mm_packus_epi32';
      did you mean '_mm_packs_epi32'?
                _mm_store_si128(&dstp[i / 2], _mm_packus_epi32(c1, c2));
                                              ^~~~~~~~~~~~~~~~
                                              _mm_packs_epi32
/usr/bin/../lib/clang/3.6.0/include/emmintrin.h:1254:1: note: '_mm_packs_epi32'
      declared here
_mm_packs_epi32(__m128i __a, __m128i __b)
^
2 errors generated.

GPU/Common/TextureScalerCommon.cpp:294:6: error: unknown type name '__m128'
                                        __m128 result = _mm_set1_ps(0.0f);
                                        ^
GPU/Common/TextureScalerCommon.cpp:294:22: error: use of undeclared identifier
      '_mm_set1_ps'
                                        __m128 result = _mm_set1_ps(0.0f);
                                                        ^
GPU/Common/TextureScalerCommon.cpp:305:9: error: unknown type name '__m128i'
                                                                __m128i samp...
                                                                ^
GPU/Common/TextureScalerCommon.cpp:305:26: error: use of undeclared identifier
      '_mm_cvtsi32_si128'
  ...__m128i sample = _mm_cvtsi32_si128(data[csy*w + csx]);
                      ^
GPU/Common/TextureScalerCommon.cpp:307:9: error: unknown type name '__m128'
                                                                __m128 col ...
                                                                ^
GPU/Common/TextureScalerCommon.cpp:308:31: error: use of undeclared identifier
      '_mm_set1_ps'
  ...col = _mm_mul_ps(col, _mm_set1_ps(weight));
                           ^
GPU/Common/TextureScalerCommon.cpp:314:6: error: unknown type name '__m128i'
                                        __m128i pixel = _mm_cvtps_epi32(_mm_...
                                        ^
GPU/Common/TextureScalerCommon.cpp:314:57: error: use of undeclared identifier
      '_mm_set1_ps'
  ...__m128i pixel = _mm_cvtps_epi32(_mm_mul_ps(result, _mm_set1_ps(bicubicInvSum...
                                                        ^
8 errors generated.
2015-05-26 15:20:10 +03:00
Unknown W. Brackets
4110a24d8f Fix Direct3D9 framebuffer upload conversion funcs.
All of the 16 bit formats were, afaict, wrong in different ways.
2015-05-25 10:47:37 -07:00
Unknown W. Brackets
539a7b1772 Correct order in ConvertRGBA4444ToRGBA8888().
I assume this is right, since it's pulling in a 4444 tex from PSP VRAM.
2015-05-25 10:32:23 -07:00
Unknown W. Brackets
b0a825ea9f Small optimization to ConvertRGBA5551ToRGBA8888(). 2015-05-25 10:31:27 -07:00
Unknown W. Brackets
3b96bf8712 Oops, typo. 2015-05-23 12:20:00 -07:00
Unknown W. Brackets
4900bc9082 Add a NEON 4444 flip color conversion func. 2015-05-23 11:30:07 -07:00
Unknown W. Brackets
df53bc2e7b Add a NEON 565 flip colorconv function. 2015-05-23 11:30:06 -07:00
Unknown W. Brackets
bbe15d2518 Add a NEON color conv for 5551 -> 1555. 2015-05-23 11:30:06 -07:00
Unknown W. Brackets
ccdaf41b53 Add some additional SSE for color conversion. 2015-05-17 16:04:42 -07:00
Unknown W. Brackets
1cb2302f5c Use SSE in ConvertRGBA5551ToRGBA8888().
This func is used when showing videos, some loading screens, etc.  Also
when uploading graphics to VRAM.

The implementation takes 85% less than without SSE, although it could
probably be optimized further.  Won't help game runtime much, but may help
some loading times or special effects.
2015-05-17 16:04:42 -07:00
Unknown W. Brackets
7269574a10 Add structure for NEON color conversion funcs. 2015-05-17 16:04:41 -07:00
Unknown W. Brackets
1767bd958c Move color conversion funcs to ColorConv.
This paves the way a bit for NEON conversion funcs.
2015-05-17 13:45:30 -07:00
Unknown W. Brackets
3f29329ed2 Actually use the SSE color conversion code. 2015-05-17 13:42:17 -07:00
Unknown W. Brackets
c10373ef06 ARM64: Fix some minor MSVC warnings. 2015-04-10 12:05:51 -07:00
Henrik Rydgard
db110d60a1 Rename some colorconv functions 2015-04-08 23:01:17 +02:00
Henrik Rydgard
4621586342 Move simple conversion functions out of the ColorConv header. 2015-04-08 22:52:49 +02:00
Henrik Rydgard
6660985210 Extract a bunch more color conversion loops. 2015-04-08 22:52:48 +02:00
Henrik Rydgard
b5acf15cc9 Extract some explicit loops into calls to color conversion functions. 2015-04-08 22:52:48 +02:00
Henrik Rydgard
c2cf2bd97e Move some more color conversion functions to ColorConv 2015-04-08 22:52:47 +02:00
Henrik Rydgard
31961eace9 Color conv attempt 2. Start consolidating simple color conversion functions in a single header+cpp. 2015-04-08 22:52:46 +02:00
Henrik Rydgård
39be916d8a ARM64: More emitter/disasm 2015-04-06 18:13:44 +02:00
Henrik Rydgård
459ba28655 ARM64: SW skinning runs without crashing but is broken. 2015-04-06 18:13:44 +02:00
Henrik Rydgård
597595f279 ARM64: Start implementing soft-skinning. Disabled for now, needs work. 2015-04-06 18:13:43 +02:00
Henrik Rydgård
f82b613371 ARM64 emitter/disasm: Implement ASIMD LDP/STP instructions 2015-04-06 18:13:42 +02:00
Henrik Rydgård
013bbc71af ARM64: Fix DUP disasm, INS disasm 2015-04-06 18:13:40 +02:00
Henrik Rydgård
a3db3ed5c1 ARM64 emitter: Fix UXTL/SXTL and friends. Add disasm. 2015-04-06 18:13:40 +02:00
Henrik Rydgård
853d6ea34b ARM64 emitter: Add FMLA/FMLS vector versions 2015-04-06 18:13:39 +02:00
Henrik Rydgård
065cd97dc2 ARM64: LLVM buildfix, some more disasm 2015-04-06 18:13:39 +02:00
Henrik Rydgård
13c9390c53 ARM64: Emitter fix, disable swl/swr/lwl/lwr again fully 2015-04-06 18:13:38 +02:00
Henrik Rydgård
9f24076b63 Make the unittests build on mac 2015-04-06 18:13:37 +02:00
Henrik Rydgard
0a70618f87 ARM64: Accurate floating point rounding. For some reason, FTZ doesn't seem to work though. 2015-04-06 18:13:36 +02:00
Henrik Rydgard
4618275f99 ARM64: Add a few aliases to emitter. Disasm fixes. 2015-04-06 18:13:33 +02:00
Henrik Rydgard
acf08eefa8 ARM64: Fix FCVTL, use it in v2hf 2015-04-06 18:13:33 +02:00
Henrik Rydgard
0849e270ee ARM64: fmla encoding, more disasm 2015-04-06 18:13:31 +02:00
Henrik Rydgard
ca58f322e5 ARM64: Port over some missing VFPU instructions from ARM. Not much left now. 2015-04-06 18:13:30 +02:00
Henrik Rydgard
9c79831237 ARM64 emitter: Fix FP immediates 2015-04-06 18:13:29 +02:00
Henrik Rydgard
9a5a093105 ARM64 emitter/disasm: More scalar FPU instructions 2015-04-06 18:13:27 +02:00