<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - __attribute__((target("foo"))) doesn't work for functions with inline assembly"
href="https://bugs.llvm.org/show_bug.cgi?id=41482">41482</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>__attribute__((target("foo"))) doesn't work for functions with inline assembly
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>8.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nheart@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=21769" name="attach_21769" title="Inline assembly fails to compile without -mavx2">attachment 21769</a> <a href="attachment.cgi?id=21769&action=edit" title="Inline assembly fails to compile without -mavx2">[details]</a></span>
Inline assembly fails to compile without -mavx2
Hey,
clang++ fails to compile inline assembly that requires AVX2 unless -mavx2 flag
is set. One is normally able to avoid that by annotating the function with
__attribute__((target("AVX2"))), but in clang this seems to only work if you
are just using intrinsics (the function on line 6 of the example), but not
inline assembly.
I have attached a snipped of code with some of our inline assembly.
The example cpp file attached compiles file with g++, but will only compile on
clang++ if -mavx2 is provided. g++ doesn't need that.
Cheers,
Nick</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>