Lines Matching refs:arg

85  * result = arg
87 static inline struct fixed31_32 dc_fixpt_from_int(int arg)
91 res.value = (long long) arg << FIXED31_32_BITS_PER_FRACTIONAL_PART;
103 * result = -arg
105 static inline struct fixed31_32 dc_fixpt_neg(struct fixed31_32 arg)
109 res.value = -arg.value;
116 * result = abs(arg) := (arg >= 0) ? arg : -arg
118 static inline struct fixed31_32 dc_fixpt_abs(struct fixed31_32 arg)
120 if (arg.value < 0)
121 return dc_fixpt_neg(arg);
123 return arg;
184 * | min_value, when arg <= min_value
185 * result = | arg, when min_value < arg < max_value
186 * | max_value, when arg >= max_value
189 struct fixed31_32 arg,
193 if (dc_fixpt_le(arg, min_value))
195 else if (dc_fixpt_le(max_value, arg))
198 return arg;
208 * result = arg << shift
210 static inline struct fixed31_32 dc_fixpt_shl(struct fixed31_32 arg, unsigned char shift)
212 ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) ||
213 ((arg.value < 0) && (arg.value >= ~(LLONG_MAX >> shift))));
215 arg.value = arg.value << shift;
217 return arg;
222 * result = arg >> shift
224 static inline struct fixed31_32 dc_fixpt_shr(struct fixed31_32 arg, unsigned char shift)
226 bool negative = arg.value < 0;
229 arg.value = -arg.value;
230 arg.value = arg.value >> shift;
232 arg.value = -arg.value;
233 return arg;
315 * result = square(arg) := arg * arg
317 struct fixed31_32 dc_fixpt_sqr(struct fixed31_32 arg);
344 * result = reciprocal(arg) := 1 / arg
349 struct fixed31_32 dc_fixpt_recip(struct fixed31_32 arg);
358 * result = sinc(arg) := sin(arg) / arg
364 struct fixed31_32 dc_fixpt_sinc(struct fixed31_32 arg);
368 * result = sin(arg)
374 struct fixed31_32 dc_fixpt_sin(struct fixed31_32 arg);
378 * result = cos(arg)
386 struct fixed31_32 dc_fixpt_cos(struct fixed31_32 arg);
395 * result = exp(arg)
398 * Currently, function is verified for abs(arg) <= 1.
400 struct fixed31_32 dc_fixpt_exp(struct fixed31_32 arg);
404 * result = log(arg)
407 * Currently, abs(arg) should be less than 1.
412 struct fixed31_32 dc_fixpt_log(struct fixed31_32 arg);
444 * result = floor(arg) := greatest integer lower than or equal to arg
446 static inline int dc_fixpt_floor(struct fixed31_32 arg)
448 unsigned long long arg_value = arg.value > 0 ? arg.value : -arg.value;
450 if (arg.value >= 0)
458 * result = round(arg) := integer nearest to arg
460 static inline int dc_fixpt_round(struct fixed31_32 arg)
462 unsigned long long arg_value = arg.value > 0 ? arg.value : -arg.value;
470 if (arg.value >= 0)
478 * result = ceil(arg) := lowest integer greater than or equal to arg
480 static inline int dc_fixpt_ceil(struct fixed31_32 arg)
482 unsigned long long arg_value = arg.value > 0 ? arg.value : -arg.value;
491 if (arg.value >= 0)
503 unsigned int dc_fixpt_u4d19(struct fixed31_32 arg);
505 unsigned int dc_fixpt_u3d19(struct fixed31_32 arg);
507 unsigned int dc_fixpt_u2d19(struct fixed31_32 arg);
509 unsigned int dc_fixpt_u0d19(struct fixed31_32 arg);
511 unsigned int dc_fixpt_clamp_u0d14(struct fixed31_32 arg);
513 unsigned int dc_fixpt_clamp_u0d10(struct fixed31_32 arg);
515 int dc_fixpt_s4d19(struct fixed31_32 arg);
517 static inline struct fixed31_32 dc_fixpt_truncate(struct fixed31_32 arg, unsigned int frac_bits)
519 bool negative = arg.value < 0;
523 return arg;
527 arg.value = -arg.value;
528 arg.value &= (~0ULL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - frac_bits);
530 arg.value = -arg.value;
531 return arg;