<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 - Poor x86-64 64-bit divide code generation (regression)"
href="https://bugs.llvm.org/show_bug.cgi?id=45961">45961</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Poor x86-64 64-bit divide code generation (regression)
</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>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>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>raul@tambre.ee
</td>
</tr>
<tr>
<th>CC</th>
<td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>define i32 @div64(i32 %0, i32 %1) #0 {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = sdiv i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
attributes #0 = { "target-cpu"="x86-64"}
LLVM 11 (trunk):
f(int, int): # @f(int, int)
movsxd rax, edi
movsxd rcx, esi
mov rdx, rax
or rdx, rcx
shr rdx, 32
je .LBB0_1
cqo
idiv rcx
ret
.LBB0_1:
mov eax, edi
xor edx, edx
div esi
ret
LLVM 10:
f(int, int): # @f(int, int)
movsxd rax, edi
movsxd rcx, esi
cqo
idiv rcx
ret
from
<a href="https://stackoverflow.com/questions/61856447/difference-of-long-long-vs-int-int">https://stackoverflow.com/questions/61856447/difference-of-long-long-vs-int-int</a></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>