<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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (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;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 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="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hello Clang-Deves,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I'm currently playing around with Clang-Cl and use it to generate LLVM assembly files. In one of my files I create a double array like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas">double planschiArray[3] = {1.0, 1.1, 1.2};<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Clang will generate the following LLVM assembly for it:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas">@"?planschiArray@@3PANA" = dso_local local_unnamed_addr global [3 x double] [double 1.000000e+00, double 1.100000e+00, double 1.200000e+00], align 16<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">As far as I understand, the array was aligned to 16 byte - however for an generic address calculation done by us I need an 8byte aligment even though this might effect the SIMD instructions. So I added "-Xclang -fmax-type-align=8"
to the compile command but it didn't effected the array. The full command is:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas">"D:\Program Files\LLVM10\bin\clang-cl" /c -Xclang -emit-llvm -Xclang -fmax-type-align=8 -m64 -ferror-limit=3000 /FAcs /GS- /MT /EHsc /W4 /O2 /Ob2 /Oi /Ot -Wno-unused-command-line-argument
-Wno-microsoft-cast -Wno-writable-strings -Wno-microsoft-enum-forward-reference -Wno-invalid-token-paste -Wno-microsoft-include "%(FullPath)" /Fo"x64\Release\ObjectFile.obj"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Is there a way to force the 8byte alignment via the command line? Using
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:Consolas">alignas(sizeof(double)) double planschiArray[3] = {1.0, 1.1, 1.2};<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">does work however, but I hoped </span><span lang="EN-GB" style="font-family:Consolas">"-Xclang -fmax-type-align=8</span><span lang="EN-GB">" would take care of this automatically.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Does anyone know what I'm doing wrong?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kind greetings<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Björn<o:p></o:p></span></p>
</div>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Junichi Tajika, Ergin Cansiz.
</body>
</html>