mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-18 21:14:35 +03:00
Don't exclude gcc in travis-ci.
Asmjit_test should show info about current CPU.
This commit is contained in:
@@ -16,10 +16,9 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
exclude:
|
exclude:
|
||||||
- os: osx
|
- os: osx
|
||||||
- compiler: gcc
|
compiler: gcc
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- cmake --version
|
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo add-apt-repository ppa:kubuntu-ppa/backports -y; fi;
|
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo add-apt-repository ppa:kubuntu-ppa/backports -y; fi;
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq update; fi;
|
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq update; fi;
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq install cmake valgrind; fi;
|
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq install cmake valgrind; fi;
|
||||||
@@ -27,6 +26,7 @@ before_install:
|
|||||||
before_script:
|
before_script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
|
- cmake --version
|
||||||
- cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DASMJIT_BUILD_TEST=1 -DASMJIT_BUILD_SAMPLES=1
|
- cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DASMJIT_BUILD_TEST=1 -DASMJIT_BUILD_SAMPLES=1
|
||||||
- cd ..
|
- cd ..
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "../x86/x86cpuinfo.h"
|
#include "../x86/x86cpuinfo.h"
|
||||||
#else
|
#else
|
||||||
// ?
|
// ?
|
||||||
#endif // ASMJIT_HOST || ASMJIT_ARCH_X64
|
#endif
|
||||||
|
|
||||||
// [Dependencies - Posix]
|
// [Dependencies - Posix]
|
||||||
#if defined(ASMJIT_OS_POSIX)
|
#if defined(ASMJIT_OS_POSIX)
|
||||||
@@ -62,14 +62,14 @@ struct AutoX86CpuInfo : public X86CpuInfo {
|
|||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
#error "AsmJit - Unsupported CPU."
|
#error "AsmJit - Unsupported CPU."
|
||||||
#endif // ASMJIT_HOST || ASMJIT_ARCH_X64
|
#endif
|
||||||
|
|
||||||
const CpuInfo* CpuInfo::getHost() {
|
const CpuInfo* CpuInfo::getHost() {
|
||||||
#if defined(ASMJIT_ARCH_X86) || defined(ASMJIT_ARCH_X64)
|
#if defined(ASMJIT_ARCH_X86) || defined(ASMJIT_ARCH_X64)
|
||||||
static AutoX86CpuInfo cpuInfo;
|
static AutoX86CpuInfo cpuInfo;
|
||||||
#else
|
#else
|
||||||
#error "AsmJit - Unsupported CPU."
|
#error "AsmJit - Unsupported CPU."
|
||||||
#endif // ASMJIT_HOST || ASMJIT_ARCH_X64
|
#endif
|
||||||
return &cpuInfo;
|
return &cpuInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ struct IntUtil {
|
|||||||
return u0 + (u1 << 8) + (w2 << 16);
|
return u0 + (u1 << 8) + (w2 << 16);
|
||||||
#else
|
#else
|
||||||
return (u0 << 24) + (u1 << 16) + (w2);
|
return (u0 << 24) + (u1 << 16) + (w2);
|
||||||
#endif // ASMJIT_HOST
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Pack four 8-bit integer into a 32-bit integer as it is an array of `{u0,u1,u2,u3}`.
|
//! Pack four 8-bit integer into a 32-bit integer as it is an array of `{u0,u1,u2,u3}`.
|
||||||
@@ -121,7 +121,7 @@ struct IntUtil {
|
|||||||
return u0 + (u1 << 8) + (u2 << 16) + (u3 << 24);
|
return u0 + (u1 << 8) + (u2 << 16) + (u3 << 24);
|
||||||
#else
|
#else
|
||||||
return (u0 << 24) + (u1 << 16) + (u2 << 8) + u3;
|
return (u0 << 24) + (u1 << 16) + (u2 << 8) + u3;
|
||||||
#endif // ASMJIT_HOST
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Pack two 32-bit integer into a 64-bit integer as it is an array of `{u0,u1}`.
|
//! Pack two 32-bit integer into a 64-bit integer as it is an array of `{u0,u1}`.
|
||||||
@@ -130,7 +130,7 @@ struct IntUtil {
|
|||||||
return (static_cast<uint64_t>(u1) << 32) + u0;
|
return (static_cast<uint64_t>(u1) << 32) + u0;
|
||||||
#else
|
#else
|
||||||
return (static_cast<uint64_t>(u0) << 32) + u1;
|
return (static_cast<uint64_t>(u0) << 32) + u1;
|
||||||
#endif // ASMJIT_HOST
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ struct Operand {
|
|||||||
uint8_t type;
|
uint8_t type;
|
||||||
//! Register index.
|
//! Register index.
|
||||||
uint8_t index;
|
uint8_t index;
|
||||||
#endif // ASMJIT_HOST
|
#endif
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,19 +28,19 @@ static void dumpCpu(void) {
|
|||||||
const CpuInfo* cpu = CpuInfo::getHost();
|
const CpuInfo* cpu = CpuInfo::getHost();
|
||||||
|
|
||||||
INFO("Host CPU Info:");
|
INFO("Host CPU Info:");
|
||||||
INFO(" Vendor string : %s", cpu->getVendorString());
|
INFO(" Vendor string : %s", cpu->getVendorString());
|
||||||
INFO(" Brand string : %s", cpu->getBrandString());
|
INFO(" Brand string : %s", cpu->getBrandString());
|
||||||
INFO(" Family : %u", cpu->getFamily());
|
INFO(" Family : %u", cpu->getFamily());
|
||||||
INFO(" Model : %u", cpu->getModel());
|
INFO(" Model : %u", cpu->getModel());
|
||||||
INFO(" Stepping : %u", cpu->getStepping());
|
INFO(" Stepping : %u", cpu->getStepping());
|
||||||
INFO(" HW-Threads Count : %u", cpu->getHwThreadsCount());
|
INFO(" HW-Threads Count : %u", cpu->getHwThreadsCount());
|
||||||
INFO("");
|
INFO("");
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// [X86]
|
// [X86]
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(ASMJIT_HOST_X86) || defined(ASMJIT_HOST_X64)
|
#if defined(ASMJIT_ARCH_X86) || defined(ASMJIT_ARCH_X64)
|
||||||
const X86CpuInfo* x86Cpu = static_cast<const X86CpuInfo*>(cpu);
|
const X86CpuInfo* x86Cpu = static_cast<const X86CpuInfo*>(cpu);
|
||||||
|
|
||||||
static const DumpCpuFeature x86FeaturesList[] = {
|
static const DumpCpuFeature x86FeaturesList[] = {
|
||||||
@@ -105,16 +105,16 @@ static void dumpCpu(void) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
INFO("Host CPU Info (X86/X64):");
|
INFO("Host CPU Info (X86/X64):");
|
||||||
INFO(" Processor Type : %u", x86Cpu->getProcessorType());
|
INFO(" Processor Type : %u", x86Cpu->getProcessorType());
|
||||||
INFO(" Brand Index : %u", x86Cpu->getBrandIndex());
|
INFO(" Brand Index : %u", x86Cpu->getBrandIndex());
|
||||||
INFO(" CL Flush Cache Line : %u", x86Cpu->getFlushCacheLineSize());
|
INFO(" CL Flush Cache Line : %u", x86Cpu->getFlushCacheLineSize());
|
||||||
INFO(" Max logical Processors: %u", x86Cpu->getMaxLogicalProcessors());
|
INFO(" Max logical Processors : %u", x86Cpu->getMaxLogicalProcessors());
|
||||||
INFO("");
|
INFO("");
|
||||||
|
|
||||||
INFO("Host CPU Features (X86/X64):");
|
INFO("Host CPU Features (X86/X64):");
|
||||||
dumpCpuFeatures(x86Cpu, x86FeaturesList, ASMJIT_ARRAY_SIZE(x86FeaturesList));
|
dumpCpuFeatures(x86Cpu, x86FeaturesList, ASMJIT_ARRAY_SIZE(x86FeaturesList));
|
||||||
INFO("");
|
INFO("");
|
||||||
#endif // ASMJIT_HOST || ASMJIT_HOST_X64
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -122,7 +122,7 @@ static void dumpCpu(void) {
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
#define DUMP_TYPE(_Type_) \
|
#define DUMP_TYPE(_Type_) \
|
||||||
INFO(" %-31s: %u", #_Type_, static_cast<uint32_t>(sizeof(_Type_)))
|
INFO(" %-27s: %u", #_Type_, static_cast<uint32_t>(sizeof(_Type_)))
|
||||||
|
|
||||||
static void dumpSizeOf(void) {
|
static void dumpSizeOf(void) {
|
||||||
INFO("SizeOf Types:");
|
INFO("SizeOf Types:");
|
||||||
|
|||||||
Reference in New Issue
Block a user