Incorporated changes from pull requests 187, 202, and 212

This commit is contained in:
kobalicek
2018-11-17 05:43:49 +01:00
parent 2194899168
commit c2f50e6fc5
8 changed files with 27 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
version: "{build}"
image: Visual Studio 2015
image: Visual Studio 2017
clone_folder: c:\dev\asmjit
environment:
@@ -14,40 +14,16 @@ environment:
TOOLCHAIN: "MinGW Makefiles"
- BUILD_TYPE: Debug
TOOLCHAIN: "Visual Studio 10 2010"
TOOLCHAIN: "Visual Studio 15 2017"
- BUILD_TYPE: Release
TOOLCHAIN: "Visual Studio 10 2010"
TOOLCHAIN: "Visual Studio 15 2017"
- BUILD_TYPE: Debug
TOOLCHAIN: "Visual Studio 10 2010 Win64"
TOOLCHAIN: "Visual Studio 15 2017 Win64"
- BUILD_TYPE: Release
TOOLCHAIN: "Visual Studio 10 2010 Win64"
- BUILD_TYPE: Debug
TOOLCHAIN: "Visual Studio 12 2013"
- BUILD_TYPE: Release
TOOLCHAIN: "Visual Studio 12 2013"
- BUILD_TYPE: Debug
TOOLCHAIN: "Visual Studio 12 2013 Win64"
- BUILD_TYPE: Release
TOOLCHAIN: "Visual Studio 12 2013 Win64"
- BUILD_TYPE: Debug
TOOLCHAIN: "Visual Studio 14 2015"
- BUILD_TYPE: Release
TOOLCHAIN: "Visual Studio 14 2015"
- BUILD_TYPE: Debug
TOOLCHAIN: "Visual Studio 14 2015 Win64"
- BUILD_TYPE: Release
TOOLCHAIN: "Visual Studio 14 2015 Win64"
TOOLCHAIN: "Visual Studio 15 2017 Win64"
install:
- if "%TOOLCHAIN%"=="MinGW Makefiles" set PATH=%PATH:C:\Program Files\Git\usr\bin;=%

View File

@@ -234,7 +234,12 @@ if(NOT ASMJIT_EMBED)
"${ASMJIT_PRIVATE_CFLAGS_REL}")
foreach(_target asmjit_bench_x86 asmjit_test_opcode asmjit_test_x86_asm asmjit_test_x86_cc)
cxx_add_executable(asmjit ${_target} "test/${_target}.cpp" "${ASMJIT_LIBS}" "${ASMJIT_CFLAGS}" "" "")
cxx_add_executable(asmjit ${_target}
"test/${_target}.cpp"
"${ASMJIT_LIBS}"
"${ASMJIT_CFLAGS}"
"${ASMJIT_PRIVATE_CFLAGS_DBG}"
"${ASMJIT_PRIVATE_CFLAGS_REL}")
endforeach()
endif()
endif()

View File

@@ -53,6 +53,7 @@
// [GCC]
#if ASMJIT_CC_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wbool-operation"
#endif // ASMJIT_CC_GCC
// [MSC]
@@ -66,6 +67,7 @@
# pragma warning(disable: 4355) // this used in base member initializer list
# pragma warning(disable: 4480) // specifying underlying type for enum
# pragma warning(disable: 4800) // forcing value to bool 'true' or 'false'
# pragma warning(disable: 4838) // comversion from 'int' to ...
# if _MSC_VER < 1900
# if !defined(vsnprintf)
# define ASMJIT_UNDEF_VSNPRINTF

View File

@@ -86,7 +86,7 @@ public:
// --------------------------------------------------------------------------
ASMJIT_INLINE ArchInfo() noexcept : _signature(0) {}
ASMJIT_INLINE ArchInfo(const ArchInfo& other) noexcept : _signature(other._signature) {}
ASMJIT_INLINE ArchInfo(const ArchInfo& other) noexcept = default;
explicit ASMJIT_INLINE ArchInfo(uint32_t type, uint32_t subType = kSubTypeNone) noexcept { init(type, subType); }
ASMJIT_INLINE static ArchInfo host() noexcept { return ArchInfo(kTypeHost, kSubTypeHost); }
@@ -147,7 +147,7 @@ public:
// [Operator Overload]
// --------------------------------------------------------------------------
ASMJIT_INLINE const ArchInfo& operator=(const ArchInfo& other) noexcept { _signature = other._signature; return *this; }
ASMJIT_INLINE ArchInfo& operator=(const ArchInfo& other) noexcept = default;
ASMJIT_INLINE bool operator==(const ArchInfo& other) const noexcept { return _signature == other._signature; }
ASMJIT_INLINE bool operator!=(const ArchInfo& other) const noexcept { return _signature != other._signature; }

View File

