[cfe-dev] Stupid 64-bit divide question

per at lumai.se per at lumai.se
Thu Sep 30 04:42:57 PDT 2010


Thanks, that might get me a part of the way, though compiler-rt in turn 
uses GCCisms such as __builtin_ctz and includes <complex.h> which is not 
present in the WinSDK.

Besides, the resulting binary I produced so far acts completely erratic, 
probably due to some calling convention problems... Back to the 
laboratory again, I guess.

//Per

David Chisnall skrev 2010-09-30 13:05:
> These functions should be found in compiler-rt:
>
> http://compiler-rt.llvm.org/
>
> David
>
> On 30 Sep 2010, at 11:16, per at lumai.se wrote:
>
>> Hi all,
>>
>> I am experimenting with compiling C code under Windows (MSVC env., _not_
>> mingw) via COFF ->  exe file using clang x.c -emit-llvm and llc
>> -filetype=obj followed by linking using the MSVC linker. This works well
>> except that some 64 bit arithmetic operations generate libcalls to
>> functions like __divdi3 which have different names/uses in the MSVC
>> runtime (i.e. __divdi3 ~= __alldiv in libcmt.lib). I assume that
>> __divdi3 is something GNU specific. Is there a simple way to influence
>> which libcalls are emitted? Any attempts to define my own __divdi3 seem
>> to be ignored.
>>
>> cheers,
>> Per Lindén




More information about the cfe-dev mailing list