<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - Suboptimal encoding of 64 bit and with small immediate"
href="https://llvm.org/bugs/show_bug.cgi?id=23100">23100</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Suboptimal encoding of 64 bit and with small immediate
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>benny.kra@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ cat t.c
long long foo(long long x) { return x & 42; }
$ clang -S -o - t.c -O3|grep and|llvm-mc -show-encoding
andq $42, %rdi # encoding: [0x48,0x83,0xe7,0x2a]
$ gcc -S -o - t.c -O3|grep and|llvm-mc -show-encoding
andl $42, %eax # encoding: [0x83,0xe0,0x2a]
We have a pattern for this in X86InstrCompiler.td but it's not getting selected
for some reason.</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>