Re: official gnu as reference for x86 instructions - specifically cmpxchg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



在 2024-05-15 17:11, anand akhare via Gcc-help 写道:
Hello gcc team,
     my question is quite basic. I am looking for exhaustive complete reference for x86 instructions in gnu assembly. I searched a bit but most of my searches are pointing outside gnu.org. I am specifically looking for cmpxchg and atomic instructions related reference. I could not find anything definitive there or I am might be missing obvious.

The only official documentation of x86 instructions is the Intel Software Develop Manual.

However it's pure Intel syntax, so what should we do? There is a great cross compiler; it's called Clang! You can compile Intel assembly to AT&T assembly and copy the result. It works mostly.

For example (https://gcc.godbolt.org/z/xTxKPxjrr):
```
__asm__ (R"(
  .intel_syntax noprefix

  lock cmpxchg DWORD PTR [rsi], ecx

)");
```

This gives
```
.text:
 lock cmpxchg %ecx,(%rsi)
```




--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux