Lines Matching refs:mode

32   return (a->mode == b->mode  in fixed_identical()
62 check_real_for_fixed_mode (REAL_VALUE_TYPE *real_value, machine_mode mode) in check_real_for_fixed_mode() argument
66 real_2expN (&max_value, GET_MODE_IBIT (mode), VOIDmode); in check_real_for_fixed_mode()
67 real_2expN (&epsilon_value, -GET_MODE_FBIT (mode), VOIDmode); in check_real_for_fixed_mode()
69 if (SIGNED_FIXED_POINT_MODE_P (mode)) in check_real_for_fixed_mode()
89 fixed_from_double_int (double_int payload, scalar_mode mode) in fixed_from_double_int() argument
93 gcc_assert (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_DOUBLE_INT); in fixed_from_double_int()
95 if (SIGNED_SCALAR_FIXED_POINT_MODE_P (mode)) in fixed_from_double_int()
96 value.data = payload.sext (1 + GET_MODE_IBIT (mode) + GET_MODE_FBIT (mode)); in fixed_from_double_int()
97 else if (UNSIGNED_SCALAR_FIXED_POINT_MODE_P (mode)) in fixed_from_double_int()
98 value.data = payload.zext (GET_MODE_IBIT (mode) + GET_MODE_FBIT (mode)); in fixed_from_double_int()
102 value.mode = mode; in fixed_from_double_int()
111 fixed_from_string (FIXED_VALUE_TYPE *f, const char *str, scalar_mode mode) in fixed_from_string() argument
118 f->mode = mode; in fixed_from_string()
119 fbit = GET_MODE_FBIT (mode); in fixed_from_string()
122 temp = check_real_for_fixed_mode (&real_value, f->mode); in fixed_from_string()
126 || (temp == FIXED_MAX_EPS && ALL_ACCUM_MODE_P (f->mode))) in fixed_from_string()
132 GET_MODE_PRECISION (mode)); in fixed_from_string()
136 if (temp == FIXED_MAX_EPS && ALL_FRACT_MODE_P (f->mode)) in fixed_from_string()
141 f->data = f->data.zext (GET_MODE_FBIT (f->mode) in fixed_from_string()
142 + GET_MODE_IBIT (f->mode)); in fixed_from_string()
145 f->data = f->data.ext (SIGNED_FIXED_POINT_MODE_P (f->mode) in fixed_from_string()
146 + GET_MODE_FBIT (f->mode) in fixed_from_string()
147 + GET_MODE_IBIT (f->mode), in fixed_from_string()
148 UNSIGNED_FIXED_POINT_MODE_P (f->mode)); in fixed_from_string()
159 signop sgn = UNSIGNED_FIXED_POINT_MODE_P (f_orig->mode) ? UNSIGNED : SIGNED; in fixed_to_decimal()
160 real_2expN (&base_value, GET_MODE_FBIT (f_orig->mode), VOIDmode); in fixed_to_decimal()
163 GET_MODE_PRECISION (f_orig->mode), sgn), in fixed_to_decimal()
178 fixed_saturate1 (machine_mode mode, double_int a, double_int *f, in fixed_saturate1() argument
182 bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (mode); in fixed_saturate1()
183 int i_f_bits = GET_MODE_IBIT (mode) + GET_MODE_FBIT (mode); in fixed_saturate1()
236 fixed_saturate2 (machine_mode mode, double_int a_high, double_int a_low, in fixed_saturate2() argument
240 bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (mode); in fixed_saturate2()
241 int i_f_bits = GET_MODE_IBIT (mode) + GET_MODE_FBIT (mode); in fixed_saturate2()
328 unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode); in do_fixed_add()
329 i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode); in do_fixed_add()
330 f->mode = a->mode; in do_fixed_add()
403 bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode); in do_fixed_multiply()
404 int i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode); in do_fixed_multiply()
405 f->mode = a->mode; in do_fixed_multiply()
406 if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT) in do_fixed_multiply()
409 f->data = f->data.lshift (-GET_MODE_FBIT (f->mode), in do_fixed_multiply()
411 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p); in do_fixed_multiply()
471 if (GET_MODE_FBIT (f->mode) == HOST_BITS_PER_DOUBLE_INT) in do_fixed_multiply()
490 s = s.llshift ((-GET_MODE_FBIT (f->mode)), HOST_BITS_PER_DOUBLE_INT); in do_fixed_multiply()
492 - GET_MODE_FBIT (f->mode)), in do_fixed_multiply()
498 r = r.lshift (-GET_MODE_FBIT (f->mode), in do_fixed_multiply()
502 overflow_p = fixed_saturate2 (f->mode, r, s, &f->data, sat_p); in do_fixed_multiply()
518 bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode); in do_fixed_divide()
519 int i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode); in do_fixed_divide()
520 f->mode = a->mode; in do_fixed_divide()
521 if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT) in do_fixed_divide()
523 f->data = a->data.lshift (GET_MODE_FBIT (f->mode), in do_fixed_divide()
526 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p); in do_fixed_divide()
554 if (GET_MODE_FBIT (f->mode) == HOST_BITS_PER_DOUBLE_INT) in do_fixed_divide()
562 s = pos_a.llshift (GET_MODE_FBIT (f->mode), HOST_BITS_PER_DOUBLE_INT); in do_fixed_divide()
564 - GET_MODE_FBIT (f->mode)), in do_fixed_divide()
614 overflow_p = fixed_saturate2 (f->mode, quo_r, quo_s, &f->data, sat_p); in do_fixed_divide()
630 bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode); in do_fixed_shift()
631 int i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode); in do_fixed_shift()
632 f->mode = a->mode; in do_fixed_shift()
640 if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT || (!left_p)) in do_fixed_shift()
645 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p); in do_fixed_shift()
667 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, &f->data, in do_fixed_shift()
682 bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode); in do_fixed_neg()
683 int i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode); in do_fixed_neg()
684 f->mode = a->mode; in do_fixed_neg()
735 gcc_assert (op0->mode == op1->mode); in fixed_arithmetic()
739 gcc_assert (op0->mode == op1->mode); in fixed_arithmetic()
743 gcc_assert (op0->mode == op1->mode); in fixed_arithmetic()
747 gcc_assert (op0->mode == op1->mode); in fixed_arithmetic()
770 gcc_assert (op0->mode == op1->mode); in fixed_compare()
782 UNSIGNED_FIXED_POINT_MODE_P (op0->mode)) == -1; in fixed_compare()
786 UNSIGNED_FIXED_POINT_MODE_P (op0->mode)) != 1; in fixed_compare()
790 UNSIGNED_FIXED_POINT_MODE_P (op0->mode)) == 1; in fixed_compare()
794 UNSIGNED_FIXED_POINT_MODE_P (op0->mode)) != -1; in fixed_compare()
806 fixed_convert (FIXED_VALUE_TYPE *f, scalar_mode mode, in fixed_convert() argument
810 if (mode == a->mode) in fixed_convert()
816 if (GET_MODE_FBIT (mode) > GET_MODE_FBIT (a->mode)) in fixed_convert()
820 int amount = GET_MODE_FBIT (mode) - GET_MODE_FBIT (a->mode); in fixed_convert()
823 SIGNED_FIXED_POINT_MODE_P (a->mode)); in fixed_convert()
827 if (SIGNED_FIXED_POINT_MODE_P (a->mode) in fixed_convert()
830 f->mode = mode; in fixed_convert()
832 if (SIGNED_FIXED_POINT_MODE_P (a->mode) == in fixed_convert()
833 SIGNED_FIXED_POINT_MODE_P (f->mode)) in fixed_convert()
834 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, &f->data, in fixed_convert()
840 if (SIGNED_FIXED_POINT_MODE_P (a->mode)) in fixed_convert()
854 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, in fixed_convert()
867 f->data = f->data.zext (GET_MODE_FBIT (f->mode) in fixed_convert()
868 + GET_MODE_IBIT (f->mode)); in fixed_convert()
875 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, in fixed_convert()
884 temp = a->data.lshift (GET_MODE_FBIT (mode) - GET_MODE_FBIT (a->mode), in fixed_convert()
886 SIGNED_FIXED_POINT_MODE_P (a->mode)); in fixed_convert()
887 f->mode = mode; in fixed_convert()
889 if (SIGNED_FIXED_POINT_MODE_P (a->mode) == in fixed_convert()
890 SIGNED_FIXED_POINT_MODE_P (f->mode)) in fixed_convert()
891 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p); in fixed_convert()
896 if (SIGNED_FIXED_POINT_MODE_P (a->mode)) in fixed_convert()
910 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, in fixed_convert()
923 f->data = f->data.zext (GET_MODE_FBIT (f->mode) in fixed_convert()
924 + GET_MODE_IBIT (f->mode)); in fixed_convert()
931 overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, in fixed_convert()
937 f->data = f->data.ext (SIGNED_FIXED_POINT_MODE_P (f->mode) in fixed_convert()
938 + GET_MODE_FBIT (f->mode) in fixed_convert()
939 + GET_MODE_IBIT (f->mode), in fixed_convert()
940 UNSIGNED_FIXED_POINT_MODE_P (f->mode)); in fixed_convert()
950 fixed_convert_from_int (FIXED_VALUE_TYPE *f, scalar_mode mode, in fixed_convert_from_int() argument
956 int amount = GET_MODE_FBIT (mode); in fixed_convert_from_int()
974 f->mode = mode; in fixed_convert_from_int()
977 if (unsigned_p == UNSIGNED_FIXED_POINT_MODE_P (f->mode)) in fixed_convert_from_int()
978 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, &f->data, in fixed_convert_from_int()
997 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, in fixed_convert_from_int()
1010 f->data = f->data.zext (GET_MODE_FBIT (f->mode) in fixed_convert_from_int()
1011 + GET_MODE_IBIT (f->mode)); in fixed_convert_from_int()
1018 overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, in fixed_convert_from_int()
1022 f->data = f->data.ext (SIGNED_FIXED_POINT_MODE_P (f->mode) in fixed_convert_from_int()
1023 + GET_MODE_FBIT (f->mode) in fixed_convert_from_int()
1024 + GET_MODE_IBIT (f->mode), in fixed_convert_from_int()
1025 UNSIGNED_FIXED_POINT_MODE_P (f->mode)); in fixed_convert_from_int()
1034 fixed_convert_from_real (FIXED_VALUE_TYPE *f, scalar_mode mode, in fixed_convert_from_real() argument
1039 bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (mode); in fixed_convert_from_real()
1040 int i_f_bits = GET_MODE_IBIT (mode) + GET_MODE_FBIT (mode); in fixed_convert_from_real()
1041 unsigned int fbit = GET_MODE_FBIT (mode); in fixed_convert_from_real()
1046 f->mode = mode; in fixed_convert_from_real()
1051 GET_MODE_PRECISION (mode)); in fixed_convert_from_real()
1054 temp = check_real_for_fixed_mode (&real_value, mode); in fixed_convert_from_real()
1093 real_convert_from_fixed (REAL_VALUE_TYPE *r, scalar_mode mode, in real_convert_from_fixed() argument
1098 signop sgn = UNSIGNED_FIXED_POINT_MODE_P (f->mode) ? UNSIGNED : SIGNED; in real_convert_from_fixed()
1099 real_2expN (&base_value, GET_MODE_FBIT (f->mode), VOIDmode); in real_convert_from_fixed()
1101 wide_int::from (f->data, GET_MODE_PRECISION (f->mode), in real_convert_from_fixed()
1104 real_convert (r, mode, &real_value); in real_convert_from_fixed()
1112 if (SIGNED_FIXED_POINT_MODE_P (f->mode)) in fixed_isneg()
1114 int i_f_bits = GET_MODE_IBIT (f->mode) + GET_MODE_FBIT (f->mode); in fixed_isneg()