Extending the C/C\texttt{++} Model with Inline Assembly

Paulo Emílio de Vilhena, Ori Lahav, Viktor Vafeiadis, Azalea Raad
{"title":"Extending the C/C\\texttt{++} Model with Inline Assembly","authors":"Paulo Emílio de Vilhena, Ori Lahav, Viktor Vafeiadis, Azalea Raad","doi":"arxiv-2408.17208","DOIUrl":null,"url":null,"abstract":"Programs written in C/C\\texttt{++} often include \\textit{inline assembly}: a\nsnippet of architecture-specific assembly code used to access low-level\nfunctionalities that are impossible or expensive to simulate in the source\nlanguage. % Although inline assembly is widely used, its semantics has not yet\nbeen formally studied. In this paper, we overcome this deficiency by investigating the effect of\ninline assembly on the \\textit{consistency} semantics of~C/C\\texttt{++}\nprograms. % We propose the first memory model of the~C\\texttt{++} Programming\nLanguage with support for inline assembly for Intel's \\textsf{x86} including\n\\textit{non-temporal stores} and \\textit{store fences}. % We argue that\nprevious provably correct compiler optimizations and correct compiler mappings\nshould remain correct under such an extended model and we prove that this\nrequirement is met by our proposed model.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"5 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2408.17208","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Programs written in C/C\texttt{++} often include \textit{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 \textit{consistency} semantics of~C/C\texttt{++} programs. % We propose the first memory model of the~C\texttt{++} Programming Language with support for inline assembly for Intel's \textsf{x86} including \textit{non-temporal stores} and \textit{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.
使用内联程序集扩展 C/C\texttt{++} 模型
用 C/Ctexttt{++} 编写的程序通常包括内联汇编:用于访问低级功能的特定体系结构汇编代码片段,而这些功能在源语言中是无法模拟的,或者模拟成本很高。尽管内联汇编被广泛使用,但其语义尚未得到正式研究。在本文中,我们通过研究内联汇编对 ~C/C\texttt{++} 程序语义的影响来克服这一缺陷。我们提出了第一个支持英特尔(Intel)textsf{x86}(包括textit{non-temporal stores}和textit{store fences})内联汇编的~C/Ctexttt{++}编程语言内存模型。我们认为,在这种扩展模型下,先前证明正确的编译器优化和正确的编译器映射应该保持正确,我们证明我们提出的模型满足了这一要求。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信