diff options
author | MITSUNARI Shigeo <[email protected]> | 2015-08-10 10:55:07 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2015-08-10 10:55:07 +0900 |
commit | 93aae57298703ad4525abbfbfa5ee4be048d3c3d (patch) | |
tree | 61160ca9b25a48073fac4c272e0c51329d3c5fb9 | |
parent | 1e208fd20225441f9ed02c7470335c731d958ebb (diff) | |
download | xbyak-93aae57298703ad4525abbfbfa5ee4be048d3c3d.tar.gz xbyak-93aae57298703ad4525abbfbfa5ee4be048d3c3d.zip |
fix Address::operator==()v4.85
-rw-r--r-- | readme.md | 3 | ||||
-rw-r--r-- | readme.txt | 3 | ||||
-rw-r--r-- | test/misc.cpp | 11 | ||||
-rw-r--r-- | xbyak/xbyak.h | 17 | ||||
-rw-r--r-- | xbyak/xbyak_mnemonic.h | 2 |
5 files changed, 31 insertions, 5 deletions
@@ -1,5 +1,5 @@ -Xbyak 4.84 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++ +Xbyak 4.85 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++ ============= Abstract @@ -277,6 +277,7 @@ The header files under xbyak/ are independent of cybozulib. History ------------- +* 2015/Aug/10 ver 4.85 Address::operator==() is not correct(thanks to inolen) * 2015/Jun/22 ver 4.84 call() support variadic template if available(thanks to randomstuff) * 2015/Jun/16 ver 4.83 support movbe(thanks to benvanik) * 2015/May/24 ver 4.82 support detection of F16C @@ -1,5 +1,5 @@ - C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 4.84
+ C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 4.85
-----------------------------------------------------------------------------
◎概要
@@ -296,6 +296,7 @@ cybozulibは単体テストでのみ利用されていて、xbyak/ディレク� -----------------------------------------------------------------------------
◎履歴
+2015/08/10 ver 4.85 Address::operator==()が間違っている(thanks to inolen)
2015/07/22 ver 4.84 call()がvariadic template対応
2015/05/24 ver 4.83 mobveサポート(thanks to benvanik)
2015/05/24 ver 4.82 F16Cが使えるかどうかの判定追加
diff --git a/test/misc.cpp b/test/misc.cpp index 76a4d56..9b33497 100644 --- a/test/misc.cpp +++ b/test/misc.cpp @@ -21,3 +21,14 @@ CYBOZU_TEST_AUTO(setSize) } } code; } + +CYBOZU_TEST_AUTO(compOperand) +{ + using namespace Xbyak::util; + CYBOZU_TEST_ASSERT(eax == eax); + CYBOZU_TEST_ASSERT(ecx != xmm0); + CYBOZU_TEST_ASSERT(ptr[eax] == ptr[eax]); + CYBOZU_TEST_ASSERT(dword[eax] != ptr[eax]); + CYBOZU_TEST_ASSERT(ptr[eax] != ptr[eax+3]); + CYBOZU_TEST_ASSERT(ptr[eax] != ptr[eax+3]); +}
\ No newline at end of file diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index ee5b65d..13242b2 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -100,7 +100,7 @@ namespace Xbyak { enum { DEFAULT_MAX_CODE_SIZE = 4096, - VERSION = 0x4840 /* 0xABCD = A.BC(D) */ + VERSION = 0x4850 /* 0xABCD = A.BC(D) */ }; #ifndef MIE_INTEGER_TYPE_DEFINED @@ -411,7 +411,8 @@ public: } throw Error(ERR_INTERNAL); } - bool operator==(const Operand& rhs) const { return idx_ == rhs.idx_ && kind_ == rhs.kind_ && bit_ == rhs.bit_; } + bool isSameNotInherited(const Operand& rhs) const { return idx_ == rhs.idx_ && kind_ == rhs.kind_ && bit_ == rhs.bit_; } + bool operator==(const Operand& rhs) const; bool operator!=(const Operand& rhs) const { return !operator==(rhs); } }; @@ -870,8 +871,20 @@ public: void setRex(uint8 rex) { rex_ = rex; } void setLabel(const Label* label) { label_ = label; } const Label* getLabel() const { return label_; } + bool operator==(const Address& rhs) const + { + return getBit() == rhs.getBit() && size_ == rhs.size_ && rex_ == rhs.rex_ && disp_ == rhs.disp_ && label_ == rhs.label_ && isOnlyDisp_ == rhs.isOnlyDisp_ + && is64bitDisp_ == rhs.is64bitDisp_ && is32bit_ == rhs.is32bit_ && isVsib_ == rhs.isVsib_ && isYMM_ == rhs.isYMM_; + } + bool operator!=(const Address& rhs) const { return !operator==(rhs); } }; +inline bool Operand::operator==(const Operand& rhs) const +{ + if (isMEM() && rhs.isMEM()) return static_cast<const Address&>(*this) == static_cast<const Address&>(rhs); + return isSameNotInherited(rhs); +} + class AddressFrame { private: void operator=(const AddressFrame&); diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h index 75d52e0..6f3bdb5 100644 --- a/xbyak/xbyak_mnemonic.h +++ b/xbyak/xbyak_mnemonic.h @@ -1,4 +1,4 @@ -const char *getVersionString() const { return "4.84"; } +const char *getVersionString() const { return "4.85"; } void packssdw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x6B); } void packsswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x63); } void packuswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x67); } |