[Embench] code-size micro-benchmarks

Pavel Tikhonov pavel.tikhonov at wdc.com
Tue Dec 14 08:54:20 CET 2021

Hi All,

Following the meeting on 13/12/2021, here are the notes of code-size benchmarks proposal:

# Code-size compiler micro-benchmarks

## Motivation/History
When porting code to run on a RISCV cores, expectedly, code-size raised as the biggest issue.
And after comparing it with legacy target assembly code, a few compiler's "missed opportunities" were identified.
Each of the "missed opportunities" was reduced to a short test case.
These test cases can be used to assess compiler results in terms of code-size.

## Audience/Users
- Compiler/tools developers who are interested in investigating the compiler generated assembly from the code-size perspective.
- Product developers willing to change their toolchain/compiler.

## Repository structure
     ├── src                                     <-- source code of the test cases
          ├── test_case1                         <-- a specific test case 1
              ├── test_case1.c                   <-- test case 1 source code
              ├── readme.md                      <-- an explanation on what this test case exemplifies
              ├── ....                           <-- more .c/.h files if the test requires.
          ├── test_case2                         <-- a specific test case 2
          ├── test_case3                         <-- a specific test case 3
          ├── ....                               <-- more test cases
     ├── main.c                                  <-- an executable file that should be run automatically by embench test-suit
     ├── results                                 <-- know results per platform
     ├── readme.md                               <-- a readme file that explains how to add new test-cases, build and run tests.

## Assessment methodology
Currently, the main way to assess the compilation results is by investigating text sizes and assembly dumps.
The purpose of this investigation is to define whether it is an ISA limitation or compiler's missed opportunity.

In addition, it is possible to come up with a numeric score, as done for embench-iot. Not a geometric mean of
text section sizes, but maybe just a sum. Also, the results can be presented as bar-chart per micro-benchmark
referencing the standard target.

The tests should run and be self-checking for correctness.

## Usage
  - Adding a new test-case:
    As in embench-iot

Happy holidays

Pavel Tikhonov
R&D Engineering - Firmware & Toolchain, CTO Group

Western Digital(r)
Israel, Migdal Tefen 24959, P.O Box 3
Email: pavel.tikhonov at wdc.com<mailto:pavel.tikhonov at wdc.com>
Office: +972-4-9078716
Mobile: +972-54-2232029

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.librecores.org/pipermail/embench/attachments/20211214/88f25693/attachment.htm>

More information about the Embench mailing list