<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 92.4pt 72.0pt 92.4pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoPlainText>The  comments from the switch_x64_masm.masm really only are
valid on windows.<o:p></o:p></p>

<p class=MsoPlainText>To know what to do on linux, we need to know the x64 ABI
that linux employs, which is bound to be different from what win64 uses.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>I found this document:<o:p></o:p></p>

<p class=MsoPlainText><a href="http://www.x86-64.org/documentation/abi.pdf">http://www.x86-64.org/documentation/abi.pdf</a><o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>And on page 14, it says this:<o:p></o:p></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i><o:p>&nbsp;</o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>3.2.1 Registers and the
Stack Frame<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>The AMD64 architecture
provides 16 general purpose 64-bit registers. In addition<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>the architecture provides
16 SSE registers, each 128 bits wide and 8 x87 floating<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>point registers, each 80
bits wide. Each of the x87 floating point registers may be<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>referred to in MMX/3DNow!
mode as a 64-bit register. All of these registers are<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>global to all procedures
active for a given thread.<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>This subsection discusses
usage of each register. Registers %rbp, %rbx and<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>%r12 through %r15
&#8220;belong&#8221; to the calling function and the called function is<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>required to preserve their
values. In other words, a called function must preserve<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>these registers&#8217;
values for its caller. Remaining registers &#8220;belong&#8221; to the called<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>function.5 If a calling
function wants to preserve such a register value across a<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>function call, it must save
the value in its local stack frame.<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>The CPU shall be in x87
mode upon entry to a function. Therefore, every<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>function that uses the MMX
registers is required to issue an emms or femms<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>instruction after using MMX
registers, before returning or calling another function.<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>6 The direction flag DF in
the %rFLAGS register must be clear (set to &#8220;forward&#8221;<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>direction) on function
entry and return. Other user flags have no specified role in<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>the standard calling
sequence and are not preserved across calls.<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>The control bits of the
MXCSR register are callee-saved (preserved across<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>calls), while the status
bits are caller-saved (not preserved). The x87 status word<o:p></o:p></i></p>

<p class=MsoPlainText style='margin-left:36.0pt'><i>register is caller-saved,
whereas the x87 control word is callee-saved.<o:p></o:p></i></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>From this it seems that we must save rbp, rbx and r12-r15,
plus the mxcsr register.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>K<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; -----Original Message-----<o:p></o:p></p>

<p class=MsoPlainText>&gt; From: stackless-bounces@stackless.com
[mailto:stackless-<o:p></o:p></p>

<p class=MsoPlainText>&gt; bounces@stackless.com] On Behalf Of Richard Tew<o:p></o:p></p>

<p class=MsoPlainText>&gt; Sent: Wednesday, May 09, 2007 07:04<o:p></o:p></p>

<p class=MsoPlainText>&gt; To: Alec Flett<o:p></o:p></p>

<p class=MsoPlainText>&gt; Cc: Stackless mailing list<o:p></o:p></p>

<p class=MsoPlainText>&gt; Subject: Re: [Stackless] Stackless Python for Python
2.5.1<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; On 5/8/07, Alec Flett &lt;alecf@flett.org&gt; wrote:<o:p></o:p></p>

<p class=MsoPlainText>&gt; &gt; So what is the state of the amd64 support? I
saw a lot of stuff<o:p></o:p></p>

<p class=MsoPlainText>&gt; exchanged a<o:p></o:p></p>

<p class=MsoPlainText>&gt; &gt; few weeks back with Hieu but I wasn't really
sure of the conclusion.<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; Exactly what I said in the email you quoted:<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; &quot;The only remaining known issue is that the
amd64 linux platform is not<o:p></o:p></p>

<p class=MsoPlainText>&gt; supported at this time.  This involves a large
amount of effort which<o:p></o:p></p>

<p class=MsoPlainText>&gt; I have not as yet had time for.&quot;<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; Shouldn't people on AMD64 platforms be able to
compile for x86 still<o:p></o:p></p>

<p class=MsoPlainText>&gt; and use Stackless that way in the meantime?<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; Richard.<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; _______________________________________________<o:p></o:p></p>

<p class=MsoPlainText>&gt; Stackless mailing list<o:p></o:p></p>

<p class=MsoPlainText>&gt; Stackless@stackless.com<o:p></o:p></p>

<p class=MsoPlainText>&gt; http://www.stackless.com/mailman/listinfo/stackless<o:p></o:p></p>

</div>

</body>

</html>