Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005795OCamlback end (clambda to assembly)public2012-10-18 15:062015-12-11 19:19
Assigned Tolefessan 
PlatformOSOS Version
Product Version4.00.1 
Target VersionFixed in Version4.01.0+dev 
Summary0005795: [patch] Generate sqrtsd opcode instead of external call to sqrt on amd64
DescriptionThe sqrt function can be optimised by calling directly the processor instruction, avoiding a call.
Additional InformationThe patch was not tested on windows
TagsNo tags attached.
Attached Filespatch file icon 0001-Generate-sqrtsd-instruction-on-amd64.patch [^] (3,783 bytes) 2012-10-18 15:06 [Show Content]

- Relationships
related to 0006020closed sqrt(-0.) does not yield -0. 

-  Notes
lefessan (developer)
2012-11-09 14:27

Applied in trunk at revision r13086.
frisch (developer)
2012-12-18 11:48

Has anyone done any performance comparison? I'm curious about the performance gains to be expected, to see if it's worth the trouble extending the 32-bit (x87) backend as well (this backend is still very much useful for Windows...).
chambart (developer)
2012-12-18 13:21

As far as I know the x87 backend is already doing that. See i386/ line 240.
xleroy (administrator)
2013-06-09 11:17

> As far as I know the x87 backend is already doing that.

But only if -ffast-math is selected. Not using "fsin", "fcos", etc by default is justified because those instructions are not quite 100% IEEE754 compliant. But it could make sense to always generate "fsqrt" since, AFAIK, this instruction implements proper IEEE754 behavior. This would have the advantage of working around bugs in Win32 CRT's sqrt() function, cf. PR#6020.

- Issue History
Date Modified Username Field Change
2012-10-18 15:06 chambart New Issue
2012-10-18 15:06 chambart File Added: 0001-Generate-sqrtsd-instruction-on-amd64.patch
2012-11-09 14:27 lefessan Note Added: 0008469
2012-11-09 14:27 lefessan Status new => resolved
2012-11-09 14:27 lefessan Fixed in Version => 4.01.0+dev
2012-11-09 14:27 lefessan Resolution open => fixed
2012-11-09 14:27 lefessan Assigned To => lefessan
2012-12-18 11:48 frisch Note Added: 0008626
2012-12-18 13:21 chambart Note Added: 0008627
2013-06-09 11:14 xleroy Relationship added related to 0006020
2013-06-09 11:17 xleroy Note Added: 0009444
2015-12-11 19:19 xleroy Status resolved => closed
2017-02-23 16:35 doligez Category OCaml backend (code generation) => Back end (clambda to assembly)
2017-02-23 16:44 doligez Category Back end (clambda to assembly) => back end (clambda to assembly)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker