Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005795OCamlOCaml backend (code generation)public2012-10-18 15:062013-06-09 11:17
Reporterchambart 
Assigned Tolefessan 
PrioritynormalSeverityfeatureReproducibilityalways
StatusresolvedResolutionfixed 
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 0006020resolved sqrt(-0.) does not yield -0. 

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

Applied in trunk at revision r13086.
(0008626)
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...).
(0008627)
chambart (developer)
2012-12-18 13:21

As far as I know the x87 backend is already doing that. See i386/selection.ml line 240.
(0009444)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker