unlikely in LDC

lithium iodate whatdoiknow at doesntexist.net
Mon May 27 12:17:06 UTC 2019


On Monday, 27 May 2019 at 12:08:36 UTC, Alexandru Militaru wrote:
> Hello!
>
> Does LDC has its own counterpart for GCC's __builtin_expect?
>
> To be more specific, I need something to replicate the 
> behaviour of these two macros:
>
> #define likely(x)       __builtin_expect(!!(x), 1)
> #define unlikely(x)     __builtin_expect(!!(x), 0)

you can find llvm_expect(T)(T val, T expectedVal) in the module 
ldc.intrinsics


More information about the digitalmars-d-ldc mailing list