Understanding Code Similarity across Instruction Set Architectures: An Empirical Study
Software interacts with hardware through Instruction Set Architectures (ISAs), such as x86, ARM, and RISC-V. Although many developers may be unaware of ISA heterogeneity, ISA-specific code is pervasive in foundational software systems that underpin the digital infrastructure of human society. Maintaining separate implementations is common when supporting multiple ISAs in such a foundational software project. This may introduce substantial additional effort. Meanwhile, separate ISA-specific implementations frequently exhibit code similarities across ISAs. While prior code similarity research has largely focused on general-purpose clones or cross-language settings, similarity in ISA-specific implementations remains underexplored. To understand ISA-specific code and their similarities, and to gain insights for better management, we conducted an empirical study of 20 open-source foundational projects that support multiple ISAs. We confirmed the need for separate ISA-specific implementations by identifying the roles and characteristics of large-scale ISA-specific code, with assistance from large language models (LLMs). Our analysis of the ISA-specific code revealed a weighted average similarity of 21.7% across ISAs. We also observed cross-ISA co-change and cross-ISA participation patterns in the development and maintenance of ISA-specific code. By centering on ISA-specific implementations rather than general-purpose clones, this study provides a dedicated empirical characterization of a practically important but underexplored code-similarity setting, yielding evidence that can inform both researchers and practitioners working on ISA-related software engineering.
Authors
- Jun Wei (ORCID: https://orcid.org/0000-0002-8561-2481)
- Yingying Zheng (ORCID: https://orcid.org/0009-0000-2814-0273)
- Huang Tao (ORCID: https://orcid.org/0009-0006-4875-732X)
- Jiaxin Zhu (ORCID: https://orcid.org/0000-0002-0905-2355)
- Wei Wang (ORCID: https://orcid.org/0009-0005-4941-9237)
- Yuwei Zhang (ORCID: https://orcid.org/0009-0008-1016-7361)
- Haonan Yu (ORCID: https://orcid.org/0009-0006-6005-6999)
Institutions
- Chinese Academy of Sciences (CN)
- Nanjing Institute of Technology (CN)
- Institute of Software (CN)
- University of Chinese Academy of Sciences (CN)
Publication Details
- Journal
- Proceedings of the ACM on software engineering.
- Published
- 2026-06-30
- DOI
- https://doi.org/10.1145/3808119
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Youth Innovation Promotion Association of the Chinese Academy of Sciences