This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add a new macro to mask a float

On Tue, 28 Jun 2016, Tulio Magno Quites Machado Filho wrote:

> +/* Faster to do an in-place masking of the float number in the VSR
> +   than move to GPR for the masking and back.  maskl, maskr, and maski
> +   are used to convert the 32-bit "mask" parameter to a 64-bit mask
> +   suitable for the internal representation of a scalar
> +   single-precision floating point number in the Power8 processor.
> +   Note: before applying the mask, xvmovdp is used to ensure f is
> +   normalized.  */

Actually, could you clarify what that internal representation is, and what 
"to ensure f is normalized" is about?  Is this macro definition exactly 
equivalent to the integer masking, including for subnormal arguments and 

If it's exactly equivalent in all cases, including subnormals and NaNs, 
then my previous comment applies - it would be better as a compiler 
optimization.  If it's only equivalent for normal values but the code in 
question can't get subnormal arguments / NaNs / whatever values it's not 
equivalent for, then doing this in glibc is more plausible, though there 
are coding style issues, the macro comments would need to explain the 
limitation, and it would be necessary to be sure in each case that problem 
arguments can't get there.

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]