Lines Matching full:env
28 void restore_fp_status(CPULoongArchState *env) in restore_fp_status() argument
30 set_float_rounding_mode(ieee_rm[(env->fcsr0 >> FCSR0_RM) & 0x3], in restore_fp_status()
31 &env->fp_status); in restore_fp_status()
32 set_flush_to_zero(0, &env->fp_status); in restore_fp_status()
33 set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fp_status); in restore_fp_status()
38 set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status); in restore_fp_status()
39 set_float_3nan_prop_rule(float_3nan_prop_s_cab, &env->fp_status); in restore_fp_status()
41 set_float_default_nan_pattern(0b01000000, &env->fp_status); in restore_fp_status()
65 static void update_fcsr0_mask(CPULoongArchState *env, uintptr_t pc, int mask) in update_fcsr0_mask() argument
67 int flags = get_float_exception_flags(&env->fp_status); in update_fcsr0_mask()
69 set_float_exception_flags(0, &env->fp_status); in update_fcsr0_mask()
74 SET_FP_CAUSE(env->fcsr0, flags); in update_fcsr0_mask()
78 SET_FP_CAUSE(env->fcsr0, flags); in update_fcsr0_mask()
81 if (GET_FP_ENABLES(env->fcsr0) & flags) { in update_fcsr0_mask()
82 do_raise_exception(env, EXCCODE_FPE, pc); in update_fcsr0_mask()
84 UPDATE_FP_FLAGS(env->fcsr0, flags); in update_fcsr0_mask()
88 static void update_fcsr0(CPULoongArchState *env, uintptr_t pc) in update_fcsr0() argument
90 update_fcsr0_mask(env, pc, 0); in update_fcsr0()
93 uint64_t helper_fadd_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fadd_s() argument
97 fd = nanbox_s(float32_add((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fadd_s()
98 update_fcsr0(env, GETPC()); in helper_fadd_s()
102 uint64_t helper_fadd_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fadd_d() argument
106 fd = float64_add(fj, fk, &env->fp_status); in helper_fadd_d()
107 update_fcsr0(env, GETPC()); in helper_fadd_d()
111 uint64_t helper_fsub_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fsub_s() argument
115 fd = nanbox_s(float32_sub((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fsub_s()
116 update_fcsr0(env, GETPC()); in helper_fsub_s()
120 uint64_t helper_fsub_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fsub_d() argument
124 fd = float64_sub(fj, fk, &env->fp_status); in helper_fsub_d()
125 update_fcsr0(env, GETPC()); in helper_fsub_d()
129 uint64_t helper_fmul_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmul_s() argument
133 fd = nanbox_s(float32_mul((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fmul_s()
134 update_fcsr0(env, GETPC()); in helper_fmul_s()
138 uint64_t helper_fmul_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmul_d() argument
142 fd = float64_mul(fj, fk, &env->fp_status); in helper_fmul_d()
143 update_fcsr0(env, GETPC()); in helper_fmul_d()
147 uint64_t helper_fdiv_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fdiv_s() argument
151 fd = nanbox_s(float32_div((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fdiv_s()
152 update_fcsr0(env, GETPC()); in helper_fdiv_s()
156 uint64_t helper_fdiv_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fdiv_d() argument
160 fd = float64_div(fj, fk, &env->fp_status); in helper_fdiv_d()
161 update_fcsr0(env, GETPC()); in helper_fdiv_d()
165 uint64_t helper_fmax_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmax_s() argument
169 fd = nanbox_s(float32_maxnum((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fmax_s()
170 update_fcsr0(env, GETPC()); in helper_fmax_s()
174 uint64_t helper_fmax_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmax_d() argument
178 fd = float64_maxnum(fj, fk, &env->fp_status); in helper_fmax_d()
179 update_fcsr0(env, GETPC()); in helper_fmax_d()
183 uint64_t helper_fmin_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmin_s() argument
187 fd = nanbox_s(float32_minnum((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fmin_s()
188 update_fcsr0(env, GETPC()); in helper_fmin_s()
192 uint64_t helper_fmin_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmin_d() argument
196 fd = float64_minnum(fj, fk, &env->fp_status); in helper_fmin_d()
197 update_fcsr0(env, GETPC()); in helper_fmin_d()
201 uint64_t helper_fmaxa_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmaxa_s() argument
206 (uint32_t)fk, &env->fp_status)); in helper_fmaxa_s()
207 update_fcsr0(env, GETPC()); in helper_fmaxa_s()
211 uint64_t helper_fmaxa_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmaxa_d() argument
215 fd = float64_maxnummag(fj, fk, &env->fp_status); in helper_fmaxa_d()
216 update_fcsr0(env, GETPC()); in helper_fmaxa_d()
220 uint64_t helper_fmina_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmina_s() argument
225 (uint32_t)fk, &env->fp_status)); in helper_fmina_s()
226 update_fcsr0(env, GETPC()); in helper_fmina_s()
230 uint64_t helper_fmina_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fmina_d() argument
234 fd = float64_minnummag(fj, fk, &env->fp_status); in helper_fmina_d()
235 update_fcsr0(env, GETPC()); in helper_fmina_d()
239 uint64_t helper_fscaleb_s(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fscaleb_s() argument
247 &env->fp_status)); in helper_fscaleb_s()
248 update_fcsr0(env, GETPC()); in helper_fscaleb_s()
252 uint64_t helper_fscaleb_d(CPULoongArchState *env, uint64_t fj, uint64_t fk) in helper_fscaleb_d() argument
260 &env->fp_status); in helper_fscaleb_d()
261 update_fcsr0(env, GETPC()); in helper_fscaleb_d()
265 uint64_t helper_fsqrt_s(CPULoongArchState *env, uint64_t fj) in helper_fsqrt_s() argument
269 fd = nanbox_s(float32_sqrt((uint32_t)fj, &env->fp_status)); in helper_fsqrt_s()
270 update_fcsr0(env, GETPC()); in helper_fsqrt_s()
274 uint64_t helper_fsqrt_d(CPULoongArchState *env, uint64_t fj) in helper_fsqrt_d() argument
278 fd = float64_sqrt(fj, &env->fp_status); in helper_fsqrt_d()
279 update_fcsr0(env, GETPC()); in helper_fsqrt_d()
283 uint64_t helper_frecip_s(CPULoongArchState *env, uint64_t fj) in helper_frecip_s() argument
287 fd = nanbox_s(float32_div(float32_one, (uint32_t)fj, &env->fp_status)); in helper_frecip_s()
288 update_fcsr0(env, GETPC()); in helper_frecip_s()
292 uint64_t helper_frecip_d(CPULoongArchState *env, uint64_t fj) in helper_frecip_d() argument
296 fd = float64_div(float64_one, fj, &env->fp_status); in helper_frecip_d()
297 update_fcsr0(env, GETPC()); in helper_frecip_d()
301 uint64_t helper_frsqrt_s(CPULoongArchState *env, uint64_t fj) in helper_frsqrt_s() argument
306 fp = float32_sqrt((uint32_t)fj, &env->fp_status); in helper_frsqrt_s()
307 fd = nanbox_s(float32_div(float32_one, fp, &env->fp_status)); in helper_frsqrt_s()
308 update_fcsr0(env, GETPC()); in helper_frsqrt_s()
312 uint64_t helper_frsqrt_d(CPULoongArchState *env, uint64_t fj) in helper_frsqrt_d() argument
316 fp = float64_sqrt(fj, &env->fp_status); in helper_frsqrt_d()
317 fd = float64_div(float64_one, fp, &env->fp_status); in helper_frsqrt_d()
318 update_fcsr0(env, GETPC()); in helper_frsqrt_d()
322 uint64_t helper_flogb_s(CPULoongArchState *env, uint64_t fj) in helper_flogb_s() argument
326 float_status *status = &env->fp_status; in helper_flogb_s()
333 update_fcsr0_mask(env, GETPC(), float_flag_inexact); in helper_flogb_s()
337 uint64_t helper_flogb_d(CPULoongArchState *env, uint64_t fj) in helper_flogb_d() argument
340 float_status *status = &env->fp_status; in helper_flogb_d()
347 update_fcsr0_mask(env, GETPC(), float_flag_inexact); in helper_flogb_d()
351 uint64_t helper_fclass_s(CPULoongArchState *env, uint64_t fj) in helper_fclass_s() argument
363 return float32_is_quiet_nan(f, &env->fp_status) ? 1 << 1 : 1 << 0; in helper_fclass_s()
369 uint64_t helper_fclass_d(CPULoongArchState *env, uint64_t fj) in helper_fclass_d() argument
381 return float64_is_quiet_nan(f, &env->fp_status) ? 1 << 1 : 1 << 0; in helper_fclass_d()
387 uint64_t helper_fmuladd_s(CPULoongArchState *env, uint64_t fj, in helper_fmuladd_s() argument
393 (uint32_t)fa, flag, &env->fp_status)); in helper_fmuladd_s()
394 update_fcsr0(env, GETPC()); in helper_fmuladd_s()
398 uint64_t helper_fmuladd_d(CPULoongArchState *env, uint64_t fj, in helper_fmuladd_d() argument
403 fd = float64_muladd(fj, fk, fa, flag, &env->fp_status); in helper_fmuladd_d()
404 update_fcsr0(env, GETPC()); in helper_fmuladd_d()
408 static uint64_t fcmp_common(CPULoongArchState *env, FloatRelation cmp, in fcmp_common() argument
429 update_fcsr0(env, GETPC()); in fcmp_common()
435 uint64_t helper_fcmp_c_s(CPULoongArchState *env, uint64_t fj, in helper_fcmp_c_s() argument
439 (uint32_t)fk, &env->fp_status); in helper_fcmp_c_s()
440 return fcmp_common(env, cmp, flags); in helper_fcmp_c_s()
444 uint64_t helper_fcmp_s_s(CPULoongArchState *env, uint64_t fj, in helper_fcmp_s_s() argument
448 (uint32_t)fk, &env->fp_status); in helper_fcmp_s_s()
449 return fcmp_common(env, cmp, flags); in helper_fcmp_s_s()
453 uint64_t helper_fcmp_c_d(CPULoongArchState *env, uint64_t fj, in helper_fcmp_c_d() argument
456 FloatRelation cmp = float64_compare_quiet(fj, fk, &env->fp_status); in helper_fcmp_c_d()
457 return fcmp_common(env, cmp, flags); in helper_fcmp_c_d()
461 uint64_t helper_fcmp_s_d(CPULoongArchState *env, uint64_t fj, in helper_fcmp_s_d() argument
464 FloatRelation cmp = float64_compare(fj, fk, &env->fp_status); in helper_fcmp_s_d()
465 return fcmp_common(env, cmp, flags); in helper_fcmp_s_d()
469 uint64_t helper_fcvt_s_d(CPULoongArchState *env, uint64_t fj) in helper_fcvt_s_d() argument
473 fd = nanbox_s(float64_to_float32(fj, &env->fp_status)); in helper_fcvt_s_d()
474 update_fcsr0(env, GETPC()); in helper_fcvt_s_d()
478 uint64_t helper_fcvt_d_s(CPULoongArchState *env, uint64_t fj) in helper_fcvt_d_s() argument
482 fd = float32_to_float64((uint32_t)fj, &env->fp_status); in helper_fcvt_d_s()
483 update_fcsr0(env, GETPC()); in helper_fcvt_d_s()
487 uint64_t helper_ffint_s_w(CPULoongArchState *env, uint64_t fj) in helper_ffint_s_w() argument
491 fd = nanbox_s(int32_to_float32((int32_t)fj, &env->fp_status)); in helper_ffint_s_w()
492 update_fcsr0(env, GETPC()); in helper_ffint_s_w()
496 uint64_t helper_ffint_s_l(CPULoongArchState *env, uint64_t fj) in helper_ffint_s_l() argument
500 fd = nanbox_s(int64_to_float32(fj, &env->fp_status)); in helper_ffint_s_l()
501 update_fcsr0(env, GETPC()); in helper_ffint_s_l()
505 uint64_t helper_ffint_d_w(CPULoongArchState *env, uint64_t fj) in helper_ffint_d_w() argument
509 fd = int32_to_float64((int32_t)fj, &env->fp_status); in helper_ffint_d_w()
510 update_fcsr0(env, GETPC()); in helper_ffint_d_w()
514 uint64_t helper_ffint_d_l(CPULoongArchState *env, uint64_t fj) in helper_ffint_d_l() argument
518 fd = int64_to_float64(fj, &env->fp_status); in helper_ffint_d_l()
519 update_fcsr0(env, GETPC()); in helper_ffint_d_l()
523 uint64_t helper_frint_s(CPULoongArchState *env, uint64_t fj) in helper_frint_s() argument
527 fd = (uint64_t)(float32_round_to_int((uint32_t)fj, &env->fp_status)); in helper_frint_s()
528 update_fcsr0(env, GETPC()); in helper_frint_s()
532 uint64_t helper_frint_d(CPULoongArchState *env, uint64_t fj) in helper_frint_d() argument
536 fd = float64_round_to_int(fj, &env->fp_status); in helper_frint_d()
537 update_fcsr0(env, GETPC()); in helper_frint_d()
541 uint64_t helper_ftintrm_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrm_l_d() argument
544 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrm_l_d()
546 set_float_rounding_mode(float_round_down, &env->fp_status); in helper_ftintrm_l_d()
547 fd = float64_to_int64(fj, &env->fp_status); in helper_ftintrm_l_d()
548 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrm_l_d()
550 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrm_l_d()
555 update_fcsr0(env, GETPC()); in helper_ftintrm_l_d()
559 uint64_t helper_ftintrm_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrm_l_s() argument
562 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrm_l_s()
564 set_float_rounding_mode(float_round_down, &env->fp_status); in helper_ftintrm_l_s()
565 fd = float32_to_int64((uint32_t)fj, &env->fp_status); in helper_ftintrm_l_s()
566 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrm_l_s()
568 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrm_l_s()
573 update_fcsr0(env, GETPC()); in helper_ftintrm_l_s()
577 uint64_t helper_ftintrm_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrm_w_d() argument
580 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrm_w_d()
582 set_float_rounding_mode(float_round_down, &env->fp_status); in helper_ftintrm_w_d()
583 fd = (uint64_t)float64_to_int32(fj, &env->fp_status); in helper_ftintrm_w_d()
584 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrm_w_d()
586 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrm_w_d()
591 update_fcsr0(env, GETPC()); in helper_ftintrm_w_d()
595 uint64_t helper_ftintrm_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrm_w_s() argument
598 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrm_w_s()
600 set_float_rounding_mode(float_round_down, &env->fp_status); in helper_ftintrm_w_s()
601 fd = (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); in helper_ftintrm_w_s()
602 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrm_w_s()
604 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrm_w_s()
609 update_fcsr0(env, GETPC()); in helper_ftintrm_w_s()
613 uint64_t helper_ftintrp_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrp_l_d() argument
616 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrp_l_d()
618 set_float_rounding_mode(float_round_up, &env->fp_status); in helper_ftintrp_l_d()
619 fd = float64_to_int64(fj, &env->fp_status); in helper_ftintrp_l_d()
620 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrp_l_d()
622 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrp_l_d()
627 update_fcsr0(env, GETPC()); in helper_ftintrp_l_d()
631 uint64_t helper_ftintrp_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrp_l_s() argument
634 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrp_l_s()
636 set_float_rounding_mode(float_round_up, &env->fp_status); in helper_ftintrp_l_s()
637 fd = float32_to_int64((uint32_t)fj, &env->fp_status); in helper_ftintrp_l_s()
638 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrp_l_s()
640 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrp_l_s()
645 update_fcsr0(env, GETPC()); in helper_ftintrp_l_s()
649 uint64_t helper_ftintrp_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrp_w_d() argument
652 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrp_w_d()
654 set_float_rounding_mode(float_round_up, &env->fp_status); in helper_ftintrp_w_d()
655 fd = (uint64_t)float64_to_int32(fj, &env->fp_status); in helper_ftintrp_w_d()
656 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrp_w_d()
658 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrp_w_d()
663 update_fcsr0(env, GETPC()); in helper_ftintrp_w_d()
667 uint64_t helper_ftintrp_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrp_w_s() argument
670 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrp_w_s()
672 set_float_rounding_mode(float_round_up, &env->fp_status); in helper_ftintrp_w_s()
673 fd = (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); in helper_ftintrp_w_s()
674 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrp_w_s()
676 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrp_w_s()
681 update_fcsr0(env, GETPC()); in helper_ftintrp_w_s()
685 uint64_t helper_ftintrz_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrz_l_d() argument
688 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrz_l_d()
690 fd = float64_to_int64_round_to_zero(fj, &env->fp_status); in helper_ftintrz_l_d()
691 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrz_l_d()
693 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrz_l_d()
698 update_fcsr0(env, GETPC()); in helper_ftintrz_l_d()
702 uint64_t helper_ftintrz_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrz_l_s() argument
705 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrz_l_s()
707 fd = float32_to_int64_round_to_zero((uint32_t)fj, &env->fp_status); in helper_ftintrz_l_s()
708 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrz_l_s()
710 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrz_l_s()
715 update_fcsr0(env, GETPC()); in helper_ftintrz_l_s()
719 uint64_t helper_ftintrz_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrz_w_d() argument
722 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrz_w_d()
724 fd = (uint64_t)float64_to_int32_round_to_zero(fj, &env->fp_status); in helper_ftintrz_w_d()
725 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrz_w_d()
727 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrz_w_d()
732 update_fcsr0(env, GETPC()); in helper_ftintrz_w_d()
736 uint64_t helper_ftintrz_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrz_w_s() argument
739 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrz_w_s()
741 fd = float32_to_int32_round_to_zero((uint32_t)fj, &env->fp_status); in helper_ftintrz_w_s()
742 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrz_w_s()
744 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrz_w_s()
749 update_fcsr0(env, GETPC()); in helper_ftintrz_w_s()
753 uint64_t helper_ftintrne_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrne_l_d() argument
756 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrne_l_d()
758 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ftintrne_l_d()
759 fd = float64_to_int64(fj, &env->fp_status); in helper_ftintrne_l_d()
760 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrne_l_d()
762 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrne_l_d()
767 update_fcsr0(env, GETPC()); in helper_ftintrne_l_d()
771 uint64_t helper_ftintrne_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrne_l_s() argument
774 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrne_l_s()
776 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ftintrne_l_s()
777 fd = float32_to_int64((uint32_t)fj, &env->fp_status); in helper_ftintrne_l_s()
778 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrne_l_s()
780 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrne_l_s()
785 update_fcsr0(env, GETPC()); in helper_ftintrne_l_s()
789 uint64_t helper_ftintrne_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftintrne_w_d() argument
792 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrne_w_d()
794 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ftintrne_w_d()
795 fd = (uint64_t)float64_to_int32(fj, &env->fp_status); in helper_ftintrne_w_d()
796 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrne_w_d()
798 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrne_w_d()
803 update_fcsr0(env, GETPC()); in helper_ftintrne_w_d()
807 uint64_t helper_ftintrne_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftintrne_w_s() argument
810 FloatRoundMode old_mode = get_float_rounding_mode(&env->fp_status); in helper_ftintrne_w_s()
812 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ftintrne_w_s()
813 fd = float32_to_int32((uint32_t)fj, &env->fp_status); in helper_ftintrne_w_s()
814 set_float_rounding_mode(old_mode, &env->fp_status); in helper_ftintrne_w_s()
816 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftintrne_w_s()
821 update_fcsr0(env, GETPC()); in helper_ftintrne_w_s()
825 uint64_t helper_ftint_l_d(CPULoongArchState *env, uint64_t fj) in helper_ftint_l_d() argument
829 fd = float64_to_int64(fj, &env->fp_status); in helper_ftint_l_d()
830 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftint_l_d()
835 update_fcsr0(env, GETPC()); in helper_ftint_l_d()
839 uint64_t helper_ftint_l_s(CPULoongArchState *env, uint64_t fj) in helper_ftint_l_s() argument
843 fd = float32_to_int64((uint32_t)fj, &env->fp_status); in helper_ftint_l_s()
844 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftint_l_s()
849 update_fcsr0(env, GETPC()); in helper_ftint_l_s()
853 uint64_t helper_ftint_w_s(CPULoongArchState *env, uint64_t fj) in helper_ftint_w_s() argument
857 fd = (uint64_t)float32_to_int32((uint32_t)fj, &env->fp_status); in helper_ftint_w_s()
858 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftint_w_s()
863 update_fcsr0(env, GETPC()); in helper_ftint_w_s()
867 uint64_t helper_ftint_w_d(CPULoongArchState *env, uint64_t fj) in helper_ftint_w_d() argument
871 fd = (uint64_t)float64_to_int32(fj, &env->fp_status); in helper_ftint_w_d()
872 if (get_float_exception_flags(&env->fp_status) & (float_flag_invalid)) { in helper_ftint_w_d()
877 update_fcsr0(env, GETPC()); in helper_ftint_w_d()
881 void helper_set_rounding_mode(CPULoongArchState *env) in helper_set_rounding_mode() argument
883 set_float_rounding_mode(ieee_rm[(env->fcsr0 >> FCSR0_RM) & 0x3], in helper_set_rounding_mode()
884 &env->fp_status); in helper_set_rounding_mode()