<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 backend legalises `xor i1` incorrectly"
href="https://llvm.org/bugs/show_bug.cgi?id=30579">30579</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>x86 backend legalises `xor i1` incorrectly
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>3.9
</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>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>simonas+llvm.org@kazlauskas.me
</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>Created <span class=""><a href="attachment.cgi?id=17389" name="attach_17389" title="The LLVM IR reproducing the issue">attachment 17389</a> <a href="attachment.cgi?id=17389&action=edit" title="The LLVM IR reproducing the issue">[details]</a></span>
The LLVM IR reproducing the issue
The attached LLVM-IR sample, when compiled with `llc -filetype=asm -o -
test.ll -O0` (the -O0 is important here) produces the following assembly (with
unnecessary details removed):
banana:
pushq %rbp
movq %rsp, %rbp
.Ltmp2:
movb $1, -1(%rbp)
movb -1(%rbp), %al # %al = 1
movb F, %cl # %cl = 0
xorb $-1, %cl # %cl = 255 ^ 0 = 255
# missing andb $1, %cl
cmpb %cl, %al
je .LBB0_2
ud2
.LBB0_2:
popq %rbp
retq
.Lfunc_end0:
F:
.byte 0
.size F, 1
The `%2 = xor i1 %f, true` from original LLVM-IR seems to be legalised
incorrectly, as it is missing a `andb $1, %cl` after the `xorb` instruction.</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>