<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)">
<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;}
/* 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;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle21
        {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 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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB">That makes sense to me! Thank you for the explanation. So using “alignas” is the only way to force an 8byte alignment for that array?
<o:p></o:p></span></p>
<div>
<div>
<blockquote style="border:none;border-left:solid #777777 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:0cm;margin-right:0cm;margin-bottom:3.75pt">
<p><span lang="EN-GB" style="font-family:"Arial",sans-serif;color:#777777">Hello Clang-Deves,<br>
<br>
I'm currently playing around with Clang-Cl and use it to generate LLVM assembly files.
</span><span style="font-family:"Arial",sans-serif;color:#777777">In one of my files I create a double array like this:<br>
double planschiArray[3] = {1.0, 1.1, 1.2};<br>
<br>
Clang will generate the following LLVM assembly for it:<br>
@"?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<br>
<br>
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:<br>
<br>
"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"<br>
<br>
Is there a way to force the 8byte alignment via the command line? Using<br>
alignas(sizeof(double)) double planschiArray[3] = {1.0, 1.1, 1.2};<br>
<br>
does work however, but I hoped "-Xclang -fmax-type-align=8" would take care of this automatically.<o:p></o:p></span></p>
</blockquote>
</div>
<div>
<p><span style="font-family:"Arial",sans-serif">Despite the name, </span><code><span style="font-size:10.0pt;color:black;background:#F7F7F7">-fmax-type-align</span></code><span style="font-family:"Arial",sans-serif"> is specifically just about controlling implicit
 alignment assumptions and doesn’t actually change the alignment of anything. If it capped alignments in general, it would be ABI-breaking.<o:p></o:p></span></p>
<p><span style="font-family:"Arial",sans-serif">John.<o:p></o:p></span></p>
</div>
<div>
<blockquote style="border:none;border-left:solid #777777 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:0cm;margin-right:0cm;margin-bottom:3.75pt">
<p><span style="font-family:"Arial",sans-serif;color:#777777">Does anyone know what I'm doing wrong?<br>
<br>
Kind greetings<br>
Björn<br>
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.<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<blockquote style="border:none;border-left:solid #777777 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:0cm;margin-right:0cm;margin-bottom:3.75pt">
<p><span style="font-family:"Arial",sans-serif;color:#777777">_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev"><span style="color:#777777">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</span></a><o:p></o:p></span></p>
</blockquote>
</div>
</div>
</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>