-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline Assembler #228
Comments
Link? |
You can download #elif (defined(__GNUC__) && defined(__x86_64__))
__inline__ sqlite_uint64 sqlite3Hwtime(void){
unsigned long val;
__asm__ __volatile__ ("rdtsc" : "=A" (val));
return val;
} |
Thanks for reporting this. It's interesting that you ran into this error when the mac and linux versions of clang on Travis did not. It must be because the preprocessor did not output this code. Unfortunately Go does not support inline asm, so I'm not sure what the longer term fix for this is (perhaps using configuration to stub off such functions that contain asm). However, I will put a fix for the syntax parser in today. |
See #229 |
Thanks for addressing the issue! I did not actually run into this problem on sqlite3; I'm just looking how different projects handle inline assembly. In Sulong, a C/LLVM IR interpreter on the JVM, we want to support inline assembly and have started to implement inline assembly for AMD64 by emulating its behavior in Java. For example, see the implementation of the I'm currently doing an analysis of >1000 Github projects to determine which inline assembly instructions to implement to support as many projects as possible. |
That's interesting I would like to see the results of the study. I'm not at all familiar with assembly. However if it is a requirement people need when converting their C code there are some more creative solutions that may work... |
In according to README of project https://github.com/minio/c2goasm , this is can help. |
Inline assembler is not supported by c2go, for example, the code fragment below.
Currently, having inline assembler in a program to be converted results in an error message:
panic: unknown node type: 'GCCAsmStmt 0x3a991f8 <line:5:3, col:38>'
.Note that sqlite3 also contains a similar code fragment.
The text was updated successfully, but these errors were encountered: