<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 - [arm64] Missed optimizations in __int128_t comparisons"
href="https://bugs.llvm.org/show_bug.cgi?id=45284">45284</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[arm64] Missed optimizations in __int128_t comparisons
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rth@twiddle.net
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>void doit(void);
void test(unsigned long addr, unsigned long size, unsigned long limit)
{
if ((__uint128_t)addr + size <= (__uint128_t)limit + 1) doit();
}
with HEAD (85c30f3374d9), compiles to
adds x8, x1, x0
adcs x9, xzr, xzr
adds x10, x2, #1
adcs x11, xzr, xzr
cmp x8, x10 // comparison start
cset w8, hi
cmp x9, x11
cset w9, hi
csel w8, w8, w9, eq // comparison end
tbz w8, #0, .LBB1_2
The comparison can be done with
cmp x8, x10
sbcs xzr, x9, x11
b.cs .LBB1_2
a reduction of 3 insns.</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>