@@ -38,7 +38,7 @@ public:
// --------------------------------------------------------------------------
ASMJIT_INLINE CpuFeatures() noexcept { reset(); }
ASMJIT_INLINE CpuFeatures(const CpuFeatures& other) noexcept { init(other); }
ASMJIT_INLINE CpuFeatures(const CpuFeatures& other) noexcept = default;
// --------------------------------------------------------------------------
// [Init / Reset]
@@ -249,7 +249,7 @@ public:
// --------------------------------------------------------------------------
ASMJIT_INLINE CpuInfo() noexcept { reset(); }
ASMJIT_INLINE CpuInfo(const CpuInfo& other) noexcept { init(other); }
ASMJIT_INLINE CpuInfo(const CpuInfo& other) noexcept = default;
// --------------------------------------------------------------------------
// [Init / Reset]

View File

@@ -1497,11 +1497,11 @@ template<typename T> struct TypeIdOf<T*> {
template<typename T>
struct TypeIdOfInt {
enum {
kSignatureed = int(~static_cast<T>(0) < static_cast<T>(0)),
kTypeId = (sizeof(T) == 1) ? (int)(kSignatureed ? TypeId::kI8 : TypeId::kU8 ) :
(sizeof(T) == 2) ? (int)(kSignatureed ? TypeId::kI16 : TypeId::kU16) :
(sizeof(T) == 4) ? (int)(kSignatureed ? TypeId::kI32 : TypeId::kU32) :
(sizeof(T) == 8) ? (int)(kSignatureed ? TypeId::kI64 : TypeId::kU64) : (int)TypeId::kVoid
kSigned = int(~T(0) < T(0)),
kTypeId = (sizeof(T) == 1) ? (int)(kSigned ? TypeId::kI8 : TypeId::kU8 ) :
(sizeof(T) == 2) ? (int)(kSigned ? TypeId::kI16 : TypeId::kU16) :
(sizeof(T) == 4) ? (int)(kSigned ? TypeId::kI32 : TypeId::kU32) :
(sizeof(T) == 8) ? (int)(kSigned ? TypeId::kI64 : TypeId::kU64) : (int)TypeId::kVoid
};
};
@@ -1524,7 +1524,6 @@ ASMJIT_DEFINE_TYPE_ID(unsigned __int64 , TypeIdOfInt< unsigned __int64 >::kTy
ASMJIT_DEFINE_TYPE_ID(long long , TypeIdOfInt< long long >::kTypeId);
ASMJIT_DEFINE_TYPE_ID(unsigned long long, TypeIdOfInt< unsigned long long >::kTypeId);
#endif
ASMJIT_DEFINE_TYPE_ID(bool , TypeIdOfInt< bool >::kTypeId);
#if ASMJIT_CC_HAS_NATIVE_CHAR
ASMJIT_DEFINE_TYPE_ID(char , TypeIdOfInt< char >::kTypeId);
#endif
@@ -1539,6 +1538,7 @@ ASMJIT_DEFINE_TYPE_ID(wchar_t , TypeIdOfInt< wchar_t >::kTy
#endif
ASMJIT_DEFINE_TYPE_ID(void , TypeId::kVoid);
ASMJIT_DEFINE_TYPE_ID(bool , TypeId::kI8);
ASMJIT_DEFINE_TYPE_ID(float , TypeId::kF32);
ASMJIT_DEFINE_TYPE_ID(double , TypeId::kF64);

View File

@@ -71,6 +71,8 @@ public:
// [Code-Generation]
// --------------------------------------------------------------------------
using CodeBuilder::_emit;
ASMJIT_API virtual Error _emit(uint32_t instId, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3) override;
};

View File

@@ -1027,9 +1027,7 @@ ASMJIT_FAVOR_SIZE Error X86Internal::emitProlog(X86Emitter* emitter, const FuncF
uint32_t gpSaved = layout.getSavedRegs(X86Reg::kKindGp);
X86Gp zsp = emitter->zsp(); // ESP|RSP register.
X86Gp zbp = emitter->zsp(); // EBP|RBP register.
zbp.setId(X86Gp::kIdBp);
X86Gp zbp = emitter->zbp(); // EBP|RBP register.
X86Gp gpReg = emitter->zsp(); // General purpose register (temporary).
X86Gp saReg = emitter->zsp(); // Stack-arguments base register.
@@ -1100,9 +1098,7 @@ ASMJIT_FAVOR_SIZE Error X86Internal::emitEpilog(X86Emitter* emitter, const FuncF
uint32_t gpSaved = layout.getSavedRegs(X86Reg::kKindGp);
X86Gp zsp = emitter->zsp(); // ESP|RSP register.
X86Gp zbp = emitter->zsp(); // EBP|RBP register.
zbp.setId(X86Gp::kIdBp);
X86Gp zbp = emitter->zbp(); // EBP|RBP register.
X86Gp gpReg = emitter->zsp(); // General purpose register (temporary).
// Don't emit 'pop zbp' in the pop sequence, this case is handled separately.