alg_in->cost.latency += op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = m;
best_alg->op[best_alg->ops] = alg_shift;
}
alg_in->cost.latency += op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = m;
best_alg->op[best_alg->ops] = alg_shift;
}
alg_in->cost.latency += op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = 0;
best_alg->op[best_alg->ops] = alg_sub_t_m2;
}
alg_in->cost.latency += op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = 0;
best_alg->op[best_alg->ops] = alg_add_t_m2;
}
alg_in->cost.latency += op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = m;
best_alg->op[best_alg->ops] = alg_sub_t_m2;
}
alg_in->cost.latency = op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = m;
best_alg->op[best_alg->ops] = alg_add_factor;
}
alg_in->cost.latency = op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = m;
best_alg->op[best_alg->ops] = alg_sub_factor;
}
alg_in->cost.latency += op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = m;
best_alg->op[best_alg->ops] = alg_add_t2_m;
}
alg_in->cost.latency += op_cost;
if (CHEAPER_MULT_COST (&alg_in->cost, &best_cost))
{
- struct algorithm *x;
best_cost = alg_in->cost;
- x = alg_in, alg_in = best_alg, best_alg = x;
+ std::swap (alg_in, best_alg);
best_alg->log[best_alg->ops] = m;
best_alg->op[best_alg->ops] = alg_sub_t2_m;
}