Extending the C/C++ Memory Model with Inline Assembly

Programs written in C/C++ often include inline assembly : a snippet of architecture-specific assembly code used to access low-level functionalities that are impossible or expensive to simulate in the source language. Although inline assembly is widely used, its semantics has not yet been formally studied. In this paper, we overcome this deficiency by investigating the effect of inline assembly on the consistency semantics of C/C++ programs. We propose the first memory model of the C++ Programming Language with support for inline assembly for Intel’s x86 including non-temporal stores and store fences . We argue that previous provably correct compiler optimizations and correct compiler mappings should remain correct under such an extended model and we prove that this requirement is met by our proposed model.

Authors

Institutions

Publication Details

Journal
Proceedings of the ACM on Programming Languages
Published
2024-10-08
DOI
https://doi.org/10.1145/3689749
Primary Topic
Parallel Computing and Optimization Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Extending the C/C++ Memory Model with Inline Assembly

Paulo Emílio de Vilhena, Viktor Vafeiadis, Azalea Raad, Ori Lahav
Proceedings of the ACM on Programming Languages
Parallel Computing and Optimization Techniques
article

Extending the C/C++ Memory Model with Inline Assembly

Paulo Emílio de Vilhena, Viktor Vafeiadis, Azalea Raad, Ori Lahav
article en

Abstract

Programs written in C/C++ often include inline assembly : a snippet of architecture-specific assembly code used to access low-level functionalities that are impossible or expensive to simulate in the source language. Although inline assembly is widely used, its semantics has not yet been formally studied. In this paper, we overcome this deficiency by investigating the effect of inline assembly on the consistency semantics of C/C++ programs. We propose the first memory model of the C++ Programming Language with support for inline assembly for Intel’s x86 including non-temporal stores and store fences . We argue that previous provably correct compiler optimizations and correct compiler mappings should remain correct under such an extended model and we prove that this requirement is met by our proposed model.

Proceedings of the ACM on Programming LanguagesVol. 8(OOPSLA2)
Tel Aviv University (IL), Max Planck Institute for Software Systems (DE), Imperial College London (GB)
UK Research and Innovation, European Commission, Engineering and Physical Sciences Research Council
Openalex Percentile: Top 84%
Parallel Computing and Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Extending the C/C++ Memory Model with Inline Assembly — Paulo Emílio de Vilhena, Viktor Vafeiadis, et al. · Proceedings of the ACM on Programming Languages (2024) | TGRS Research Map | TGRS