...
首页> 外文期刊>C - C++ Users Journal >Optimizing C/C++ with Inline Assembly Programming
【24h】

Optimizing C/C++ with Inline Assembly Programming

机译:使用内联汇编程序优化C / C ++

获取原文
获取原文并翻译 | 示例

摘要

Assembly programming can be likened to "working without a net" where only the strong dare to venture because many of the tools familiar to C/C++ programmers-such as debuggers and memory tracers-suddenly become near worthless. Fortunately, you can dip your toes into assembly by utilizing assembler instructions. In nearly every instance, the reason for resorting to assembly programming is to increase processing performance. But before you even open your processor opcodes manual, the first question to ask is simple: How fast does the code need to execute? Obviously, there is an upper limit on how fast a particular algorithm or function will execute. Once you determine that the larger work (to which this smaller element is a part of) benefits from a performance boost, it is important to quantify the theoretical limit. Although it varies between processor architectures, the key elements are clock rate and quantity of data. Things get more involved in refining this estimation with today's long pipeline, branch-predicting, and multiple execution-unit processors, so the input from an experienced architecture guru would be worthwhile.
机译:汇编编程可以比作“没有网络就可以工作”,因为只有C / C ++程序员熟悉的许多工具(例如调试器和内存跟踪器)突然变得几乎一文不值,所以敢于冒险。幸运的是,您可以利用汇编程序的说明将脚趾浸入到汇编中。在几乎每种情况下,诉诸汇编编程的原因都是为了提高处理性能。但是,在您甚至未打开处理器操作码手册之前,首先要问的问题很简单:代码需要执行多快?显然,特定算法或函数的执行速度有一个上限。一旦确定较大的工作(较小的元素是其中的一部分)可以从性能提升中受益,那么量化理论极限就很重要。尽管它在处理器体系结构之间有所不同,但关键要素是时钟速率和数据量。当今较长的流水线,分支预测和多个执行单元处理器使事情变得更加复杂,因此来自经验丰富的体系结构专家的意见将是值得的。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号