0

I have project used inline yasm to implement. Now, the project use openMP to parallel task getting better performance. At x86 platform, The openMP can't run, the reason is that x86 environment have no enough memory. So I use x64 environment compile it and it can running. but when I use yasm code to optimize performance, it doesn't work as well.(the code of yasm is written by x86 environment.)

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.

xiangjian Wu
  • 116
  • 1
  • 1
  • 8
  • 1
    It sounds like you'll have to rewrite that inline assembly code. It's unclear from your question exactly what you're having trouble with. – Michael Feb 09 '15 at 06:35
  • I'm looking for how to convert this? – xiangjian Wu Feb 09 '15 at 07:02
  • Have any foundation to call x86 yasm with x64 project? – xiangjian Wu Feb 09 '15 at 07:03
  • 1
    You don't call x86 code with a x64 project. It's not exactly true that you can't, but doing it is a terrible hack and you really shouldn't. Just convert it to x64 code, it's not hard unless you're using some crazy deprecated instruction (such as `daa` and its friends). – harold Feb 09 '15 at 08:01
  • 1
    please add your code in your problem – Parham Alvani Feb 09 '15 at 09:03
  • Related: http://stackoverflow.com/questions/27080388/differences-of-x86-and-x86-64-machine-code , http://stackoverflow.com/questions/11897116/how-to-convert-linux-32-bit-gcc-inline-assembly-to-64-bit-code . – nrz Feb 09 '15 at 10:37

1 Answers1

0

Without your code my best guess is you should read this for AMD64 ABI and see calling convention standard in x64 platform. 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) :

  1. If the class is MEMORY, pass the argument on the stack.
  2. If the class is INTEGER, the next available register of the sequence %rdi, %rsi, %rdx, %rcx, %r8 and %r9 is used.
  3. If the class is SSE, the next available vector register is used, the registers are taken in the order from %xmm0 to %xmm7.

...

Parham Alvani
  • 2,305
  • 2
  • 14
  • 25