Lines Matching full:env

29 void restore_fp_status(CPULoongArchState *env)  in restore_fp_status()  argument
31 set_float_rounding_mode(ieee_rm[(env->fcsr0 >> FCSR0_RM) & 0x3], in restore_fp_status()
32 &env->fp_status); in restore_fp_status()
33 set_flush_to_zero(0, &env->fp_status); in restore_fp_status()
34 set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fp_status); in restore_fp_status()
58 static void update_fcsr0_mask(CPULoongArchState *env, uintptr_t pc, int mask) in update_fcsr0_mask() argument
60 int flags = get_float_exception_flags(&env->fp_status); in update_fcsr0_mask()
62 set_float_exception_flags(0, &env->fp_status); in update_fcsr0_mask()
67 SET_FP_CAUSE(env->fcsr0, flags); in update_fcsr0_mask()
71 SET_FP_CAUSE(env->fcsr0, flags); in update_fcsr0_mask()
74 if (GET_FP_ENABLES(env->fcsr0) & flags) { in update_fcsr0_mask()
75 do_raise_exception(env, EXCCODE_FPE, pc); in update_fcsr0_mask()
77 UPDATE_FP_FLAGS(env->fcsr0, flags); in update_fcsr0_mask()
81 static void update_fcsr0(CPULoongArchState *env, uintptr_t pc) in update_fcsr0() argument
83 update_fcsr0_mask(env, pc, 0); in update_fcsr0()
86 uint64_t helper_fadd_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fadd_s() argument
90 fd = nanbox_s(float32_add((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fadd_s()
91 update_fcsr0(env, GETPC()); in helper_fadd_s()
95 uint64_t helper_fadd_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fadd_d() argument
99 fd = float64_add(fj, fk, &env->fp_status); in helper_fadd_d()
100 update_fcsr0(env, GETPC()); in helper_fadd_d()
104 uint64_t helper_fsub_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fsub_s() argument
108 fd = nanbox_s(float32_sub((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fsub_s()
109 update_fcsr0(env, GETPC()); in helper_fsub_s()
113 uint64_t helper_fsub_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fsub_d() argument
117 fd = float64_sub(fj, fk, &env->fp_status); in helper_fsub_d()
118 update_fcsr0(env, GETPC()); in helper_fsub_d()
122 uint64_t helper_fmul_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmul_s() argument
126 fd = nanbox_s(float32_mul((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fmul_s()
127 update_fcsr0(env, GETPC()); in helper_fmul_s()
131 uint64_t helper_fmul_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmul_d() argument
135 fd = float64_mul(fj, fk, &env->fp_status); in helper_fmul_d()
136 update_fcsr0(env, GETPC()); in helper_fmul_d()
140 uint64_t helper_fdiv_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fdiv_s() argument
144 fd = nanbox_s(float32_div((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fdiv_s()
145 update_fcsr0(env, GETPC()); in helper_fdiv_s()
149 uint64_t helper_fdiv_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fdiv_d() argument
153 fd = float64_div(fj, fk, &env->fp_status); in helper_fdiv_d()
154 update_fcsr0(env, GETPC()); in helper_fdiv_d()
158 uint64_t helper_fmax_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmax_s() argument
162 fd = nanbox_s(float32_maxnum((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fmax_s()
163 update_fcsr0(env, GETPC()); in helper_fmax_s()
167 uint64_t helper_fmax_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmax_d() argument
171 fd = float64_maxnum(fj, fk, &env->fp_status); in helper_fmax_d()
172 update_fcsr0(env, GETPC()); in helper_fmax_d()
176 uint64_t helper_fmin_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmin_s() argument
180 fd = nanbox_s(float32_minnum((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fmin_s()
181 update_fcsr0(env, GETPC()); in helper_fmin_s()
185 uint64_t helper_fmin_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmin_d() argument
189 fd = float64_minnum(fj, fk, &env->fp_status); in helper_fmin_d()
190 update_fcsr0(env, GETPC()); in helper_fmin_d()
194 uint64_t helper_fmaxa_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmaxa_s() argument
199 (uint32_t)fk, &env->fp_status)); in helper_fmaxa_s()
200 update_fcsr0(env, GETPC()); in helper_fmaxa_s()
204 uint64_t helper_fmaxa_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmaxa_d() argument
208 fd = float64_maxnummag(fj, fk, &env->fp_status); in helper_fmaxa_d()
209 update_fcsr0(env, GETPC()); in helper_fmaxa_d()
213 uint64_t helper_fmina_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmina_s() argument
218 (uint32_t)fk, &env->fp_status)); in helper_fmina_s()
219 update_fcsr0(env, GETPC()); in helper_fmina_s()
223 uint64_t helper_fmina_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmina_d() argument
227 fd = float64_minnummag(fj, fk, &env->fp_status); in helper_fmina_d()
228 update_fcsr0(env, GETPC()); in helper_fmina_d()
232 uint64_t helper_fscaleb_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fscaleb_s() argument
240 &env->fp_status)); in helper_fscaleb_s()
241 update_fcsr0(env, GETPC()); in helper_fscaleb_s()
245 uint64_t helper_fscaleb_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fscaleb_d() argument
253 &env->fp_status); in helper_fscaleb_d()
254 update_fcsr0(env, GETPC()); in helper_fscaleb_d()
258 uint64_t helper_fsqrt_s(CPULoongArchState *env, uint64_t fj) in helper_fsqrt_s() argument
262 fd = nanbox_s(float32_sqrt((uint32_t)fj, &env->fp_status)); in helper_fsqrt_s()
263 update_fcsr0(env, GETPC()); in helper_fsqrt_s()
267 uint64_t helper_fsqrt_d(CPULoongArchState *env, uint64_t fj) in helper_fsqrt_d() argument
271 fd = float64_sqrt(fj, &env->fp_status); in helper_fsqrt_d()
272 update_fcsr0(env, GETPC()); in helper_fsqrt_d()
276 uint64_t helper_frecip_s(CPULoongArchState *env, uint64_t fj) in helper_frecip_s() argument
280 fd = nanbox_s(float32_div(float32_one, (uint32_t)fj, &env->fp_status)); in helper_frecip_s()
281 update_fcsr0(env, GETPC()); in helper_frecip_s()
285 uint64_t helper_frecip_d(CPULoongArchState *env, uint64_t fj) in helper_frecip_d() argument
289 fd = float64_div(float64_one, fj, &env->fp_status); in helper_frecip_d()
290 update_fcsr0(env, GETPC()); in helper_frecip_d()
294 uint64_t helper_frsqrt_s(CPULoongArchState *env, uint64_t fj) in helper_frsqrt_s() argument
299 fp = float32_sqrt((uint32_t)fj, &env->fp_status); in helper_frsqrt_s()
300 fd = nanbox_s(float32_div(float32_one, fp, &env->fp_status)); in helper_frsqrt_s()
301 update_fcsr0(env, GETPC()); in helper_frsqrt_s()
305 uint64_t helper_frsqrt_d(CPULoongArchState *env, uint64_t fj) in helper_frsqrt_d() argument
309 fp = float64_sqrt(fj, &env->fp_status); in helper_frsqrt_d()
310 fd = float64_div(float64_one, fp, &env->fp_status); in helper_frsqrt_d()
311 update_fcsr0(env, GETPC()); in helper_frsqrt_d()
315 uint64_t helper_flogb_s(CPULoongArchState *env, uint64_t fj) in helper_flogb_s() argument
319 float_status *status = &env->fp_status; in helper_flogb_s()
326 update_fcsr0_mask(env, GETPC(), float_flag_inexact); in helper_flogb_s()
330 uint64_t helper_flogb_d(CPULoongArchState *env, uint64_t fj) in helper_flogb_d() argument
333 float_status *status = &env->fp_status; in helper_flogb_d()
340 update_fcsr0_mask(env, GETPC(), float_flag_inexact); in helper_flogb_d()
344 uint64_t helper_fclass_s(CPULoongArchState *env, uint64_t fj) in helper_fclass_s() argument
363 uint64_t helper_fclass_d(CPULoongArchState *env, uint64_t fj) in helper_fclass_d() argument
382 uint64_t helper_fmuladd_s(CPULoongArchState *env, uint64_t fj, in helper_fmuladd_s() argument
388 (uint32_t)fa, flag, &env->fp_status)); in helper_fmuladd_s()
389 update_fcsr0(env, GETPC()); in helper_fmuladd_s()
393 uint64_t helper_fmuladd_d(CPULoongArchState *env, uint64_t fj, in helper_fmuladd_d() argument
398 fd = float64_muladd(fj, fk, fa, flag, &env->fp_status); in helper_fmuladd_d()
399 update_fcsr0(env, GETPC()); in helper_fmuladd_d()
403 static uint64_t fcmp_common(CPULoongArchState *env, FloatRelation cmp, in fcmp_common() argument
424 update_fcsr0(env, GETPC()); in fcmp_common()
430 uint64_t helper_fcmp_c_s(CPULoongArchState *env, uint64_t fj, in helper_fcmp_c_s() argument
434 (uint32_t)fk, &env->fp_status); in helper_fcmp_c_s()
435 return fcmp_common(env, cmp, flags); in helper_fcmp_c_s()
439 uint64_t helper_fcmp_s_s(CPULoongArchState *env, uint64_t fj, in helper_fcmp_s_s() argument
443 (uint32_t)fk, &env->fp_status); in helper_fcmp_s_s()
444 return fcmp_common(env, cmp, flags); in helper_fcmp_s_s()
448 uint64_t helper_fcmp_c_d(CPULoongArchState *env, uint64_t fj, in helper_fcmp_c_d() argument
451 FloatRelation cmp = float64_compare_quiet(fj, fk, &env->fp_status); in helper_fcmp_c_d()
452 return fcmp_common(env, cmp, flags); in helper_fcmp_c_d()
456 uint64_t helper_fcmp_s_d(CPULoongArchState *env, uint64_t fj, in helper_fcmp_s_d() argument
459 FloatRelation cmp = float64_compare(fj, fk, &env->fp_status); in helper_fcmp_s_d()
460 return fcmp_common(env, cmp, flags); in helper_fcmp_s_d()
464 uint64_t helper_fcvt_s_d(CPULoongArchState *env, uint64_t fj) in helper_fcvt_s_d() argument
468 fd = nanbox_s(float64_to_float32(fj, &env->fp_status)); in helper_fcvt_s_d()
469 update_fcsr0(env, GETPC()); in helper_fcvt_s_d()
473 uint64_t helper_fcvt_d_s(CPULoongArchState *env, uint64_t fj) in helper_fcvt_d_s() argument
477 fd = float32_to_float64((uint32_t)fj, &env->fp_status); in helper_fcvt_d_s()
478 update_fcsr0(env, GETPC()); in helper_fcvt_d_s()
482 uint64_t helper_ffint_s_w(CPULoongArchState *env, uint64_t fj) in helper_ffint_s_w() argument
486 fd = nanbox_s(int32_to_float32((int32_t)fj, &env->fp_status)); in helper_ffint_s_w()
487 update_fcsr0(env, GETPC()); in helper_ffint_s_w()
491 uint64_t helper_ffint_s_l(CPULoongArchState *env, uint64_t fj) in helper_ffint_s_l() argument
495 fd = nanbox_s(int64_to_float32(fj, &env->fp_status)); in helper_ffint_s_l()
496 update_fcsr0(env, GETPC()); in helper_ffint_s_l()
500 uint64_t helper_ffint_d_w(CPULoongArchState *env, uint64_t fj) in helper_ffint_d_w() argument
504 fd = int32_to_float64((int32_t)fj, &env->fp_status); in helper_ffint_d_w()
505 update_fcsr0(env, GETPC()); in helper_ffint_d_w()
509 uint64_t helper_ffint_d_l(CPULoongArchState *env, uint64_t fj) in helper_ffint_d_l() argument
513 fd = int64_to_float64(fj, &env->fp_status); in helper_ffint_d_l()
514 update_fcsr0(env, GETPC()); in helper_ffint_d_l()
518 uint64_t helper_frint_s(CPULoongArchState *env, uint64_t fj) in helper_frint_s() argument
522 fd = (uint64_t)(float32_round_to_int((uint32_t)fj, &env->fp_status)); in helper_frint_s()
523 update_fcsr0(env, GETPC()); in helper_frint_s()
527 uint64_t helper_frint_d(CPULoongArchState *env, uint64_t fj) in helper_frint_d() argument
531 fd = float64_round_to_int(fj, &env->fp_status); in helper_frint_d()
532 update_fcsr0(env, GETPC()); in helper_frint_d()
536 uint64_t helper_ftintrm_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrm_l_d() argument
539 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrm_l_d()
541 set_float_rounding_mode(float_round_down, &env->fp_status); in helper_ftintrm_l_d()
542 fd = float64_to_int64(fj, &env->fp_status); in helper_ftintrm_l_d()
543 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrm_l_d()
545 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrm_l_d()
550 update_fcsr0(env, GETPC()); in helper_ftintrm_l_d()
554 uint64_t helper_ftintrm_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrm_l_s() argument
557 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrm_l_s()
559 set_float_rounding_mode(float_round_down, &env->fp_status); in helper_ftintrm_l_s()
560 fd = float32_to_int64((uint32_t)fj, &env->fp_status); in helper_ftintrm_l_s()
561 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrm_l_s()
563 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrm_l_s()
568 update_fcsr0(env, GETPC()); in helper_ftintrm_l_s()
572 uint64_t helper_ftintrm_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrm_w_d() argument
575 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrm_w_d()
577 set_float_rounding_mode(float_round_down, &env->fp_status); in helper_ftintrm_w_d()
578 fd = (uint64_t)float64_to_int32(fj, &env->fp_status); in helper_ftintrm_w_d()
579 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrm_w_d()
581 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrm_w_d()
586 update_fcsr0(env, GETPC()); in helper_ftintrm_w_d()
590 uint64_t helper_ftintrm_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrm_w_s() argument
593 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrm_w_s()
595 set_float_rounding_mode(float_round_down, &env->fp_status); in helper_ftintrm_w_s()
596 fd = (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); in helper_ftintrm_w_s()
597 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrm_w_s()
599 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrm_w_s()
604 update_fcsr0(env, GETPC()); in helper_ftintrm_w_s()
608 uint64_t helper_ftintrp_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrp_l_d() argument
611 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrp_l_d()
613 set_float_rounding_mode(float_round_up, &env->fp_status); in helper_ftintrp_l_d()
614 fd = float64_to_int64(fj, &env->fp_status); in helper_ftintrp_l_d()
615 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrp_l_d()
617 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrp_l_d()
622 update_fcsr0(env, GETPC()); in helper_ftintrp_l_d()
626 uint64_t helper_ftintrp_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrp_l_s() argument
629 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrp_l_s()
631 set_float_rounding_mode(float_round_up, &env->fp_status); in helper_ftintrp_l_s()
632 fd = float32_to_int64((uint32_t)fj, &env->fp_status); in helper_ftintrp_l_s()
633 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrp_l_s()
635 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrp_l_s()
640 update_fcsr0(env, GETPC()); in helper_ftintrp_l_s()
644 uint64_t helper_ftintrp_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrp_w_d() argument
647 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrp_w_d()
649 set_float_rounding_mode(float_round_up, &env->fp_status); in helper_ftintrp_w_d()
650 fd = (uint64_t)float64_to_int32(fj, &env->fp_status); in helper_ftintrp_w_d()
651 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrp_w_d()
653 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrp_w_d()
658 update_fcsr0(env, GETPC()); in helper_ftintrp_w_d()
662 uint64_t helper_ftintrp_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrp_w_s() argument
665 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrp_w_s()
667 set_float_rounding_mode(float_round_up, &env->fp_status); in helper_ftintrp_w_s()
668 fd = (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); in helper_ftintrp_w_s()
669 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrp_w_s()
671 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrp_w_s()
676 update_fcsr0(env, GETPC()); in helper_ftintrp_w_s()
680 uint64_t helper_ftintrz_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrz_l_d() argument
683 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrz_l_d()
685 fd = float64_to_int64_round_to_zero(fj, &env->fp_status); in helper_ftintrz_l_d()
686 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrz_l_d()
688 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrz_l_d()
693 update_fcsr0(env, GETPC()); in helper_ftintrz_l_d()
697 uint64_t helper_ftintrz_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrz_l_s() argument
700 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrz_l_s()
702 fd = float32_to_int64_round_to_zero((uint32_t)fj, &env->fp_status); in helper_ftintrz_l_s()
703 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrz_l_s()
705 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrz_l_s()
710 update_fcsr0(env, GETPC()); in helper_ftintrz_l_s()
714 uint64_t helper_ftintrz_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrz_w_d() argument
717 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrz_w_d()
719 fd = (uint64_t)float64_to_int32_round_to_zero(fj, &env->fp_status); in helper_ftintrz_w_d()
720 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrz_w_d()
722 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrz_w_d()
727 update_fcsr0(env, GETPC()); in helper_ftintrz_w_d()
731 uint64_t helper_ftintrz_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrz_w_s() argument
734 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrz_w_s()
736 fd = float32_to_int32_round_to_zero((uint32_t)fj, &env->fp_status); in helper_ftintrz_w_s()
737 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrz_w_s()
739 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrz_w_s()
744 update_fcsr0(env, GETPC()); in helper_ftintrz_w_s()
748 uint64_t helper_ftintrne_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrne_l_d() argument
751 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrne_l_d()
753 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ftintrne_l_d()
754 fd = float64_to_int64(fj, &env->fp_status); in helper_ftintrne_l_d()
755 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrne_l_d()
757 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrne_l_d()
762 update_fcsr0(env, GETPC()); in helper_ftintrne_l_d()
766 uint64_t helper_ftintrne_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrne_l_s() argument
769 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrne_l_s()
771 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ftintrne_l_s()
772 fd = float32_to_int64((uint32_t)fj, &env->fp_status); in helper_ftintrne_l_s()
773 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrne_l_s()
775 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrne_l_s()
780 update_fcsr0(env, GETPC()); in helper_ftintrne_l_s()
784 uint64_t helper_ftintrne_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrne_w_d() argument
787 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrne_w_d()
789 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ftintrne_w_d()
790 fd = (uint64_t)float64_to_int32(fj, &env->fp_status); in helper_ftintrne_w_d()
791 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrne_w_d()
793 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrne_w_d()
798 update_fcsr0(env, GETPC()); in helper_ftintrne_w_d()
802 uint64_t helper_ftintrne_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrne_w_s() argument
805 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrne_w_s()
807 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ftintrne_w_s()
808 fd = float32_to_int32((uint32_t)fj, &env->fp_status); in helper_ftintrne_w_s()
809 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrne_w_s()
811 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrne_w_s()
816 update_fcsr0(env, GETPC()); in helper_ftintrne_w_s()
820 uint64_t helper_ftint_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftint_l_d() argument
824 fd = float64_to_int64(fj, &env->fp_status); in helper_ftint_l_d()
825 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftint_l_d()
830 update_fcsr0(env, GETPC()); in helper_ftint_l_d()
834 uint64_t helper_ftint_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftint_l_s() argument
838 fd = float32_to_int64((uint32_t)fj, &env->fp_status); in helper_ftint_l_s()
839 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftint_l_s()
844 update_fcsr0(env, GETPC()); in helper_ftint_l_s()
848 uint64_t helper_ftint_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftint_w_s() argument
852 fd = (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); in helper_ftint_w_s()
853 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftint_w_s()
858 update_fcsr0(env, GETPC()); in helper_ftint_w_s()
862 uint64_t helper_ftint_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftint_w_d() argument
866 fd = (uint64_t)float64_to_int32(fj, &env->fp_status); in helper_ftint_w_d()
867 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftint_w_d()
872 update_fcsr0(env, GETPC()); in helper_ftint_w_d()
876 void helper_set_rounding_mode(CPULoongArchState *env) in helper_set_rounding_mode() argument
878 set_float_rounding_mode(ieee_rm[(env->fcsr0 >> FCSR0_RM) & 0x3], in helper_set_rounding_mode()
879 &env->fp_status); in helper_set_rounding_mode()