aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2020-10-17 11:11:41 +0900
committerMITSUNARI Shigeo <[email protected]>2020-10-17 11:11:41 +0900
commit1f119a04ac5d6b5555a16af4398dcec47adaab8e (patch)
treecc7b9cee70f95fbf20fe1b21a2a0f3af0c75515d
parent29bfd25ba35cad8d43f34f002c2db19f0c0285ec (diff)
downloadxbyak-1f119a04ac5d6b5555a16af4398dcec47adaab8e.tar.gz
xbyak-1f119a04ac5d6b5555a16af4398dcec47adaab8e.zip
support [scale * reg]
-rw-r--r--test/make_nm.cpp1
-rw-r--r--xbyak/xbyak.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/test/make_nm.cpp b/test/make_nm.cpp
index 47eb023..494d8ac 100644
--- a/test/make_nm.cpp
+++ b/test/make_nm.cpp
@@ -643,6 +643,7 @@ class Test {
puts(isXbyak_ ? "out_(dx, al); dump();" : "out dx, al");
puts(isXbyak_ ? "out_(dx, ax); dump();" : "out dx, ax");
puts(isXbyak_ ? "out_(dx, eax); dump();" : "out dx, eax");
+ puts(isXbyak_ ? "lea(eax, ptr[edi + 4 * eax]); dump();" : "lea eax, [edi + 4 * eax]");
}
void putJmp() const
{
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
index 481ec9b..c388492 100644
--- a/xbyak/xbyak.h
+++ b/xbyak/xbyak.h
@@ -924,6 +924,10 @@ inline RegExp operator*(const Reg& r, int scale)
{
return RegExp(r, scale);
}
+inline RegExp operator*(int scale, const Reg& r)
+{
+ return r * scale;
+}
inline RegExp operator-(const RegExp& e, size_t disp)
{
RegExp ret = e;