- ferr(po, "TODO imul\n");
- last_arith_dst = &po->operand[0];
+ if (po->operand_cnt == 3)
+ ferr(po, "TODO imul3\n");
+ // fallthrough
+ case OP_MUL:
+ assert_operand_cnt(1);
+ strcpy(buf1, po->op == OP_IMUL ? "(s64)(s32)" : "(u64)");
+ fprintf(fout, " mul_tmp = %seax * %s%s;\n", buf1, buf1,
+ out_src_opr(buf2, sizeof(buf2), po, &po->operand[0], 0));
+ fprintf(fout, " edx = mul_tmp >> 32;\n");
+ fprintf(fout, " eax = mul_tmp;");
+ last_arith_dst = NULL;