A set of benchmark programs is available to evaluate the performance of the generated code. The benchmark uses the 68HC11 timer to compute the number of cycles spent during the execution of the code.

The following code extract is used to benchmark the short multiplication.

  bench_t b;

  bench_init (&b);
  bench_start (&b);
  b = c * d;
  bench_stop ((&b);
  bench_report (&b, "Short mul (%d)", (long) b);

The bench_init prepares for the benchmark, locks the interrupts and computes the benchmark overhead. The bench_start reads the 68HC11 TCNT free running counter and saves the result. The bench_stop performs the same and bench_report computes the time spent between the two calls. The bench_start and bench_stop operations are inlined. The TCNT overflow is not taken into account because it is assumed in this benchmark that operations do not exceed 32 ms (8Mhz clock, pre-scale factor set to 1).

Below are the results obtained with Gcc 2.95.2 using the Gdb simulator or the Axiom Manufacturing CME11 board (same results for both). The benchmark programs are compiled with the following options:

-m68hc11 -mshort -g -Os -fno-defer-pop -msoft-reg-count=0

Basic types
@BENCH_FILE_1@

Float types
@BENCH_FILE_2@

Misc
@BENCH_FILE_3@

Note: Numbers enclosed in parenthesis represent the result of the benchmarked operation.