www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15008] New: floor(float x) and floor(double x) have no FPU


          Issue ID: 15008
           Summary: floor(float x) and floor(double x) have no FPU
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: aliloko gmail.com

This came up in JPEG decoding performance measurement.


Commit here:

While the floor() operations in this commit proved useless, I looked at its
implementation in Phobos: https://github.com/lgvz/imageformats/issues/4

It appears that floor(float) and floor(double) have a software-emulation of
floor while floor(real) use the proper FPU instructions.

Why is that?

More over, it would be nice to have lfloor/lceil/ltrunc, since floor calls are
currently usually accompanied with cast to int.

Sep 03 2015