<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:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 5 4 2 2 2 2 2 4;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Arial\,";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",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.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></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="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Thank you both for helpful replies
</span><span lang="EN-GB" style="font-size:11.0pt;font-family:Wingdings;mso-fareast-language:EN-US">J</span><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="margin-top:12.0pt;page-break-after:avoid;border:none;padding:0cm">
<a name="_Toc454264584"><span style="font-size:16.0pt;color:#A5A5A5;mso-fareast-language:EN-US">Regards,<br>
Patrik Eklöf</span></a><span style="mso-bookmark:_Toc454264584"></span><span style="font-size:16.0pt;font-family:"Calibri Light",sans-serif;color:#A5A5A5;mso-fareast-language:EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="604" style="width:453.25pt">
<tbody>
<tr style="height:86.6pt">
<td width="190" valign="top" style="width:142.25pt;padding:6.0pt 6.0pt 0cm 0cm;height:86.6pt">
<p class="MsoNormal" style="margin-bottom:10.0pt;line-height:120%"><b><span lang="EN-GB" style="font-size:8.5pt;line-height:120%;font-family:"Arial",sans-serif;color:#2A2A2A">Patrik Eklöf</span></b><span lang="EN-GB" style="font-size:11.0pt;line-height:120%;font-family:"Calibri",sans-serif"><br>
</span><span lang="EN-GB" style="font-size:8.5pt;line-height:120%;font-family:"Arial",sans-serif;color:#2A2A2A">Programmer</span><span lang="EN-GB" style="font-size:11.0pt;line-height:120%;font-family:"Calibri",sans-serif"><br>
</span><b><span lang="EN-GB" style="font-size:8.5pt;line-height:120%;font-family:"Arial",sans-serif;color:#2A2A2A">Phone</span></b><span lang="EN-GB" style="font-size:8.5pt;line-height:120%;font-family:"Arial",sans-serif;color:#2A2A2A"> +46 720 514440</span><span lang="EN-GB" style="font-size:11.0pt;line-height:120%;font-family:"Calibri",sans-serif"><br>
<br>
</span><span style="font-size:11.0pt;line-height:120%;font-family:"Calibri",sans-serif"><a href="https://www.linkedin.com/company/energy-machines"><span lang="EN-GB" style="font-size:8.5pt;line-height:120%;font-family:"Arial",sans-serif;color:#00B050">My LinkedIn</span></a></span><u><span lang="EN-GB" style="font-size:11.0pt;line-height:120%;font-family:"Arial",sans-serif;color:#00B050"><o:p></o:p></span></u></p>
<p class="MsoNormal" style="margin-bottom:10.0pt;line-height:115%"><span style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif"><a href="mailto:patrik.eklof@energymachines.com"><span style="font-size:8.5pt;line-height:115%;font-family:"Arial",sans-serif;color:#00B050">patrik.eklof@energymachines.com</span></a><span style="color:#2A2A2A"><o:p></o:p></span></span></p>
</td>
<td width="415" valign="top" style="width:311.0pt;border:none;border-left:solid #E2EFD9 1.0pt;padding:0cm 15.0pt 3.0pt 15.0pt;height:86.6pt">
<p class="MsoNormal" style="margin-bottom:10.0pt;line-height:115%"><span style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif"><img border="0" width="358" height="74" style="width:3.7291in;height:.7708in" id="picture" src="cid:image001.png@01D26D8E.A13CB6A0"></span><span lang="EN-GB" style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif"><br>
</span><span lang="EN-GB" style="font-size:8.5pt;line-height:115%;font-family:"Arial,",serif;color:#2A2A2A">Skeppsgatan 19, SE-211 11 Malmö, Sweden</span><span lang="EN-GB" style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif"><br>
</span><span style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif"><a href="http://energymachines.com/"><span lang="EN-GB" style="font-size:8.5pt;line-height:115%;font-family:"Arial",sans-serif;color:#00B050">www.energymachines.com</span></a></span><span lang="EN-GB" style="font-size:8.5pt;line-height:115%;font-family:"Arial",sans-serif;color:#00B050"> | </span><span style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif"><a href="https://www.linkedin.com/company/energy-machines"><span lang="EN-GB" style="font-size:8.5pt;line-height:115%;font-family:"Arial",sans-serif;color:#00B050">LinkedIn</span></a></span><span lang="EN-GB" style="font-size:8.5pt;line-height:115%;font-family:"Arial",sans-serif;color:#2A2A2A"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:1.0pt">
<td colspan="2" style="padding:18.75pt 0cm 0cm 0cm;height:1.0pt">
<p class="MsoNormal" style="margin-bottom:10.0pt;line-height:115%"><span lang="EN-GB" style="font-size:7.5pt;line-height:115%;font-family:"Arial",sans-serif;color:#2A2A2A">The information in this e-mail and any of its attachments is strictly confidential and
intended solely for the person or organisation to whom it is addressed. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you must not copy or distribute it or take action in reliance on it. If you have received this
e-mail in error, please notify the sender as soon as possible. Communication via e-mail over the internet is not secure and messages may be read, manipulated or otherwise compromised by third parties. Energy Machines Sweden AB does not accept any responsibility
in this eventuality.</span><span lang="EN-GB" style="font-size:7.5pt;line-height:115%;font-family:"Arial",sans-serif;color:#2A2A2A"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> mbraun@apple.com [mailto:mbraun@apple.com]
<br>
<b>Sent:</b> 10 January 2017 19:10<br>
<b>To:</b> Patrik Eklöf <patrik.eklof@energymachines.com><br>
<b>Cc:</b> llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] Porting LLVM to OpenVMS<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jan 10, 2017, at 12:41 AM, Patrik Eklöf via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Dear community,</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">My company is interested in porting LLVM to OpenVMS. To do so, we need to look at extending the AMD64 calling convention to suit the existing calling conventions
available on OpenVMS.</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">We realize LLVM is a big and complex project and for some people who has not worked on it before, it’s going to be a big and tough job that is going to take a
lot of time. Still, the job has to be done and we have to start somewhere, so any help or direction would be great.</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Now, as to what we need:</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div style="margin-left:36.0pt">
<p class="MsoNormal" style="text-indent:-18.0pt"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">-</span><span lang="EN-GB" style="font-size:7.0pt"> <span class="apple-converted-space"> </span></span><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">To
pass the argument count to the callee</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div style="margin-left:36.0pt">
<p class="MsoNormal" style="text-indent:-18.0pt"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">-</span><span lang="EN-GB" style="font-size:7.0pt"> <span class="apple-converted-space"> </span></span><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Reserving
registers for mapping variables directly to them</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">We need to look at passing the argument count (i.e. number of arguments passed) to functions in some register. One way that we have considered is to use the second
byte of AL to hold the argument count. Do you think that would work well with how LLVM works today? Or is there an alternative way that you would suggest?</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">We also need to look at reserving registers because existing OpenVMS code relies on being able to map variables directly to registers so that multiple functions
can share variables directly inside registers. We may need to reserve up to as many as 6 registers. Do you think this might work? Or will this make codegen bad? We have also considered trying to put these variables into an array and reserving a global variable
to index into this array, thereby emulating this feature. Do you think this will work better?</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif">It would be great to get some information to cut down on the area we need to concentrate on to get started. Any help or direction would be great.</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I don't see a problem doing any of these (of course it will take some getting used to how all those things work in llvm). You can express storing a number in a fixed register with selection DAG CopyToReg and you can reserve registers.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Look around X86ISelLowering.cpp esp. LowerCall() and X86RegisterInfo::getReservedRegs().<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">- Matthias<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>