PeachPy满足Opcodes:从Python直接生成机器代码

Marat Dukhan
{"title":"PeachPy满足Opcodes:从Python直接生成机器代码","authors":"Marat Dukhan","doi":"10.1145/2835857.2835860","DOIUrl":null,"url":null,"abstract":"We introduce Opcodes, a Python package which presents x86 and x86-64 instruction sets as a set of high-level objects. Opcodes provides information about instruction names, implicit and explicit operands, and instruction encoding. We use the Opcodes package to auto-generate instruction classes for PeachPy, an x86-64 assembler embedded in Python, and enable new functionality.\n The new PeachPy functionality lets low-level optimization experts write high-performance assembly kernels in Python, load them as callable Python functions, test the kernels using numpy and generate object files for Windows, Linux, and Mac OS X entirely within Python. Additionally, the new PeachPy can generate and run assembly code inside Chromium-based browsers by leveraging Native Client technology. Beyond that, PeachPy gained ability to target Google Go toolchain, by generating either source listing for Go assembler, or object files that can be linked with Go toolchain.\n With backends for Windows, Linux, Mac OS X, Native Client, and Go, PeachPy is the most portable way to write high-performance kernels for x86-64 architecture.","PeriodicalId":171838,"journal":{"name":"Workshop on Python for High-Performance and Scientific Computing","volume":"294 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-11-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":"{\"title\":\"PeachPy meets Opcodes: direct machine code generation from Python\",\"authors\":\"Marat Dukhan\",\"doi\":\"10.1145/2835857.2835860\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"We introduce Opcodes, a Python package which presents x86 and x86-64 instruction sets as a set of high-level objects. Opcodes provides information about instruction names, implicit and explicit operands, and instruction encoding. We use the Opcodes package to auto-generate instruction classes for PeachPy, an x86-64 assembler embedded in Python, and enable new functionality.\\n The new PeachPy functionality lets low-level optimization experts write high-performance assembly kernels in Python, load them as callable Python functions, test the kernels using numpy and generate object files for Windows, Linux, and Mac OS X entirely within Python. Additionally, the new PeachPy can generate and run assembly code inside Chromium-based browsers by leveraging Native Client technology. Beyond that, PeachPy gained ability to target Google Go toolchain, by generating either source listing for Go assembler, or object files that can be linked with Go toolchain.\\n With backends for Windows, Linux, Mac OS X, Native Client, and Go, PeachPy is the most portable way to write high-performance kernels for x86-64 architecture.\",\"PeriodicalId\":171838,\"journal\":{\"name\":\"Workshop on Python for High-Performance and Scientific Computing\",\"volume\":\"294 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2015-11-15\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"4\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Workshop on Python for High-Performance and Scientific Computing\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/2835857.2835860\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Workshop on Python for High-Performance and Scientific Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2835857.2835860","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 4

摘要

我们将介绍Opcodes,这是一个Python包,它将x86和x86-64指令集表示为一组高级对象。操作码提供有关指令名称、隐式和显式操作数以及指令编码的信息。我们使用Opcodes包为PeachPy(一个嵌入在Python中的x86-64汇编器)自动生成指令类,并启用新功能。新的PeachPy功能允许低级优化专家在Python中编写高性能的汇编内核,将它们加载为可调用的Python函数,使用numpy测试内核,并完全在Python中为Windows, Linux和Mac OS X生成对象文件。此外,新的PeachPy可以利用Native Client技术在基于chromium的浏览器中生成和运行汇编代码。除此之外,PeachPy通过生成Go汇编器的源代码清单或可以与Go工具链链接的目标文件,获得了针对谷歌Go工具链的能力。对于Windows, Linux, Mac OS X, Native Client和Go的后端,PeachPy是为x86-64架构编写高性能内核的最可移植的方式。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
PeachPy meets Opcodes: direct machine code generation from Python
We introduce Opcodes, a Python package which presents x86 and x86-64 instruction sets as a set of high-level objects. Opcodes provides information about instruction names, implicit and explicit operands, and instruction encoding. We use the Opcodes package to auto-generate instruction classes for PeachPy, an x86-64 assembler embedded in Python, and enable new functionality. The new PeachPy functionality lets low-level optimization experts write high-performance assembly kernels in Python, load them as callable Python functions, test the kernels using numpy and generate object files for Windows, Linux, and Mac OS X entirely within Python. Additionally, the new PeachPy can generate and run assembly code inside Chromium-based browsers by leveraging Native Client technology. Beyond that, PeachPy gained ability to target Google Go toolchain, by generating either source listing for Go assembler, or object files that can be linked with Go toolchain. With backends for Windows, Linux, Mac OS X, Native Client, and Go, PeachPy is the most portable way to write high-performance kernels for x86-64 architecture.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术文献互助群
群 号:604180095
Book学术官方微信