Merge pull request #329 from MaddTheSane/patch-1

Update Half.cpp
pull/331/head
Ignacio 4 years ago committed by GitHub
commit 9870cfbf90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -294,7 +294,7 @@ uint32 _uint32_nlz( uint32 x ) {
// Count Leading Zeros
static inline uint32 _uint32_cntlz( uint32 x )
{
#if NV_CC_GCC
#if NV_CC_GNUC
/* On PowerPC, this will map to insn: cntlzw */
/* On Pentium, this will map to insn: clz */
uint32 is_x_nez_msb = _uint32_neg( x );
@ -692,7 +692,7 @@ __asm
/* This method is faster than the OpenEXR implementation (very often
* used, eg. in Ogre), with the additional benefit of rounding, inspired
* by James Tursas half-precision code. */
* by James Tursa’s half-precision code. */
static inline uint16_t float_to_half_branch(uint32_t x)
{
uint16_t bits = (x >> 16) & 0x8000; /* Get the sign */
@ -742,7 +742,7 @@ static inline uint16_t float_to_half_branch(uint32_t x)
#define S256(x) S64((x)), S64((x)+64), S64((x)+128), S64((x)+192)
#define S1024(x) S256((x)), S256((x)+256), S256((x)+512), S256((x)+768)
/* Lookup table-based algorithm from “Fast Half Float Conversions”
/* Lookup table-based algorithm from “Fast Half Float Conversions”
* by Jeroen van der Zijp, November 2008. No rounding is performed,
* and some NaN values may be incorrectly converted to Inf. */
static inline uint16_t float_to_half_nobranch(uint32_t x)

Loading…
Cancel
Save