<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 26 May 2020, at 9:32, Gaier, Bjoern via cfe-dev wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">Hello Clang-Deves,<br>
<br>
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:<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.</p>
</blockquote></div>
<div style="white-space:normal">

<p dir="auto">Despite the name, <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">-fmax-type-align</code> 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.</p>

<p dir="auto">John.</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">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.</p>
</blockquote><br><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">_______________________________________________<br>
cfe-dev mailing list<br>
cfe-dev@lists.llvm.org<br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" style="color:#777">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a></p>
</blockquote></div>
<div style="white-space:normal">
</div>
</div>
</body>
</html>