aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2020-09-08 15:31:38 +0900
committerMITSUNARI Shigeo <[email protected]>2020-09-08 15:31:38 +0900
commitd0ced1bcac896aaf251ab399fc546822ce6152c3 (patch)
treed0de776194622d353c9c9bd235e41c11651205c6
parentbb967ae752b3c6e9bce3b7d685d100e032eee8e3 (diff)
downloadxbyak-d0ced1bcac896aaf251ab399fc546822ce6152c3.tar.gz
xbyak-d0ced1bcac896aaf251ab399fc546822ce6152c3.zip
XBYAK_ONLY_CLASS_CPU is for only util::Cpu
-rw-r--r--xbyak/xbyak_util.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h
index 4ed772f..1516fc3 100644
--- a/xbyak/xbyak_util.h
+++ b/xbyak/xbyak_util.h
@@ -1,5 +1,16 @@
#ifndef XBYAK_XBYAK_UTIL_H_
#define XBYAK_XBYAK_UTIL_H_
+
+#ifdef XBYAK_ONLY_CLASS_CPU
+#include <stdint.h>
+#include <stdlib.h>
+#include <algorithm>
+#include <assert.h>
+#ifndef XBYAK_THROW
+ #define XBYAK_THROW(x) ;
+ #define XBYAK_THROW_RET(x, y) return y;
+#endif
+#else
#include <string.h>
/**
@@ -9,6 +20,7 @@
@note this header is UNDER CONSTRUCTION!
*/
#include "xbyak.h"
+#endif // XBYAK_ONLY_CLASS_CPU
#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)
#define XBYAK_INTEL_CPU_SPECIFIC
@@ -469,9 +481,11 @@ public:
}
void putFamily() const
{
+#ifndef XBYAK_ONLY_CLASS_CPU
printf("family=%d, model=%X, stepping=%d, extFamily=%d, extModel=%X\n",
family, model, stepping, extFamily, extModel);
printf("display:family=%X, model=%X\n", displayFamily, displayModel);
+#endif
}
bool has(Type type) const
{
@@ -479,6 +493,7 @@ public:
}
};
+#ifndef XBYAK_ONLY_CLASS_CPU
class Clock {
public:
static inline uint64_t getRdtsc()
@@ -880,6 +895,8 @@ public:
startAddr_ = endAddr;
}
};
+#endif // XBYAK_ONLY_CLASS_CPU
} } // end of util
+
#endif