Lines Matching refs:f

40 fixed_hash (const FIXED_VALUE_TYPE *f)  in fixed_hash()  argument
42 return (unsigned int) (f->data.low ^ f->data.high); in fixed_hash()
87 fixed_from_string (FIXED_VALUE_TYPE *f, const char *str, enum machine_mode mode) in fixed_from_string() argument
93 f->mode = mode; in fixed_from_string()
97 temp = check_real_for_fixed_mode (&real_value, f->mode); in fixed_from_string()
101 || (temp == FIXED_MAX_EPS && ALL_ACCUM_MODE_P (f->mode))) in fixed_from_string()
106 real_to_integer2 ((HOST_WIDE_INT *)&f->data.low, &f->data.high, in fixed_from_string()
109 if (temp == FIXED_MAX_EPS && ALL_FRACT_MODE_P (f->mode)) in fixed_from_string()
112 f->data.low = -1; in fixed_from_string()
113 f->data.high = -1; in fixed_from_string()
114 f->data = double_int_ext (f->data, in fixed_from_string()
115 GET_MODE_FBIT (f->mode) in fixed_from_string()
116 + GET_MODE_IBIT (f->mode), 1); in fixed_from_string()
119 f->data = double_int_ext (f->data, in fixed_from_string()
120 SIGNED_FIXED_POINT_MODE_P (f->mode) in fixed_from_string()
121 + GET_MODE_FBIT (f->mode) in fixed_from_string()
122 + GET_MODE_IBIT (f->mode), in fixed_from_string()
123 UNSIGNED_FIXED_POINT_MODE_P (f->mode)); in fixed_from_string()
150 fixed_saturate1 (enum machine_mode mode, double_int a, double_int *f, in fixed_saturate1() argument
166 *f = max; in fixed_saturate1()
186 *f = max; in fixed_saturate1()
193 *f = min; in fixed_saturate1()
211 double_int *f, bool sat_p) in fixed_saturate2() argument
230 *f = max_s; in fixed_saturate2()
256 *f = max_s; in fixed_saturate2()
265 *f = min_s; in fixed_saturate2()
289 do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, in do_fixed_add() argument
306 f->mode = a->mode; in do_fixed_add()
307 f->data = double_int_add (a->data, temp); in do_fixed_add()
316 f->data.high = 0; in do_fixed_add()
317 f->data.low = 0; in do_fixed_add()
325 f->data = double_int_ext (f->data, i_f_bits, 1); in do_fixed_add()
326 if (double_int_cmp (f->data, a->data, 1) == -1 in do_fixed_add()
327 || double_int_cmp (f->data, b->data, 1) == -1) in do_fixed_add()
331 f->data.high = -1; in do_fixed_add()
332 f->data.low = -1; in do_fixed_add()
345 != get_fixed_sign_bit (f->data, i_f_bits))) in do_fixed_add()
350 != get_fixed_sign_bit (f->data, i_f_bits)))) in do_fixed_add()
354 f->data.low = 1; in do_fixed_add()
355 f->data.high = 0; in do_fixed_add()
356 lshift_double (f->data.low, f->data.high, i_f_bits, in do_fixed_add()
358 &f->data.low, &f->data.high, 1); in do_fixed_add()
364 f->data = double_int_sub (f->data, one); in do_fixed_add()
371 f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p); in do_fixed_add()
380 do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, in do_fixed_multiply() argument
386 f->mode = a->mode; in do_fixed_multiply()
387 if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT) in do_fixed_multiply()
389 f->data = double_int_mul (a->data, b->data); in do_fixed_multiply()
390 lshift_double (f->data.low, f->data.high, in do_fixed_multiply()
391 (-GET_MODE_FBIT (f->mode)), in do_fixed_multiply()
393 &f->data.low, &f->data.high, !unsigned_p); in do_fixed_multiply()
394 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p); in do_fixed_multiply()
454 if (GET_MODE_FBIT (f->mode) == 2 * HOST_BITS_PER_WIDE_INT) in do_fixed_multiply()
468 f->data.low = s.low; in do_fixed_multiply()
469 f->data.high = s.high; in do_fixed_multiply()
474 (-GET_MODE_FBIT (f->mode)), in do_fixed_multiply()
479 - GET_MODE_FBIT (f->mode)), in do_fixed_multiply()
481 &f->data.low, &f->data.high, 0); in do_fixed_multiply()
482 f->data.low = f->data.low | s.low; in do_fixed_multiply()
483 f->data.high = f->data.high | s.high; in do_fixed_multiply()
484 s.low = f->data.low; in do_fixed_multiply()
485 s.high = f->data.high; in do_fixed_multiply()
487 (-GET_MODE_FBIT (f->mode)), in do_fixed_multiply()
492 overflow_p = fixed_saturate2 (f->mode, r, s, &f->data, sat_p); in do_fixed_multiply()
495 f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p); in do_fixed_multiply()
504 do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, in do_fixed_divide() argument
510 f->mode = a->mode; in do_fixed_divide()
511 if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT) in do_fixed_divide()
514 GET_MODE_FBIT (f->mode), in do_fixed_divide()
516 &f->data.low, &f->data.high, !unsigned_p); in do_fixed_divide()
517 f->data = double_int_div (f->data, b->data, unsigned_p, TRUNC_DIV_EXPR); in do_fixed_divide()
518 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p); in do_fixed_divide()
546 if (GET_MODE_FBIT (f->mode) == 2 * HOST_BITS_PER_WIDE_INT) in do_fixed_divide()
555 GET_MODE_FBIT (f->mode), in do_fixed_divide()
560 - GET_MODE_FBIT (f->mode)), in do_fixed_divide()
617 f->data = quo_s; in do_fixed_divide()
618 overflow_p = fixed_saturate2 (f->mode, quo_r, quo_s, &f->data, sat_p); in do_fixed_divide()
621 f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p); in do_fixed_divide()
630 do_fixed_shift (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, in do_fixed_shift() argument
636 f->mode = a->mode; in do_fixed_shift()
640 f->data = a->data; in do_fixed_shift()
644 if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT || (!left_p)) in do_fixed_shift()
649 &f->data.low, &f->data.high, !unsigned_p); in do_fixed_shift()
651 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p); in do_fixed_shift()
676 f->data = temp_low; in do_fixed_shift()
677 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, &f->data, in do_fixed_shift()
680 f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p); in do_fixed_shift()
689 do_fixed_neg (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, bool sat_p) in do_fixed_neg() argument
694 f->mode = a->mode; in do_fixed_neg()
695 f->data = double_int_neg (a->data); in do_fixed_neg()
696 f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p); in do_fixed_neg()
700 if (f->data.low != 0 || f->data.high != 0) in do_fixed_neg()
704 f->data.low = 0; in do_fixed_neg()
705 f->data.high = 0; in do_fixed_neg()
713 if (!(f->data.high == 0 && f->data.low == 0) in do_fixed_neg()
714 && f->data.high == a->data.high && f->data.low == a->data.low ) in do_fixed_neg()
719 f->data.low = -1; in do_fixed_neg()
720 f->data.high = -1; in do_fixed_neg()
721 f->data = double_int_ext (f->data, i_f_bits, 1); in do_fixed_neg()
736 fixed_arithmetic (FIXED_VALUE_TYPE *f, int icode, const FIXED_VALUE_TYPE *op0, in fixed_arithmetic() argument
742 return do_fixed_neg (f, op0, sat_p); in fixed_arithmetic()
747 return do_fixed_add (f, op0, op1, false, sat_p); in fixed_arithmetic()
752 return do_fixed_add (f, op0, op1, true, sat_p); in fixed_arithmetic()
757 return do_fixed_multiply (f, op0, op1, sat_p); in fixed_arithmetic()
762 return do_fixed_divide (f, op0, op1, sat_p); in fixed_arithmetic()
766 return do_fixed_shift (f, op0, op1, true, sat_p); in fixed_arithmetic()
770 return do_fixed_shift (f, op0, op1, false, sat_p); in fixed_arithmetic()
823 fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode, in fixed_convert() argument
829 *f = *a; in fixed_convert()
851 f->mode = mode; in fixed_convert()
852 f->data = temp_low; in fixed_convert()
854 SIGNED_FIXED_POINT_MODE_P (f->mode)) in fixed_convert()
855 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, &f->data, in fixed_convert()
868 f->data.low = 0; /* Set to zero. */ in fixed_convert()
869 f->data.high = 0; /* Set to zero. */ in fixed_convert()
875 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, in fixed_convert()
876 &f->data, sat_p); in fixed_convert()
886 f->data.low = -1; /* Set to all ones. */ in fixed_convert()
887 f->data.high = -1; /* Set to all ones. */ in fixed_convert()
888 f->data = double_int_ext (f->data, in fixed_convert()
889 GET_MODE_FBIT (f->mode) in fixed_convert()
890 + GET_MODE_IBIT (f->mode), in fixed_convert()
897 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, in fixed_convert()
898 &f->data, sat_p); in fixed_convert()
911 f->mode = mode; in fixed_convert()
912 f->data = temp; in fixed_convert()
914 SIGNED_FIXED_POINT_MODE_P (f->mode)) in fixed_convert()
915 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p); in fixed_convert()
927 f->data.low = 0; /* Set to zero. */ in fixed_convert()
928 f->data.high = 0; /* Set to zero. */ in fixed_convert()
934 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, in fixed_convert()
945 f->data.low = -1; /* Set to all ones. */ in fixed_convert()
946 f->data.high = -1; /* Set to all ones. */ in fixed_convert()
947 f->data = double_int_ext (f->data, in fixed_convert()
948 GET_MODE_FBIT (f->mode) in fixed_convert()
949 + GET_MODE_IBIT (f->mode), in fixed_convert()
956 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, in fixed_convert()
962 f->data = double_int_ext (f->data, in fixed_convert()
963 SIGNED_FIXED_POINT_MODE_P (f->mode) in fixed_convert()
964 + GET_MODE_FBIT (f->mode) in fixed_convert()
965 + GET_MODE_IBIT (f->mode), in fixed_convert()
966 UNSIGNED_FIXED_POINT_MODE_P (f->mode)); in fixed_convert()
976 fixed_convert_from_int (FIXED_VALUE_TYPE *f, enum machine_mode mode, in fixed_convert_from_int() argument
1005 f->mode = mode; in fixed_convert_from_int()
1006 f->data = temp_low; in fixed_convert_from_int()
1008 if (unsigned_p == UNSIGNED_FIXED_POINT_MODE_P (f->mode)) in fixed_convert_from_int()
1009 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, &f->data, in fixed_convert_from_int()
1021 f->data.low = 0; /* Set to zero. */ in fixed_convert_from_int()
1022 f->data.high = 0; /* Set to zero. */ in fixed_convert_from_int()
1028 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, in fixed_convert_from_int()
1029 &f->data, sat_p); in fixed_convert_from_int()
1039 f->data.low = -1; /* Set to all ones. */ in fixed_convert_from_int()
1040 f->data.high = -1; /* Set to all ones. */ in fixed_convert_from_int()
1041 f->data = double_int_ext (f->data, in fixed_convert_from_int()
1042 GET_MODE_FBIT (f->mode) in fixed_convert_from_int()
1043 + GET_MODE_IBIT (f->mode), in fixed_convert_from_int()
1050 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, in fixed_convert_from_int()
1051 &f->data, sat_p); in fixed_convert_from_int()
1054 f->data = double_int_ext (f->data, in fixed_convert_from_int()
1055 SIGNED_FIXED_POINT_MODE_P (f->mode) in fixed_convert_from_int()
1056 + GET_MODE_FBIT (f->mode) in fixed_convert_from_int()
1057 + GET_MODE_IBIT (f->mode), in fixed_convert_from_int()
1058 UNSIGNED_FIXED_POINT_MODE_P (f->mode)); in fixed_convert_from_int()
1067 fixed_convert_from_real (FIXED_VALUE_TYPE *f, enum machine_mode mode, in fixed_convert_from_real() argument
1078 f->mode = mode; in fixed_convert_from_real()
1081 real_to_integer2 ((HOST_WIDE_INT *)&f->data.low, &f->data.high, &fixed_value); in fixed_convert_from_real()
1089 f->data.low = 0; in fixed_convert_from_real()
1090 f->data.high = 0; in fixed_convert_from_real()
1094 f->data.low = 1; in fixed_convert_from_real()
1095 f->data.high = 0; in fixed_convert_from_real()
1096 lshift_double (f->data.low, f->data.high, i_f_bits, in fixed_convert_from_real()
1098 &f->data.low, &f->data.high, 1); in fixed_convert_from_real()
1099 f->data = double_int_ext (f->data, 1 + i_f_bits, 0); in fixed_convert_from_real()
1109 f->data.low = -1; in fixed_convert_from_real()
1110 f->data.high = -1; in fixed_convert_from_real()
1111 f->data = double_int_ext (f->data, i_f_bits, 1); in fixed_convert_from_real()
1116 f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p); in fixed_convert_from_real()
1124 const FIXED_VALUE_TYPE *f) in real_convert_from_fixed() argument
1128 real_2expN (&base_value, GET_MODE_FBIT (f->mode), f->mode); in real_convert_from_fixed()
1129 real_from_integer (&fixed_value, VOIDmode, f->data.low, f->data.high, in real_convert_from_fixed()
1130 UNSIGNED_FIXED_POINT_MODE_P (f->mode)); in real_convert_from_fixed()
1138 fixed_isneg (const FIXED_VALUE_TYPE *f) in fixed_isneg() argument
1140 if (SIGNED_FIXED_POINT_MODE_P (f->mode)) in fixed_isneg()
1142 int i_f_bits = GET_MODE_IBIT (f->mode) + GET_MODE_FBIT (f->mode); in fixed_isneg()
1143 int sign_bit = get_fixed_sign_bit (f->data, i_f_bits); in fixed_isneg()