简体   繁体   English

x86内联Yasm转换为x64

[英]x86 inline yasm convert to x64

I have project used inline yasm to implement. 我有使用嵌入式Yasm实施的项目。 Now, the project use openMP to parallel task getting better performance. 现在,该项目使用openMP并行执行任务以获得更好的性能。 At x86 platform, The openMP can't run, the reason is that x86 environment have no enough memory. 在x86平台上,openMP无法运行,原因是x86环境没有足够的内存。 So I use x64 environment compile it and it can running. 所以我用x64环境编译它并且可以运行。 but when I use yasm code to optimize performance, it doesn't work as well.(the code of yasm is written by x86 environment.) 但是当我使用yasm代码优化性能时,它就不能正常工作。(yasm的代码是由x86环境编写的。)

I searched all about it, but I cannot find any useful information to solve this problem. 我搜索了所有内容,但是找不到任何有用的信息来解决此问题。

Who can tell me the way to solve the problem. 谁能告诉我解决问题的方法。 I want to see that some document with relation information. 我想看一些带有关联信息的文档。

Thank you for your help. 谢谢您的帮助。

Without your code my best guess is you should read this for AMD64 ABI and see calling convention standard in x64 platform. 没有你的代码我最好的猜测是,你应该阅读对于AMD64 ABI看看调用约定标准的x64平台。 I think this should work for you. 我认为这对你有用。 As on that document says you must pass parameter as follow (please note that you must classified your arguments first with method describing in ABI standard) : 如该文档中所述,您必须按以下方式传递参数(请注意,必须首先使用ABI标准中描述的方法对参数进行分类):

  1. If the class is MEMORY, pass the argument on the stack. 如果类是MEMORY,则在堆栈上传递参数。
  2. If the class is INTEGER, the next available register of the sequence %rdi , %rsi , %rdx , %rcx , %r8 and %r9 is used. 如果该类是INTEGER,则使用序列%rdi%rsi%rdx%rcx%r8%r9的下一个可用寄存器。
  3. If the class is SSE, the next available vector register is used, the registers are taken in the order from %xmm0 to %xmm7 . 如果类是SSE,则使用下一个可用的向量寄存器,这些寄存器的顺序为%xmm0%xmm7

... ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM