diff --git a/src/xenia/base/exception_handler.h b/src/xenia/base/exception_handler.h index f8fe449e0..dba2cfb42 100644 --- a/src/xenia/base/exception_handler.h +++ b/src/xenia/base/exception_handler.h @@ -13,6 +13,7 @@ #include #include +#include "xenia/base/assert.h" #include "xenia/base/x64_context.h" namespace xe { @@ -41,11 +42,22 @@ class Exception { // Returns the platform-specific thread context info. X64Context* thread_context() const { return thread_context_; } +#if XE_ARCH_AMD64 // Returns the program counter where the exception occurred. // RIP on x64. uint64_t pc() const { return thread_context_->rip; } // Sets the program counter where execution will resume. void set_resume_pc(uint64_t pc) { thread_context_->rip = pc; } +#else + // Returns the program counter where the exception occurred. + // RIP on x64. + uint64_t pc() const { + assert_always(); + return 0; + } + // Sets the program counter where execution will resume. + void set_resume_pc(uint64_t pc) { assert_always(); } +#endif // In case of AV, address that was read from/written to. uint64_t fault_address() const { return fault_address_; } diff --git a/src/xenia/base/string_util.h b/src/xenia/base/string_util.h index b79c8433e..c65e3de57 100644 --- a/src/xenia/base/string_util.h +++ b/src/xenia/base/string_util.h @@ -59,6 +59,9 @@ inline std::string to_hex_string(const vec128_t& value) { return std::string(buffer); } +#if XE_ARCH_AMD64 + +// TODO(DrChat): This should not exist. Force the caller to use vec128. inline std::string to_hex_string(const __m128& value) { char buffer[128]; float f[4]; @@ -79,6 +82,8 @@ inline std::string to_string(const __m128& value) { return std::string(buffer); } +#endif + template inline T from_string(const char* value, bool force_hex = false); @@ -182,6 +187,9 @@ inline vec128_t from_string(const char* value, bool force_hex) { return v; } +#if XE_ARCH_AMD64 + +// TODO(DrChat): ?? Why is this here? Force the caller to use vec128. template <> inline __m128 from_string<__m128>(const char* value, bool force_hex) { __m128 v; @@ -225,6 +233,8 @@ inline __m128 from_string<__m128>(const char* value, bool force_hex) { return v; } +#endif + template inline T from_string(const std::string& value, bool force_hex = false) { return from_string(value.c_str(), force_hex);