Browse Source

light modification

Nicolas Winkler 7 năm trước cách đây
mục cha
commit
ff81669105
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      src/AssemblyGenerator.cpp

+ 5 - 1
src/AssemblyGenerator.cpp

@@ -167,7 +167,11 @@ void AssemblyGenerator::compileMult(Index index, Cell factor)
     }
     // check if factor is power of two
     else if ((factor & (factor - 1)) == 0) {
-        if (factor <= 8) {
+        if (factor == 2) {
+            write("leal (%rax,%rax), %ecx");
+            write("addb %cl, ", index, ptr());
+        }
+        else if (factor <= 8) {
             write("leal (,%eax,", int(factor), "), %ecx");
             write("addb %cl, ", index, ptr());
         }