Created
June 20, 2012 14:53
-
-
Save xianyi/2960279 to your computer and use it in GitHub Desktop.
Test the binary code of Clang and GCC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
.globl test | |
test: | |
vaddpd 2*8(%rbx,%r10,1),%xmm13,%xmm13 | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Linux, gcc will generate "c4 21 11 58 6c 13 10 vaddpd 0x10(%rbx,%r10,1),%xmm13,%xmm13" .
However, Clang 3.0 on Mac OSX will generate "c4 01 11 58 6c 13 10 vaddpd 0x10(%r11,%r10,1),%xmm13,%xmm13". It's the wrong register!
Apple clang version 3.0 (tags/Apple/clang-211.12) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
Then, I used Clang 3.1 from LLVM website. It works fine.