Martin Kinkelin

Results 756 comments of Martin Kinkelin

Alright, thx a lot for the hard work, cool stuff! :+1:

Hmm good point (and thx for investigating liushuyu!) - I'd expect the call to be optimized away with enabled optimizations then, but not with `-O0`.

clang v19.1.0 also elides calls to `__attribute__((pure))` functions with `-O0` (when not using the return value obviously): https://cpp.godbolt.org/z/r8haxhboY It's still elided with `-O2` and `-O3` though.

`@callingConvention` is highly experimental, I suggest not using it. Do you really still have to deal with 32-bit x86 code?

Wrt. `extern(D)`, that uses Walter's custom ABI for Win32, trying to use EAX for passing an argument: https://dlang.org/spec/abi.html#function_calling_conventions. The spec says it's for Win32 only, but it's actually used for...

`@callingConvention` is so experimental that you don't even get an error when specifying an invalid one :D - try `extern(C) @callingConvention("fastcc")`, that works. See https://llvm.org/docs/LangRef.html#calling-conventions for available stuff, but again,...

IMO not worth the effort, uninteresting 32-bit x86 legacy stuff.

> so, why shouldn't I use it exactly? Because it's a blunt instrument to override the CC as LLVM attribute, totally ignoring what we have to do laboriously in the...

It's not just this custom x86 ABI for D, but e.g. also the regular SysV ABI for non-Windows x86_64 - it's not like LLVM does everything for us, as is...

FWIW, that's all in here: https://github.com/ldc-developers/ldc/blob/61c11b7dafa24d9c67011d03a0b63d3287791c10/gen/uda.cpp#L385-L479