2888 – [PATCH] speedup for float * 2.0

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2888 - [PATCH] speedup for float * 2.0
Summary: [PATCH] speedup for float * 2.0
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 enhancement
Assignee: Walter Bright
URL:
Keywords: patch, performance
Depends on:
Blocks:
Reported: 2009年04月24日 15:11 UTC by Don
Modified: 2015年06月09日 01:26 UTC (History)
0 users

See Also:


Attachments
Patch against DMD2.029 (1.19 KB, patch)
2009年04月24日 15:13 UTC, Don
Details | Diff
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2009年04月24日 15:11:47 UTC
DMD generates slow code in simple situations such as:
double foo(double x) { return x*2; }
It creates a floating-point constant 2.0, and then generates an FMUL to multiply by it. It's particularly slow in the 80-bit real case, where two instructions (FLD and FMULP) are required.
The attached patch generates the fast and simple FADD ST(0), ST; instead. It only applies to float,double, real, not to complex numbers.
Comment 1 Don 2009年04月24日 15:13:08 UTC
Created attachment 338 [details] 
Patch against DMD2.029
This will be a useful step towards further optimisation of pure functions with real return values.
Comment 2 Don 2009年04月27日 04:36:33 UTC
Renaming this issue to be less negative
Comment 3 Walter Bright 2009年07月09日 02:48:31 UTC
Fixed dmd 1.046 and 2.031


AltStyle によって変換されたページ (->オリジナル) /