<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 - Missing float truncation rounding patterns"
href="https://bugs.llvm.org/show_bug.cgi?id=36617">36617</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Missing float truncation rounding patterns
</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>Windows NT
</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>Common Code Generator Code
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>llvm-dev@redking.me.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>efriedma@codeaurora.org, hfinkel@anl.gov, llvm-bugs@lists.llvm.org, scanon@apple.com, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>Rounding floats/doubles patterns could be converted to truncation rounding
instructions (roundss on x86/sse etc.). AFAICT these don't need to be
-ffast-math only.
float rnd(float x) {
return (float)((int)x);
}
__v4sf rnd(__v4sf x) {
return __builtin_convertvector(__builtin_convertvector(x, __v4si), __v4sf);
}
define dso_local float @_Z3rndf {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
ret float %3
}
define dso_local <4 x float> @_Z3rndDv4_f {
%2 = fptosi <4 x float> %0 to <4 x i32>
%3 = sitofp <4 x i32> %2 to <4 x float>
ret <4 x float> %3
}
_Z3rndf:
cvttss2si %xmm0, %eax
xorps %xmm0, %xmm0
cvtsi2ssl %eax, %xmm0
retq
_Z3rndDv4_f:
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
retq</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>