Performance problem with floor

Orvid King via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sun Jun 22 12:33:42 PDT 2014


On 6/22/2014 1:49 PM, bearophile wrote:
> If someone here has followed this thread, ldc2 has big performance
> problems with the function "floor":
>
> http://forum.dlang.org/thread/lo19l7$n2a$1@digitalmars.com
>
> Bye,
> bearophile

Well, unless LDC is doing something somewhere that I can't find, Clang
is using llvm's floor intrinsic, while LDC is using the non-inline asm
version of floor in phobos. There is however a declaration for llvm's
floor intrinsic in ldc.intrinsics : llvm_floor, but, with my limited
knowledge of LDC's inner workings, I don't believe that is what is being
used when you call std.math : floor. core.stdc.math would be using the
standard C library's floor function, which would be using an intrinsic
for floor.


More information about the digitalmars-d-ldc mailing list