Merge branch 'dev'
diff --git a/test/misc.cpp b/test/misc.cpp
index ec08e49..236dfb8 100644
--- a/test/misc.cpp
+++ b/test/misc.cpp
@@ -1,8 +1,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <string>
-#define XBYAK_NO_OP_NAMES
 #include <xbyak/xbyak.h>
+#include <xbyak/xbyak_util.h>
 #include <cybozu/inttype.hpp>
 #include <cybozu/test.hpp>
 
@@ -1967,3 +1967,11 @@
 	CYBOZU_TEST_EQUAL(c.getSize(), n);
 	CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
 }
+
+CYBOZU_TEST_AUTO(cpu)
+{
+	// https://github.com/herumi/xbyak/issues/148
+	using namespace Xbyak::util;
+	Cpu cpu;
+	CYBOZU_TEST_EQUAL(cpu.has(Cpu::tINTEL) && cpu.has(Cpu::tAMD), cpu.has(Cpu::tINTEL | Cpu::tAMD));
+}
diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h
index ab0bd57..8274ebe 100644
--- a/xbyak/xbyak_util.h
+++ b/xbyak/xbyak_util.h
@@ -118,6 +118,8 @@
 		t |= rhs;
 		return t;
 	}
+	bool operator==(const Type& rhs) const { return H == rhs.H && L == rhs.L; }
+	bool operator!=(const Type& rhs) const { return !operator==(rhs); }
 	// without explicit because backward compatilibity
 	operator bool() const { return (H | L) != 0; }
 	uint64_t getL() const { return L; }
@@ -179,7 +181,7 @@
 	}
 	void setNumCores()
 	{
-		if ((type_ & tINTEL) == 0) return;
+		if (!has(tINTEL)) return;
 
 		unsigned int data[4] = {};
 
@@ -217,7 +219,7 @@
 	}
 	void setCacheHierarchy()
 	{
-		if ((type_ & tINTEL) == 0) return;
+		if (!has(tINTEL)) return;
 		const unsigned int NO_CACHE = 0;
 		const unsigned int DATA_CACHE = 1;
 //		const unsigned int INSTRUCTION_CACHE = 2;
@@ -561,7 +563,7 @@
 		printf("display:family=%X, model=%X\n", displayFamily, displayModel);
 #endif
 	}
-	bool has(Type type) const
+	bool has(const Type& type) const
 	{
 		return (type & type_) == type;
 	}