Lines Matching +full:64 +full:- +full:bit

23 #include "s390x-internal.h"
25 #include "exec/helper-proto.h"
66 qemu_exc = env->fpu_status.float_exception_flags; in handle_exceptions()
70 env->fpu_status.float_exception_flags = 0; in handle_exceptions()
74 * IEEE-Underflow exception recognition exists if a tininess condition in handle_exceptions()
76 * - The mask bit in the FPC is zero and the result is inexact in handle_exceptions()
77 * - The mask bit in the FPC is one in handle_exceptions()
79 * underflow action in case the mask bit is not one. in handle_exceptions()
82 !((env->fpc >> 24) & S390_IEEE_MASK_UNDERFLOW)) { in handle_exceptions()
93 * triggering the trap - impossible right now. in handle_exceptions()
102 if (s390_exc & ~S390_IEEE_MASK_INEXACT & env->fpc >> 24) { in handle_exceptions()
103 /* trap condition - inexact reported along */ in handle_exceptions()
106 /* nontrap condition - inexact handled differently */ in handle_exceptions()
107 env->fpc |= (s390_exc & ~S390_IEEE_MASK_INEXACT) << 16; in handle_exceptions()
112 /* trap condition - overflow/underflow _not_ reported along */ in handle_exceptions()
113 if (s390_exc & S390_IEEE_MASK_INEXACT & env->fpc >> 24) { in handle_exceptions()
118 env->fpc |= (s390_exc & S390_IEEE_MASK_INEXACT) << 16; in handle_exceptions()
181 if (stat->float_exception_flags & float_flag_invalid) { in set_cc_conv_f32()
190 if (stat->float_exception_flags & float_flag_invalid) { in set_cc_conv_f64()
199 if (stat->float_exception_flags & float_flag_invalid) { in set_cc_conv_f128()
213 /* XxC is bit 1 of m4 */ in xxc_from_m34()
214 return extract32(m34, 4 + 3 - 1, 1); in xxc_from_m34()
217 /* 32-bit FP addition */
220 float32 ret = float32_add(f1, f2, &env->fpu_status); in HELPER()
225 /* 64-bit FP addition */
228 float64 ret = float64_add(f1, f2, &env->fpu_status); in HELPER()
233 /* 128-bit FP addition */
236 float128 ret = float128_add(ARG128(a), ARG128(b), &env->fpu_status); in HELPER()
241 /* 32-bit FP subtraction */
244 float32 ret = float32_sub(f1, f2, &env->fpu_status); in HELPER()
249 /* 64-bit FP subtraction */
252 float64 ret = float64_sub(f1, f2, &env->fpu_status); in HELPER()
257 /* 128-bit FP subtraction */
260 float128 ret = float128_sub(ARG128(a), ARG128(b), &env->fpu_status); in HELPER()
265 /* 32-bit FP division */
268 float32 ret = float32_div(f1, f2, &env->fpu_status); in HELPER()
273 /* 64-bit FP division */
276 float64 ret = float64_div(f1, f2, &env->fpu_status); in HELPER()
281 /* 128-bit FP division */
284 float128 ret = float128_div(ARG128(a), ARG128(b), &env->fpu_status); in HELPER()
289 /* 32-bit FP multiplication */
292 float32 ret = float32_mul(f1, f2, &env->fpu_status); in HELPER()
297 /* 64-bit FP multiplication */
300 float64 ret = float64_mul(f1, f2, &env->fpu_status); in HELPER()
305 /* 64/32-bit FP multiplication */
308 float64 f1_64 = float32_to_float64(f1, &env->fpu_status); in HELPER()
309 float64 ret = float32_to_float64(f2, &env->fpu_status); in HELPER()
310 ret = float64_mul(f1_64, ret, &env->fpu_status); in HELPER()
315 /* 128-bit FP multiplication */
318 float128 ret = float128_mul(ARG128(a), ARG128(b), &env->fpu_status); in HELPER()
323 /* 128/64-bit FP multiplication */
326 float128 f1_128 = float64_to_float128(f1, &env->fpu_status); in HELPER()
327 float128 ret = float64_to_float128(f2, &env->fpu_status); in HELPER()
328 ret = float128_mul(f1_128, ret, &env->fpu_status); in HELPER()
333 /* convert 32-bit float to 64-bit float */
336 float64 ret = float32_to_float64(f2, &env->fpu_status); in HELPER()
341 /* convert 128-bit float to 64-bit float */
345 float64 ret = float128_to_float64(ARG128(a), &env->fpu_status); in HELPER()
352 /* convert 64-bit float to 128-bit float */
355 float128 ret = float64_to_float128(f2, &env->fpu_status); in HELPER()
360 /* convert 32-bit float to 128-bit float */
363 float128 ret = float32_to_float128(f2, &env->fpu_status); in HELPER()
368 /* convert 64-bit float to 32-bit float */
372 float32 ret = float64_to_float32(f2, &env->fpu_status); in HELPER()
379 /* convert 128-bit float to 32-bit float */
383 float32 ret = float128_to_float32(ARG128(a), &env->fpu_status); in HELPER()
390 /* 32-bit FP compare */
393 FloatRelation cmp = float32_compare_quiet(f1, f2, &env->fpu_status); in HELPER()
398 /* 64-bit FP compare */
401 FloatRelation cmp = float64_compare_quiet(f1, f2, &env->fpu_status); in HELPER()
406 /* 128-bit FP compare */
410 &env->fpu_status); in HELPER()
417 int ret = env->fpu_status.float_rounding_mode; in s390_swap_bfp_rounding_mode()
425 set_float_rounding_mode(float_round_ties_away, &env->fpu_status); in s390_swap_bfp_rounding_mode()
429 set_float_rounding_mode(float_round_to_odd, &env->fpu_status); in s390_swap_bfp_rounding_mode()
433 set_float_rounding_mode(float_round_nearest_even, &env->fpu_status); in s390_swap_bfp_rounding_mode()
437 set_float_rounding_mode(float_round_to_zero, &env->fpu_status); in s390_swap_bfp_rounding_mode()
441 set_float_rounding_mode(float_round_up, &env->fpu_status); in s390_swap_bfp_rounding_mode()
444 /* round to -inf */ in s390_swap_bfp_rounding_mode()
445 set_float_rounding_mode(float_round_down, &env->fpu_status); in s390_swap_bfp_rounding_mode()
455 set_float_rounding_mode(old_mode, &env->fpu_status); in s390_restore_bfp_rounding_mode()
458 /* convert 64-bit int to 32-bit float */
462 float32 ret = int64_to_float32(v2, &env->fpu_status); in HELPER()
469 /* convert 64-bit int to 64-bit float */
473 float64 ret = int64_to_float64(v2, &env->fpu_status); in HELPER()
480 /* convert 64-bit int to 128-bit float */
484 float128 ret = int64_to_float128(v2, &env->fpu_status); in HELPER()
491 /* convert 64-bit uint to 32-bit float */
495 float32 ret = uint64_to_float32(v2, &env->fpu_status); in HELPER()
502 /* convert 64-bit uint to 64-bit float */
506 float64 ret = uint64_to_float64(v2, &env->fpu_status); in HELPER()
513 /* convert 64-bit uint to 128-bit float */
517 float128 ret = uint64_to_float128(v2, &env->fpu_status); in HELPER()
524 /* convert 32-bit float to 64-bit int */
528 int64_t ret = float32_to_int64(v2, &env->fpu_status); in HELPER()
529 uint32_t cc = set_cc_conv_f32(v2, &env->fpu_status); in HELPER()
533 env->cc_op = cc; in HELPER()
540 /* convert 64-bit float to 64-bit int */
544 int64_t ret = float64_to_int64(v2, &env->fpu_status); in HELPER()
545 uint32_t cc = set_cc_conv_f64(v2, &env->fpu_status); in HELPER()
549 env->cc_op = cc; in HELPER()
556 /* convert 128-bit float to 64-bit int */
561 int64_t ret = float128_to_int64(v2, &env->fpu_status); in HELPER()
562 uint32_t cc = set_cc_conv_f128(v2, &env->fpu_status); in HELPER()
566 env->cc_op = cc; in HELPER()
573 /* convert 32-bit float to 32-bit int */
577 int32_t ret = float32_to_int32(v2, &env->fpu_status); in HELPER()
578 uint32_t cc = set_cc_conv_f32(v2, &env->fpu_status); in HELPER()
582 env->cc_op = cc; in HELPER()
589 /* convert 64-bit float to 32-bit int */
593 int32_t ret = float64_to_int32(v2, &env->fpu_status); in HELPER()
594 uint32_t cc = set_cc_conv_f64(v2, &env->fpu_status); in HELPER()
598 env->cc_op = cc; in HELPER()
605 /* convert 128-bit float to 32-bit int */
610 int32_t ret = float128_to_int32(v2, &env->fpu_status); in HELPER()
611 uint32_t cc = set_cc_conv_f128(v2, &env->fpu_status); in HELPER()
615 env->cc_op = cc; in HELPER()
622 /* convert 32-bit float to 64-bit uint */
626 uint64_t ret = float32_to_uint64(v2, &env->fpu_status); in HELPER()
627 uint32_t cc = set_cc_conv_f32(v2, &env->fpu_status); in HELPER()
631 env->cc_op = cc; in HELPER()
638 /* convert 64-bit float to 64-bit uint */
642 uint64_t ret = float64_to_uint64(v2, &env->fpu_status); in HELPER()
643 uint32_t cc = set_cc_conv_f64(v2, &env->fpu_status); in HELPER()
647 env->cc_op = cc; in HELPER()
654 /* convert 128-bit float to 64-bit uint */
659 uint64_t ret = float128_to_uint64(v2, &env->fpu_status); in HELPER()
660 uint32_t cc = set_cc_conv_f128(v2, &env->fpu_status); in HELPER()
664 env->cc_op = cc; in HELPER()
671 /* convert 32-bit float to 32-bit uint */
675 uint32_t ret = float32_to_uint32(v2, &env->fpu_status); in HELPER()
676 uint32_t cc = set_cc_conv_f32(v2, &env->fpu_status); in HELPER()
680 env->cc_op = cc; in HELPER()
687 /* convert 64-bit float to 32-bit uint */
691 uint32_t ret = float64_to_uint32(v2, &env->fpu_status); in HELPER()
692 uint32_t cc = set_cc_conv_f64(v2, &env->fpu_status); in HELPER()
696 env->cc_op = cc; in HELPER()
703 /* convert 128-bit float to 32-bit uint */
708 uint32_t ret = float128_to_uint32(v2, &env->fpu_status); in HELPER()
709 uint32_t cc = set_cc_conv_f128(v2, &env->fpu_status); in HELPER()
713 env->cc_op = cc; in HELPER()
720 /* round to integer 32-bit */
724 float32 ret = float32_round_to_int(f2, &env->fpu_status); in HELPER()
731 /* round to integer 64-bit */
735 float64 ret = float64_round_to_int(f2, &env->fpu_status); in HELPER()
742 /* round to integer 128-bit */
746 float128 ret = float128_round_to_int(ARG128(a), &env->fpu_status); in HELPER()
753 /* 32-bit FP compare and signal */
756 FloatRelation cmp = float32_compare(f1, f2, &env->fpu_status); in HELPER()
761 /* 64-bit FP compare and signal */
764 FloatRelation cmp = float64_compare(f1, f2, &env->fpu_status); in HELPER()
769 /* 128-bit FP compare and signal */
773 &env->fpu_status); in HELPER()
778 /* 32-bit FP multiply and add */
782 float32 ret = float32_muladd(f3, f2, f1, 0, &env->fpu_status); in HELPER()
787 /* 64-bit FP multiply and add */
791 float64 ret = float64_muladd(f3, f2, f1, 0, &env->fpu_status); in HELPER()
796 /* 32-bit FP multiply and subtract */
801 &env->fpu_status); in HELPER()
806 /* 64-bit FP multiply and subtract */
811 &env->fpu_status); in HELPER()
816 /* The rightmost bit has the number 11. */
817 static inline uint16_t dcmask(int bit, bool neg) in dcmask() argument
819 return 1 << (11 - bit - neg); in dcmask()
827 /* Sorted by most common cases - only one class is possible */ \
836 } else if (_TYPE##_is_quiet_nan(f1, &env->fpu_status)) { \
846 /* test data class 32-bit */ in DEF_FLOAT_DCMASK()
852 /* test data class 64-bit */
858 /* test data class 128-bit */
864 /* square root 32-bit */
867 float32 ret = float32_sqrt(f2, &env->fpu_status); in HELPER()
872 /* square root 64-bit */
875 float64 ret = float64_sqrt(f2, &env->fpu_status); in HELPER()
880 /* square root 128-bit */
883 float128 ret = float128_sqrt(ARG128(a), &env->fpu_status); in HELPER()
893 -1,
894 -1,
895 -1,
902 if (fpc_to_rnd[fpc & 0x7] == -1 || fpc & 0x03030088u || in HELPER()
908 env->fpc = fpc; in HELPER()
911 set_float_rounding_mode(fpc_to_rnd[fpc & 0x7], &env->fpu_status); in HELPER()
917 uint32_t signalling = env->fpc; in HELPER()
920 if (fpc_to_rnd[fpc & 0x7] == -1 || fpc & 0x03030088u || in HELPER()
929 env->fpc = fpc | (signalling & 0x00ff0000); in HELPER()
930 set_float_rounding_mode(fpc_to_rnd[fpc & 0x7], &env->fpu_status); in HELPER()
934 * simulated-iee-exception exception occurs. in HELPER()
958 if (rnd > 0x7 || fpc_to_rnd[rnd & 0x7] == -1) { in HELPER()
962 env->fpc = deposit32(env->fpc, 0, 3, rnd); in HELPER()
963 set_float_rounding_mode(fpc_to_rnd[rnd & 0x7], &env->fpu_status); in HELPER()