|
@@ -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());
|
|
|
}
|