<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 - fptoui double to i16 produces fcvtzs (signed) instead of fcvtzu (unsigned)"
href="https://bugs.llvm.org/show_bug.cgi?id=49762">49762</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>fptoui double to i16 produces fcvtzs (signed) instead of fcvtzu (unsigned)
</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: AArch64
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>martin@martin.st
</td>
</tr>
<tr>
<th>CC</th>
<td>arnaud.degrandmaison@arm.com, llvm-bugs@lists.llvm.org, smithp352@googlemail.com, Ties.Stuij@arm.com
</td>
</tr></table>
<p>
<div>
<pre>$ cat test.c
unsigned short func1(double d) {
return d;
};
unsigned int func2(double d) {
return d;
};
$ clang -target aarch64-linux-gnu test.c -S -o - -O2
func1: // @func1
.cfi_startproc
fcvtzs w0, d0
ret
func2: // @func2
.cfi_startproc
fcvtzu w0, d0
ret
When doing fptoui to i32, this selects a fcvtzu instruction, while it selects
fcvtzs when converting to i16. (I'm not sure if this is a bug per se, or if the
C/IR specs allows this, but if nothing else, it feels rather inconsistent.)</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>