<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 --- - x86-64 assembler: using traditional 8-bit regs DH,CH,AH,BH with REX instructions should error"
href="https://llvm.org/bugs/show_bug.cgi?id=25003">25003</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>x86-64 assembler: using traditional 8-bit regs DH,CH,AH,BH with REX instructions should error
</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>normal
</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>reuben.scratton@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>This might not be considered a bug per se, but it's something I feel the LLVM
assembler could and should treat as an error.
I am an x86-64 n00b and was today been porting some i386 assembly code to it.
While it was mostly straightforward I was caught out by trying to do this:
movzxb rsi, dh
The original 32-bit instruction was 'movzxb esi, dh', and I'd naively just
changed 'esi' to 'rsi'. What I didn't realise is that the x86-64 assembler
would compile 'dh' (byte 1 of rdx) as 'sil' (byte 0 of rsi), i.e. the emitted
instruction was 'movzxb rsi, sil'.
Since my desired instruction cannot be assembled, I feel the assembler would be
better to report an error rather than quietly switch to using a totally
different 8-bit register. It would have saved some hours of debug time. :)</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>