An Analysis of x86-64 Inline Assembly in C Programs

Manuel Rigger, Stefan Marr, Stephen Kell, David Leopoldseder, Hanspeter Mössenböck

Research output: Chapter in Book/Report/Conference proceedingConference proceedingspeer-review

Abstract

C codebases frequently embed nonportable and unstandard- ized elements such as inline assembly code. Such elements are not well understood, which poses a problem to tool develop- ers who aspire to support C code. This paper investigates the use of x86-64 inline assembly in 1264 C projects from GitHub and combines qualitative and quantitative analyses to answer questions that tool authors may have. We found that 28.1% of the most popular projects contain inline assembly code, although the majority contain only a few fragments with just one or two instructions. The most popular instructions constitute a small subset concerned largely with multicore semantics, performance optimization, and hardware control. Our findings are intended to help developers of C-focused tools, those testing compilers, and language designers seek- ing to reduce the reliance on inline assembly. They may also aid the design of tools focused on inline assembly itself
Original languageEnglish
Title of host publicationProceeding VEE '18 Proceedings of the 14th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments
PublisherACM New York, NY, USA
Number of pages16
ISBN (Print)978-1-4503-5579-7
Publication statusPublished - Mar 2018

Fields of science

  • 102 Computer Sciences
  • 102009 Computer simulation
  • 102011 Formal languages
  • 102013 Human-computer interaction
  • 102022 Software development
  • 102024 Usability research
  • 102029 Practical computer science

JKU Focus areas

  • Computation in Informatics and Mathematics
  • Engineering and Natural Sciences (in general)

Cite this