return a;
}
+static valueT
+vma_abs (offsetT v)
+{
+ return v < 0 ? -(valueT) v : (valueT) v;
+}
+
/* Find the best jump target for the source in the given trampoline chain.
The best jump target is the one that results in the shortest path to the
final target, it's the location of the jump closest to the final target,
chained_target = S_GET_VALUE(next->sym) + next->offset;
off = source - chained_target;
- if (labs (off) >= J_RANGE - J_MARGIN)
+ if (vma_abs (off) >= J_RANGE - J_MARGIN)
break;
i += step;
chained_target = S_GET_VALUE(e->sym) + e->offset;
off = source - chained_target;
- if (labs (off) < J_MARGIN ||
- labs (off) >= J_RANGE - J_MARGIN)
+ if (vma_abs (off) < J_MARGIN
+ || vma_abs (off) >= J_RANGE - J_MARGIN)
return &tc->target;
return tc->entry + i;
}
offsetT delta = target - source;
int n;
- n = (labs (delta) + J_RANGE - J_MARGIN - 1) / (J_RANGE - J_MARGIN);
+ n = (vma_abs (delta) + J_RANGE - J_MARGIN - 1) / (J_RANGE - J_MARGIN);
return source + delta / n;
}
/* Stop if some trampoline is found and the search is more than
J_RANGE / 4 from the projected fulcrum. A trampoline w/o jump
around is nice, but it shouldn't have much overhead. */
- if (best < idx->n_entries && labs (off) > J_RANGE / 4)
+ if (best < idx->n_entries && vma_abs (off) > J_RANGE / 4)
return best;
off = trampoline_frag->fr_address - source;
- if (labs (off) < J_RANGE - J_MARGIN)
+ if (vma_abs (off) < J_RANGE - J_MARGIN)
{
++checked;
/* Stop if a trampoline w/o jump around is found or initialized
target = S_GET_VALUE (s) + fixP->fx_offset;
delta = target - addr;
- if (labs (delta) < J_RANGE - J_MARGIN)
+ if (vma_abs (delta) < J_RANGE - J_MARGIN)
return false;
xtensa_insnbuf_from_chars (isa, trampoline_buf,