28.01.2015 Views

Exception Handling ABI for the ARM Architecture

Exception Handling ABI for the ARM Architecture

Exception Handling ABI for the ARM Architecture

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Exception</strong> handling <strong>ABI</strong> <strong>for</strong> <strong>the</strong> <strong>ARM</strong> architecture<br />

13 APPENDIX C: UNWINDING INSTRUCTION ENCODING COSTS<br />

In this analysis we assume <strong>the</strong> proportion of functions containing > 64KB of code is negligible. Such functions<br />

require 32 bit offsets in <strong>the</strong> handling table and use long unwinding descriptions.<br />

(Aside: We could introduce a fourth personality routine to handle <strong>the</strong> rare case of > 64KB functions that are<br />

none<strong>the</strong>less easy to unwind, but today this does not seem to be good use of <strong>the</strong> encoding space. End aside).<br />

We are principally concerned with <strong>the</strong> cost of unwinding C functions, where <strong>the</strong> cost is pure overhead. In C++,<br />

additional functionality justifies <strong>the</strong> cost. Treating <strong>the</strong> <strong>ARM</strong> code-size database as C gives <strong>the</strong> following table.<br />

Table 5, Cost of unwinding only (C-style)<br />

<strong>ARM</strong> code-size database build option<br />

RO size<br />

(bytes)<br />

Index table size<br />

(including short unwinding)<br />

Extra cost of<br />

long unwinding<br />

<strong>ARM</strong>-state, software floating-point, -O1 9,327,956 30033 * 8<br />

(2.6%)<br />

Thumb-state, software floating-point, -O1 6,275,440 30208 * 8<br />

(3.9%)<br />

<strong>ARM</strong>-state, VFP, -O1 8,776,180 30035 * 8<br />

(2.7%)<br />

210 * 8<br />

(0.02%)<br />

218 * 8<br />

(.03%)<br />

268 * 8<br />

(0.02%)<br />

Overheads –O2 are very similar (<strong>for</strong> example, 4% instead of 3.9% in Thumb-state).<br />

In particular:<br />

<br />

<br />

Only about 200 frames of more than 30,000 need more than 3 unwinding instructions, whe<strong>the</strong>r <strong>the</strong> code is<br />

built to use software floating point (no floating-point unwinding) or built to use VFP.<br />

No frame requires more than 7 unwinding instructions (so <strong>the</strong> long <strong>for</strong>mat consumes at most 1 extra word).<br />

<strong>ARM</strong> IHI 0038A Copyright © 2002-2005, 2007 <strong>ARM</strong> Limited. All rights reserved. Page 50 of 50

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!