Bug 15008 – floor(float x) and floor(double x) have no FPU implementation

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-09-03T12:38:51Z
Last change time
2024-12-01T16:25:02Z
Keywords
performance
Assigned to
No Owner
Creator
ponce
Moved to GitHub: phobos#9664 →

Comments

Comment #0 by aliloko — 2015-09-03T12:38:51Z
This came up in JPEG decoding performance measurement. https://github.com/lgvz/imageformats/issues/4 Commit here: https://github.com/p0nce/imageformats/commit/dd9a7a21e270da365eef58722557080493b9a86c 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.
Comment #1 by aliloko — 2015-09-03T12:39:45Z
Comment #2 by ibuclaw — 2017-12-12T23:14:37Z
Not fixing the issue (have an FPU implementation for D_InlineAsm targets), but should make things better. https://github.com/dlang/phobos/pull/5820
Comment #3 by robert.schadek — 2024-12-01T16:25:02Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9664 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB