Changeset 378

Show
Ignore:
Timestamp:
07/05/08 16:55:02 (5 months ago)
Author:
FeepingCreature
Message:
  • Another attempt at fixing 64-bit
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/tools/stackthreads_impl.d

    r377 r378  
    44static if (size_t.sizeof==8) const string regsize="r", suffix="q"; 
    55else const string regsize="e", suffix="l"; 
     6 
     7const string pushall = Replace!( 
     8  "push! #ax\n push! #cx\n push! #dx\n push! #bx\n push! #bp\n push! #si\n push! #di\n ", 
     9  "#", "%%"~regsize, "!", suffix 
     10); 
     11const string popall = Replace!( 
     12  "pop! #di\n pop! #si\n pop! #bp\n pop! #bx\n pop! #dx\n pop! #cx\n pop! #ax\n ", 
     13  "#", "%%"~regsize, "!", suffix 
     14); 
    615 
    716import std.gc; 
     
    4857          jmp 1f 
    4958          0: 
    50           pusha! 
     59           
     60          "~pushall~" 
    5161           
    5262          mov #sp, (#cx) 
    5363          mov #dx, #sp 
    5464           
    55           popa! 
     65          "~popall~" 
    5666           
    5767          ret 
    5868          1:\" : : \"c\" ep, \"d\" to.esp : \"ax\", \"bx\"; 
    59         }", "#", "%%"~regsize, "!", suffix)); 
     69        }", "#", "%%"~regsize)); 
    6070      } else { 
    6171        asm { 
     
    90100            jmp 1f 
    91101             
    92             0: pusha! 
    93             mov %%sp, (%%bx) 
    94             mov %%cx, %%sp 
     102            0: "~pushall~" 
     103            mov #sp, (#bx) 
     104            mov #cx, #sp 
    95105             
    96106            push $1 
    97             1: pop %%cx\" : \"=c\" loaded, \"=d\" new_ptr : \"b\" ep, \"c\" esp, \"d\" dg_ptr; 
    98           }", "%%", "%%"~regsize, "!", suffix 
     107            1: pop #cx\" : \"=c\" loaded, \"=d\" new_ptr : \"b\" ep, \"c\" esp, \"d\" dg_ptr; 
     108          }", "#", "%%"~regsize 
    99109        )); 
    100110      } else asm {