Logo image
Extending the C/C++ Memory Model with Inline Assembly
Conference proceeding   Open access

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

Paulo Emilio De Vilhena, Ori Lahav, Viktor Vafeiadis and Azalea Raad
Proceedings of ACM on programming languages, Vol.8(OOPSLA), pp.1081-1107
OOPSLA 2024 (Pasadena, California, United States, 20/10/2024–25/10/2024)
08/10/2024

Abstract

Architectures Computer systems organization Concurrency Formal language definitions Semantics and reasoning Software and its engineering Theory of computation
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.
url
https://doi.org/10.1145/3689749View
Published (Version of record)

Metrics

1 Record Views

Details

Logo image

Usage Policy