diff options
author | MITSUNARI Shigeo <[email protected]> | 2020-08-25 13:58:52 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2020-08-25 13:58:52 +0900 |
commit | 18c9caaa0a3ed5706c39f5aa86cce0db6e65b174 (patch) | |
tree | 35c2d8f524c5700575e1feb6fd50a7f700af5f46 | |
parent | be492be1a4979617d323fb572958d4478edfbb51 (diff) | |
parent | 3966ba9d34a874e5cadbc46d74f58aee020938e2 (diff) | |
download | xbyak-18c9caaa0a3ed5706c39f5aa86cce0db6e65b174.tar.gz xbyak-18c9caaa0a3ed5706c39f5aa86cce0db6e65b174.zip |
Merge branch 'densamoilov-fix-mov-interface' into devv5.95
-rw-r--r-- | xbyak/xbyak.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index 035ea85..928fbc9 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -2507,15 +2507,12 @@ public: XBYAK_THROW(ERR_BAD_COMBINATION) } } - void mov(const NativeReg& reg, const char *label) // can't use std::string - { - if (label == 0) { - mov(static_cast<const Operand&>(reg), 0); // call imm - return; - } - mov_imm(reg, dummyAddr); - putL(label); - } + + // The template is used to avoid ambiguity when the 2nd argument is 0. + // When the 2nd argument is 0 the call goes to + // `void mov(const Operand& op, uint64 imm)`. + template <typename T1, typename T2> + void mov(const T1& reg, const T2 *label) { T1::unimplemented_function; } void mov(const NativeReg& reg, const Label& label) { mov_imm(reg, dummyAddr); @@ -2735,6 +2732,14 @@ public: #endif }; +template <> +inline void CodeGenerator::mov(const NativeReg& reg, const char *label) // can't use std::string +{ + assert(label); + mov_imm(reg, dummyAddr); + putL(label); +} + namespace util { static const Mmx mm0(0), mm1(1), mm2(2), mm3(3), mm4(4), mm5(5), mm6(6), mm7(7); static const Xmm xmm0(0), xmm1(1), xmm2(2), xmm3(3), xmm4(4), xmm5(5), xmm6(6), xmm7(7); |