switch (op) { case IRINST_OP_ADD: // 加法指令,二元运算 str = result->getName() + " = add " + src1->getName() + ", " + src2->getName(); break; case IRINST_OP_MUL: // 减法指令,二元运算 str = result->getName() + " = mul " + src1->getName() + ", " + src2->getName(); break; //add_no2:sub case IRINST_OP_SUB: //减法指令 str = result->getName() + " = sub " + src1->getName() + ", " + src2->getName(); break;仿照这个写一个除法指令的
时间: 2023-12-06 22:40:23 浏览: 109
switch (op) {
case IRINST_OP_ADD:
// 加法指令,二元运算
str = result->getName() + " = add " + src1->getName() + ", " + src2->getName();
break;
case IRINST_OP_MUL:
// 乘法指令,二元运算
str = result->getName() + " = mul " + src1->getName() + ", " + src2->getName();
break;
case IRINST_OP_SUB:
// 减法指令,二元运算
str = result->getName() + " = sub " + src1->getName() + ", " + src2->getName();
break;
case IRINST_OP_DIV:
// 除法指令,二元运算
str = result->getName() + " = div " + src1->getName() + ", " + src2->getName();
break;
}
阅读全文