www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10301] New: Loops for 64 bit code should be aligned on 8 byte boundaries

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10301

           Summary: Loops for 64 bit code should be aligned on 8 byte
                    boundaries
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bugzilla digitalmars.com


--- Comment #0 from Walter Bright <bugzilla digitalmars.com> 2013-06-08
10:36:27 PDT ---
Juan Manual Cabo reports a substantial speedup for such with this code:
------------
    import std.stdio;
    import std.datetime;

    int fibw(int n) { //Linear Fibonacci
        int a = 1;
        int b = 1;
        for (int i=2; i <= n; ++i) {
            int sum = a + b;
            a = b;
            b = sum;
        }
        return b;
    }

    void main() {
        auto start = Clock.currTime();
        int r = fibw(1000_000_000);
        auto elapsed = Clock.currTime() - start;
        writeln(r);
        writeln(elapsed);
    }
----------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 08 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10301


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc


--- Comment #1 from bearophile_hugs eml.cc 2013-06-08 11:15:23 PDT ---
Isn't loop alignment worth doing in 32 bit code too? GCC (and Clang) align
loops even in 32 bit code since many years.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 08 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10301


Juan Manuel Cabo <juanmanuel.cabo gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |juanmanuel.cabo gmail.com


--- Comment #2 from Juan Manuel Cabo <juanmanuel.cabo gmail.com> 2013-06-08
14:18:43 PDT ---
Link to the forum, with more info:

    http://forum.dlang.org/thread/upjcogokkekzefwqpfhb forum.dlang.org

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 08 2013