diff options
author | MITSUNARI Shigeo <[email protected]> | 2015-07-22 22:32:08 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2015-07-22 22:32:08 +0900 |
commit | 1e208fd20225441f9ed02c7470335c731d958ebb (patch) | |
tree | 0ce73205758c667619c09dac76b510d61dd6aacb | |
parent | df615b75812607a049a02a5360ba30313967df33 (diff) | |
download | xbyak-4.84.tar.gz xbyak-4.84.zip |
call supports variadic template if possiblev4.84
-rw-r--r-- | readme.md | 3 | ||||
-rw-r--r-- | readme.txt | 3 | ||||
-rw-r--r-- | sample/test0.cpp | 4 | ||||
-rw-r--r-- | xbyak/xbyak.h | 10 | ||||
-rw-r--r-- | xbyak/xbyak_mnemonic.h | 2 |
5 files changed, 18 insertions, 4 deletions
@@ -1,5 +1,5 @@ -Xbyak 4.83 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++ +Xbyak 4.84 ; 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/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 * 2015/Apr/25 ver 4.81 fix the condition to throw exception for setSize(thanks to whyisthisfieldhere) @@ -1,5 +1,5 @@ - C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 4.83
+ C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 4.84
-----------------------------------------------------------------------------
◎概要
@@ -296,6 +296,7 @@ cybozulibは単体テストでのみ利用されていて、xbyak/ディレク� -----------------------------------------------------------------------------
◎履歴
+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が使えるかどうかの判定追加
2015/04/25 ver 4.81 setSizeが例外を投げる条件を修正(thanks to whyisthisfieldhere)
diff --git a/sample/test0.cpp b/sample/test0.cpp index fda8ef8..e437092 100644 --- a/sample/test0.cpp +++ b/sample/test0.cpp @@ -74,7 +74,11 @@ public: #else mov(eax, ptr [esp + 4]); push(eax); +#ifdef XBYAK_VARIADIC_TEMPLATE + call(atoi); +#else call(Xbyak::CastTo<void*>(atoi)); +#endif add(esp, 4); #endif ret(); diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index 670c6f1..ee5b65d 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -82,6 +82,10 @@ #endif #endif +#if (__cplusplus >= 201103) || (_MSC_VER >= 1800) + #define XBYAK_VARIADIC_TEMPLATE +#endif + #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4514) /* remove inline function */ @@ -96,7 +100,7 @@ namespace Xbyak { enum { DEFAULT_MAX_CODE_SIZE = 4096, - VERSION = 0x4830 /* 0xABCD = A.BC(D) */ + VERSION = 0x4840 /* 0xABCD = A.BC(D) */ }; #ifndef MIE_INTEGER_TYPE_DEFINED @@ -1912,6 +1916,10 @@ public: void call(const char *label) { call(std::string(label)); } void call(const Label& label) { opJmp(label, T_NEAR, 0, B11101000, 0); } // call(function pointer) +#ifdef XBYAK_VARIADIC_TEMPLATE + template<class Ret, class... Params> + void call(Ret(*func)(Params...)) { call(CastTo<const void*>(func)); } +#endif void call(const void *addr) { opJmpAbs(addr, T_NEAR, 0, B11101000); } // special case void movd(const Address& addr, const Mmx& mmx) diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h index 43b18dd..75d52e0 100644 --- a/xbyak/xbyak_mnemonic.h +++ b/xbyak/xbyak_mnemonic.h @@ -1,4 +1,4 @@ -const char *getVersionString() const { return "4.83"; } +const char *getVersionString() const { return "4.84"; } 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); } |