Lines Matching +full:low +full:- +full:precision
1 /* SPDX-License-Identifier: GPL-2.0-only */
13 val = val >> shift | ((val << (32 - shift)) != 0); in vfp_shiftright32jamming()
24 val = val >> shift | ((val << (64 - shift)) != 0); in vfp_shiftright64jamming()
128 z -= 0x100000000ULL; in vfp_estimate_div128to64()
147 * Single-precision
159 * VFP_SINGLE_MANTISSA_BITS - number of bits in the mantissa
160 * VFP_SINGLE_EXPONENT_BITS - number of bits in the exponent
161 * VFP_SINGLE_LOW_BITS - number of low bits in the unpacked significand
166 #define VFP_SINGLE_LOW_BITS (32 - VFP_SINGLE_MANTISSA_BITS - 2)
167 #define VFP_SINGLE_LOW_BITS_MASK ((1 << VFP_SINGLE_LOW_BITS) - 1)
172 #define VFP_SINGLE_SIGNIFICAND_QNAN (1 << (VFP_SINGLE_MANTISSA_BITS - 1 + VFP_SINGLE_LOW_BITS))
175 * Operations on packed single-precision numbers
180 …ngle_packed_exponent(v) (((v) >> VFP_SINGLE_MANTISSA_BITS) & ((1 << VFP_SINGLE_EXPONENT_BITS) - 1))
181 #define vfp_single_packed_mantissa(v) ((v) & ((1 << VFP_SINGLE_MANTISSA_BITS) - 1))
184 * Unpack a single-precision float. Note that this returns the magnitude
185 * of the single-precision float mantissa with the 1. if necessary,
192 s->sign = vfp_single_packed_sign(val) >> 16, in vfp_single_unpack()
193 s->exponent = vfp_single_packed_exponent(val); in vfp_single_unpack()
196 significand = (significand << (32 - VFP_SINGLE_MANTISSA_BITS)) >> 2; in vfp_single_unpack()
197 if (s->exponent && s->exponent != 255) in vfp_single_unpack()
199 s->significand = significand; in vfp_single_unpack()
203 * Re-pack a single-precision float. This assumes that the float is
209 val = (s->sign << 16) + in vfp_single_pack()
210 (s->exponent << VFP_SINGLE_MANTISSA_BITS) + in vfp_single_pack()
211 (s->significand >> VFP_SINGLE_LOW_BITS); in vfp_single_pack()
228 if (s->exponent == 255) { in vfp_single_type()
229 if (s->significand == 0) in vfp_single_type()
231 else if (s->significand & VFP_SINGLE_SIGNIFICAND_QNAN) in vfp_single_type()
235 } else if (s->exponent == 0) { in vfp_single_type()
236 if (s->significand == 0) in vfp_single_type()
252 * Double-precision
275 #define VFP_DOUBLE_LOW_BITS (64 - VFP_DOUBLE_MANTISSA_BITS - 2)
276 #define VFP_DOUBLE_LOW_BITS_MASK ((1 << VFP_DOUBLE_LOW_BITS) - 1)
281 #define VFP_DOUBLE_SIGNIFICAND_QNAN (1ULL << (VFP_DOUBLE_MANTISSA_BITS - 1 + VFP_DOUBLE_LOW_BITS))
284 * Operations on packed single-precision numbers
289 …uble_packed_exponent(v) (((v) >> VFP_DOUBLE_MANTISSA_BITS) & ((1 << VFP_DOUBLE_EXPONENT_BITS) - 1))
290 #define vfp_double_packed_mantissa(v) ((v) & ((1ULL << VFP_DOUBLE_MANTISSA_BITS) - 1))
293 * Unpack a double-precision float. Note that this returns the magnitude
294 * of the double-precision float mantissa with the 1. if necessary,
301 s->sign = vfp_double_packed_sign(val) >> 48; in vfp_double_unpack()
302 s->exponent = vfp_double_packed_exponent(val); in vfp_double_unpack()
305 significand = (significand << (64 - VFP_DOUBLE_MANTISSA_BITS)) >> 2; in vfp_double_unpack()
306 if (s->exponent && s->exponent != 2047) in vfp_double_unpack()
308 s->significand = significand; in vfp_double_unpack()
312 * Re-pack a double-precision float. This assumes that the float is
318 val = ((u64)s->sign << 48) + in vfp_double_pack()
319 ((u64)s->exponent << VFP_DOUBLE_MANTISSA_BITS) + in vfp_double_pack()
320 (s->significand >> VFP_DOUBLE_LOW_BITS); in vfp_double_pack()
327 if (s->exponent == 2047) { in vfp_double_type()
328 if (s->significand == 0) in vfp_double_type()
330 else if (s->significand & VFP_DOUBLE_SIGNIFICAND_QNAN) in vfp_double_type()
334 } else if (s->exponent == 0) { in vfp_double_type()
335 if (s->significand == 0) in vfp_double_type()
358 #define VFP_EXCEPTION_ERROR ((u32)-1 & ~VFP_NAN_FLAG)
362 * OP_SCALAR - this operation always operates in scalar mode
363 * OP_SD - the instruction exceptionally writes to a single precision result.
364 * OP_DD - the instruction exceptionally writes to a double precision result.
365 * OP_SM - the instruction exceptionally reads from a single precision operand.