asmdiff is a command-line tool for inspecting and comparing the assembly generated for individual C functions.
It helps developers understand how source changes, compiler versions, optimisation flags and target architectures affect compiler code generation.
The tool can compare paired functions, examine the same function across source revisions, or inspect functions within a linked ELF binary. Results include side-by-side assembly listings, instruction counts, loop spans and outbound function calls. asmdiff supports compiler matrices, cross-compilers, TOML-based target profiles, compilation databases and machine-readable JSON output.
This is free and open source software.
Key Features
- Compares assembly generated for individual C functions.
- Runs source code across matrices of compilers and compiler flags.
- Automatically pairs functions using old_ and new_ prefixes.
- Compares the same function across two source files or revisions.
- Inspects functions contained in linked ELF binaries.
- Reports instruction counts, loop spans and outbound calls.
- Displays assembly listings side by side.
- Collapses unchanged assembly while retaining surrounding context.
- Provides per-loop instruction statistics.
- Supports GCC, Clang and cross-compilation toolchains.
- Offers named compiler targets through TOML configuration files.
- Can borrow build flags from compile_commands.json files.
- Exports results in JSON format for scripting and continuous integration.
- Uses only modules from the Python standard library.
Website: github.com/rt-rtos/asmdiff
Support:
Developer: Rasmus Tikkanen
License: MIT License

asmdiff is written in Python. Learn Python with our recommended free books and free tutorials.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |


Please read our Comment Policy before commenting.