Open ericastor opened 4 years ago
All conditional moves also have differing behavior which are not in the different behavior list. I'm considering making a list of differences I can find soon to help out.
This is going to be somewhat tricky on x86-64; the introduction of PC-relative addressing means we need to figure out how that needs to be handled for references to symbols in the surrounding C/C++, and the fact that MSVC does not support inline assembly on x86-64 at all means we don't have a proven model to reverse-engineer.
I suspect this will take quite a bit of trial-and-error.
Extended Description
While investigating llvm/llvm-project#43617 , I've found many cases where inline assembly that manipulates function pointers compiles to different results with cl.exe and clang.
Specifically, mov and lea behave badly when addressing most function pointer values. lea is sometimes functionally equivalent on x86, but breaks if used on x86-64.
Also, branching instructions (call, jmp, jcc, etc.) differ in handling any case involving arithmetic on a function pointer.
The attachment contains specific examples.