This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Faster PPC rounding checks in libm?
- From: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- To: Joseph Myers <joseph at codesourcery dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: "munroesj at linux dot vnet dot ibm dot com" <munroesj at linux dot vnet dot ibm dot com>, Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Date: Mon, 21 Mar 2016 09:31:24 -0500
- Subject: Faster PPC rounding checks in libm?
- Authentication-results: sourceware.org; auth=none
I'm looking at trying to recover a bit of performance from the transcendental
functions within libm. The mffs/mtfs instructions used to check the rounding
mode create a substantial bottleneck (see PowerISA 2.07B 4.6.10). From what
I can tell, most of these functions just need to ensure they are computed in
round to nearest.
One thought is to compute known values to infer whether the core is already
in round to even. Though, it has the drawback of always raising the inexact
exception. So, such a check is not an acceptable replacement for all uses.
How objectionable is it to add a rounding check which is allowed to raise
inexact for math functions which the inexact behavior is unspecified?