Lines Matching +full:0 +full:x3ffc
40 #define FPU_RC_NEAR 0x000
41 #define FPU_RC_DOWN 0x400
42 #define FPU_RC_UP 0x800
43 #define FPU_RC_CHOP 0xc00
48 #define MAXEXPD 0x7fff
50 #define EXPD(fp) (fp.l.upper & 0x7fff)
51 #define SIGND(fp) ((fp.l.upper) & 0x8000)
53 #define BIASEXPONENT(fp) fp.l.upper = (fp.l.upper & ~(0x7fff)) | EXPBIAS
55 #define FPUS_IE (1 << 0)
65 #define FPUC_EM 0x3f
67 #define floatx80_lg2 make_floatx80(0x3ffd, 0x9a209a84fbcff799LL)
68 #define floatx80_lg2_d make_floatx80(0x3ffd, 0x9a209a84fbcff798LL)
69 #define floatx80_l2e make_floatx80(0x3fff, 0xb8aa3b295c17f0bcLL)
70 #define floatx80_l2e_d make_floatx80(0x3fff, 0xb8aa3b295c17f0bbLL)
71 #define floatx80_l2t make_floatx80(0x4000, 0xd49a784bcd1b8afeLL)
72 #define floatx80_l2t_u make_floatx80(0x4000, 0xd49a784bcd1b8affLL)
73 #define floatx80_ln2_d make_floatx80(0x3ffe, 0xb17217f7d1cf79abLL)
74 #define floatx80_pi_d make_floatx80(0x4000, 0xc90fdaa22168c234LL)
79 env->fptags[env->fpstt] = 0; /* validate stack entry */ in fpush()
172 * for these "unsupported" NaN and Inf values, like "NaN * 0 == 0".) in cpu_init_fp_statuses()
179 * specified -- for 0 * inf + NaN the input NaN is selected, and if in cpu_init_fp_statuses()
181 * We also do not raise Invalid for the 0 * inf + (Q)NaN case. in cpu_init_fp_statuses()
188 set_float_default_nan_pattern(0b11000000, &env->fp_status); in cpu_init_fp_statuses()
189 set_float_default_nan_pattern(0b11000000, &env->mmx_status); in cpu_init_fp_statuses()
190 set_float_default_nan_pattern(0b11000000, &env->sse_status); in cpu_init_fp_statuses()
204 set_float_exception_flags(0, &env->fp_status); in save_exception_flags()
213 ((new_flags & float_flag_invalid ? FPUS_IE : 0) | in merge_exception_flags()
214 (new_flags & float_flag_divbyzero ? FPUS_ZE : 0) | in merge_exception_flags()
215 (new_flags & float_flag_overflow ? FPUS_OE : 0) | in merge_exception_flags()
216 (new_flags & float_flag_underflow ? FPUS_UE : 0) | in merge_exception_flags()
217 (new_flags & float_flag_inexact ? FPUS_PE : 0) | in merge_exception_flags()
218 (new_flags & float_flag_input_denormal_flushed ? FPUS_DE : 0))); in merge_exception_flags()
231 if (env->cr[0] & CR0_NE_MASK) { in fpu_raise_exception()
285 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_flds_ST0()
302 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_fldl_ST0()
321 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_fildl_ST0()
334 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_fildll_ST0()
386 val = 0x80000000; in helper_fistl_ST0()
399 val = 0x8000000000000000ULL; in helper_fistll_ST0()
426 val = 0x80000000; in helper_fisttl_ST0()
439 val = 0x8000000000000000ULL; in helper_fisttll_ST0()
455 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_fldt_ST0()
479 env->fpus &= ~0x4700; in helper_fdecstp()
485 env->fpus &= ~0x4700; in helper_fincstp()
526 static const int fcom_ccval[4] = {0x0100, 0x4000, 0x0000, 0x4500};
534 env->fpus = (env->fpus & ~0x4500) | fcom_ccval[ret + 1]; in helper_fcom_ST0_FT0()
544 env->fpus = (env->fpus & ~0x4500) | fcom_ccval[ret + 1]; in helper_fucom_ST0_FT0()
548 static const int fcomi_ccval[4] = {CC_C, CC_Z, 0, CC_Z | CC_P | CC_C};
752 return (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; in helper_fnstsw()
782 case 0: in update_fp_status()
803 env->fpus &= 0x7f00; in helper_fclex()
815 env->fpus = 0; in do_fninit()
816 env->fpstt = 0; in do_fninit()
817 env->fpcs = 0; in do_fninit()
818 env->fpds = 0; in do_fninit()
819 env->fpip = 0; in do_fninit()
820 env->fpdp = 0; in do_fninit()
821 cpu_set_fpuc(env, 0x37f); in do_fninit()
822 env->fptags[0] = 1; in do_fninit()
849 val = 0; in helper_fbld_ST0()
850 for (i = 8; i >= 0; i--) { in helper_fbld_ST0()
852 val = (val * 100) + ((v >> 4) * 10) + (v & 0xf); in helper_fbld_ST0()
855 if (access_ldb(&ac, ptr + 9) & 0x80) { in helper_fbld_ST0()
879 access_stb(&ac, mem_ref++, 0); in helper_fbst_ST0()
881 access_stb(&ac, mem_ref++, 0xc0); in helper_fbst_ST0()
882 access_stb(&ac, mem_ref++, 0xff); in helper_fbst_ST0()
883 access_stb(&ac, mem_ref++, 0xff); in helper_fbst_ST0()
889 access_stb(&ac, mem_end, 0x80); in helper_fbst_ST0()
892 access_stb(&ac, mem_end, 0x00); in helper_fbst_ST0()
895 if (val == 0) { in helper_fbst_ST0()
904 access_stb(&ac, mem_ref++, 0); in helper_fbst_ST0()
910 #define ln2_sig_high 0xb17217f7d1cf79abULL
911 #define ln2_sig_low 0xc9e3b39803f2f6afULL
917 #define f2xm1_coeff_0 make_floatx80(0x3ffe, 0xb17217f7d1cf79acULL)
918 #define f2xm1_coeff_0_low make_floatx80(0xbfbc, 0xd87edabf495b3762ULL)
919 #define f2xm1_coeff_1 make_floatx80(0x3ffc, 0xf5fdeffc162c7543ULL)
920 #define f2xm1_coeff_2 make_floatx80(0x3ffa, 0xe35846b82505fcc7ULL)
921 #define f2xm1_coeff_3 make_floatx80(0x3ff8, 0x9d955b7dd273b899ULL)
922 #define f2xm1_coeff_4 make_floatx80(0x3ff5, 0xaec3ff3c4ef4ac0cULL)
923 #define f2xm1_coeff_5 make_floatx80(0x3ff2, 0xa184897c3a7f0de9ULL)
924 #define f2xm1_coeff_6 make_floatx80(0x3fee, 0xffe634d0ec30d504ULL)
925 #define f2xm1_coeff_7 make_floatx80(0x3feb, 0xb160111d2db515e4ULL)
940 { make_floatx80_init(0xbfff, 0x8000000000000000ULL),
941 make_floatx80_init(0x3ffe, 0x8000000000000000ULL),
942 make_floatx80_init(0xbffe, 0x8000000000000000ULL) },
943 { make_floatx80_init(0xbffe, 0xf800000000002e7eULL),
944 make_floatx80_init(0x3ffe, 0x82cd8698ac2b9160ULL),
945 make_floatx80_init(0xbffd, 0xfa64f2cea7a8dd40ULL) },
946 { make_floatx80_init(0xbffe, 0xefffffffffffe960ULL),
947 make_floatx80_init(0x3ffe, 0x85aac367cc488345ULL),
948 make_floatx80_init(0xbffd, 0xf4aa7930676ef976ULL) },
949 { make_floatx80_init(0xbffe, 0xe800000000006f10ULL),
950 make_floatx80_init(0x3ffe, 0x88980e8092da5c14ULL),
951 make_floatx80_init(0xbffd, 0xeecfe2feda4b47d8ULL) },
952 { make_floatx80_init(0xbffe, 0xe000000000008a45ULL),
953 make_floatx80_init(0x3ffe, 0x8b95c1e3ea8ba2a5ULL),
954 make_floatx80_init(0xbffd, 0xe8d47c382ae8bab6ULL) },
955 { make_floatx80_init(0xbffe, 0xd7ffffffffff8a9eULL),
956 make_floatx80_init(0x3ffe, 0x8ea4398b45cd8116ULL),
957 make_floatx80_init(0xbffd, 0xe2b78ce97464fdd4ULL) },
958 { make_floatx80_init(0xbffe, 0xd0000000000019a0ULL),
959 make_floatx80_init(0x3ffe, 0x91c3d373ab11b919ULL),
960 make_floatx80_init(0xbffd, 0xdc785918a9dc8dceULL) },
961 { make_floatx80_init(0xbffe, 0xc7ffffffffff14dfULL),
962 make_floatx80_init(0x3ffe, 0x94f4efa8fef76836ULL),
963 make_floatx80_init(0xbffd, 0xd61620ae02112f94ULL) },
964 { make_floatx80_init(0xbffe, 0xc000000000006530ULL),
965 make_floatx80_init(0x3ffe, 0x9837f0518db87fbbULL),
966 make_floatx80_init(0xbffd, 0xcf901f5ce48f008aULL) },
967 { make_floatx80_init(0xbffe, 0xb7ffffffffff1723ULL),
968 make_floatx80_init(0x3ffe, 0x9b8d39b9d54eb74cULL),
969 make_floatx80_init(0xbffd, 0xc8e58c8c55629168ULL) },
970 { make_floatx80_init(0xbffe, 0xb00000000000b5e1ULL),
971 make_floatx80_init(0x3ffe, 0x9ef5326091a0c366ULL),
972 make_floatx80_init(0xbffd, 0xc2159b3edcbe7934ULL) },
973 { make_floatx80_init(0xbffe, 0xa800000000006f8aULL),
974 make_floatx80_init(0x3ffe, 0xa27043030c49370aULL),
975 make_floatx80_init(0xbffd, 0xbb1f79f9e76d91ecULL) },
976 { make_floatx80_init(0xbffe, 0x9fffffffffff816aULL),
977 make_floatx80_init(0x3ffe, 0xa5fed6a9b15171cfULL),
978 make_floatx80_init(0xbffd, 0xb40252ac9d5d1c62ULL) },
979 { make_floatx80_init(0xbffe, 0x97ffffffffffb621ULL),
980 make_floatx80_init(0x3ffe, 0xa9a15ab4ea7c30e6ULL),
981 make_floatx80_init(0xbffd, 0xacbd4a962b079e34ULL) },
982 { make_floatx80_init(0xbffe, 0x8fffffffffff162bULL),
983 make_floatx80_init(0x3ffe, 0xad583eea42a1b886ULL),
984 make_floatx80_init(0xbffd, 0xa54f822b7abc8ef4ULL) },
985 { make_floatx80_init(0xbffe, 0x87ffffffffff4d34ULL),
986 make_floatx80_init(0x3ffe, 0xb123f581d2ac7b51ULL),
987 make_floatx80_init(0xbffd, 0x9db814fc5aa7095eULL) },
988 { make_floatx80_init(0xbffe, 0x800000000000227dULL),
989 make_floatx80_init(0x3ffe, 0xb504f333f9de539dULL),
990 make_floatx80_init(0xbffd, 0x95f619980c4358c6ULL) },
991 { make_floatx80_init(0xbffd, 0xefffffffffff3978ULL),
992 make_floatx80_init(0x3ffe, 0xb8fbaf4762fbd0a1ULL),
993 make_floatx80_init(0xbffd, 0x8e08a1713a085ebeULL) },
994 { make_floatx80_init(0xbffd, 0xe00000000000df81ULL),
995 make_floatx80_init(0x3ffe, 0xbd08a39f580bfd8cULL),
996 make_floatx80_init(0xbffd, 0x85eeb8c14fe804e8ULL) },
997 { make_floatx80_init(0xbffd, 0xd00000000000bccfULL),
998 make_floatx80_init(0x3ffe, 0xc12c4cca667062f6ULL),
999 make_floatx80_init(0xbffc, 0xfb4eccd6663e7428ULL) },
1000 { make_floatx80_init(0xbffd, 0xc00000000000eff0ULL),
1001 make_floatx80_init(0x3ffe, 0xc5672a1155069abeULL),
1002 make_floatx80_init(0xbffc, 0xea6357baabe59508ULL) },
1003 { make_floatx80_init(0xbffd, 0xb000000000000fe6ULL),
1004 make_floatx80_init(0x3ffe, 0xc9b9bd866e2f234bULL),
1005 make_floatx80_init(0xbffc, 0xd91909e6474372d4ULL) },
1006 { make_floatx80_init(0xbffd, 0x9fffffffffff2172ULL),
1007 make_floatx80_init(0x3ffe, 0xce248c151f84bf00ULL),
1008 make_floatx80_init(0xbffc, 0xc76dcfab81ed0400ULL) },
1009 { make_floatx80_init(0xbffd, 0x8fffffffffffafffULL),
1010 make_floatx80_init(0x3ffe, 0xd2a81d91f12afb2bULL),
1011 make_floatx80_init(0xbffc, 0xb55f89b83b541354ULL) },
1012 { make_floatx80_init(0xbffc, 0xffffffffffff81a3ULL),
1013 make_floatx80_init(0x3ffe, 0xd744fccad69d7d5eULL),
1014 make_floatx80_init(0xbffc, 0xa2ec0cd4a58a0a88ULL) },
1015 { make_floatx80_init(0xbffc, 0xdfffffffffff1568ULL),
1016 make_floatx80_init(0x3ffe, 0xdbfbb797daf25a44ULL),
1017 make_floatx80_init(0xbffc, 0x901121a0943696f0ULL) },
1018 { make_floatx80_init(0xbffc, 0xbfffffffffff68daULL),
1019 make_floatx80_init(0x3ffe, 0xe0ccdeec2a94f811ULL),
1020 make_floatx80_init(0xbffb, 0xf999089eab583f78ULL) },
1021 { make_floatx80_init(0xbffc, 0x9fffffffffff4690ULL),
1022 make_floatx80_init(0x3ffe, 0xe5b906e77c83657eULL),
1023 make_floatx80_init(0xbffb, 0xd237c8c41be4d410ULL) },
1024 { make_floatx80_init(0xbffb, 0xffffffffffff8aeeULL),
1025 make_floatx80_init(0x3ffe, 0xeac0c6e7dd24427cULL),
1026 make_floatx80_init(0xbffb, 0xa9f9c8c116ddec20ULL) },
1027 { make_floatx80_init(0xbffb, 0xbfffffffffff2d18ULL),
1028 make_floatx80_init(0x3ffe, 0xefe4b99bdcdb06ebULL),
1029 make_floatx80_init(0xbffb, 0x80da33211927c8a8ULL) },
1030 { make_floatx80_init(0xbffa, 0xffffffffffff8ccbULL),
1031 make_floatx80_init(0x3ffe, 0xf5257d152486d0f4ULL),
1032 make_floatx80_init(0xbffa, 0xada82eadb792f0c0ULL) },
1033 { make_floatx80_init(0xbff9, 0xffffffffffff11feULL),
1034 make_floatx80_init(0x3ffe, 0xfa83b2db722a0846ULL),
1035 make_floatx80_init(0xbff9, 0xaf89a491babef740ULL) },
1037 make_floatx80_init(0x3fff, 0x8000000000000000ULL),
1039 { make_floatx80_init(0x3ff9, 0xffffffffffff2680ULL),
1040 make_floatx80_init(0x3fff, 0x82cd8698ac2b9f6fULL),
1041 make_floatx80_init(0x3ff9, 0xb361a62b0ae7dbc0ULL) },
1042 { make_floatx80_init(0x3ffb, 0x800000000000b500ULL),
1043 make_floatx80_init(0x3fff, 0x85aac367cc488345ULL),
1044 make_floatx80_init(0x3ffa, 0xb5586cf9891068a0ULL) },
1045 { make_floatx80_init(0x3ffb, 0xbfffffffffff4b67ULL),
1046 make_floatx80_init(0x3fff, 0x88980e8092da7cceULL),
1047 make_floatx80_init(0x3ffb, 0x8980e8092da7cce0ULL) },
1048 { make_floatx80_init(0x3ffb, 0xffffffffffffff57ULL),
1049 make_floatx80_init(0x3fff, 0x8b95c1e3ea8bd6dfULL),
1050 make_floatx80_init(0x3ffb, 0xb95c1e3ea8bd6df0ULL) },
1051 { make_floatx80_init(0x3ffc, 0x9fffffffffff811fULL),
1052 make_floatx80_init(0x3fff, 0x8ea4398b45cd4780ULL),
1053 make_floatx80_init(0x3ffb, 0xea4398b45cd47800ULL) },
1054 { make_floatx80_init(0x3ffc, 0xbfffffffffff9980ULL),
1055 make_floatx80_init(0x3fff, 0x91c3d373ab11b919ULL),
1056 make_floatx80_init(0x3ffc, 0x8e1e9b9d588dc8c8ULL) },
1057 { make_floatx80_init(0x3ffc, 0xdffffffffffff631ULL),
1058 make_floatx80_init(0x3fff, 0x94f4efa8fef70864ULL),
1059 make_floatx80_init(0x3ffc, 0xa7a77d47f7b84320ULL) },
1060 { make_floatx80_init(0x3ffc, 0xffffffffffff2499ULL),
1061 make_floatx80_init(0x3fff, 0x9837f0518db892d4ULL),
1062 make_floatx80_init(0x3ffc, 0xc1bf828c6dc496a0ULL) },
1063 { make_floatx80_init(0x3ffd, 0x8fffffffffff80fbULL),
1064 make_floatx80_init(0x3fff, 0x9b8d39b9d54e3a79ULL),
1065 make_floatx80_init(0x3ffc, 0xdc69cdceaa71d3c8ULL) },
1066 { make_floatx80_init(0x3ffd, 0x9fffffffffffbc23ULL),
1067 make_floatx80_init(0x3fff, 0x9ef5326091a10313ULL),
1068 make_floatx80_init(0x3ffc, 0xf7a993048d081898ULL) },
1069 { make_floatx80_init(0x3ffd, 0xafffffffffff20ecULL),
1070 make_floatx80_init(0x3fff, 0xa27043030c49370aULL),
1071 make_floatx80_init(0x3ffd, 0x89c10c0c3124dc28ULL) },
1072 { make_floatx80_init(0x3ffd, 0xc00000000000fd2cULL),
1073 make_floatx80_init(0x3fff, 0xa5fed6a9b15171cfULL),
1074 make_floatx80_init(0x3ffd, 0x97fb5aa6c545c73cULL) },
1075 { make_floatx80_init(0x3ffd, 0xd0000000000093beULL),
1076 make_floatx80_init(0x3fff, 0xa9a15ab4ea7c30e6ULL),
1077 make_floatx80_init(0x3ffd, 0xa6856ad3a9f0c398ULL) },
1078 { make_floatx80_init(0x3ffd, 0xe00000000000c2aeULL),
1079 make_floatx80_init(0x3fff, 0xad583eea42a17876ULL),
1080 make_floatx80_init(0x3ffd, 0xb560fba90a85e1d8ULL) },
1081 { make_floatx80_init(0x3ffd, 0xefffffffffff1e3fULL),
1082 make_floatx80_init(0x3fff, 0xb123f581d2abef6cULL),
1083 make_floatx80_init(0x3ffd, 0xc48fd6074aafbdb0ULL) },
1084 { make_floatx80_init(0x3ffd, 0xffffffffffff1c23ULL),
1085 make_floatx80_init(0x3fff, 0xb504f333f9de2cadULL),
1086 make_floatx80_init(0x3ffd, 0xd413cccfe778b2b4ULL) },
1087 { make_floatx80_init(0x3ffe, 0x8800000000006344ULL),
1088 make_floatx80_init(0x3fff, 0xb8fbaf4762fbd0a1ULL),
1089 make_floatx80_init(0x3ffd, 0xe3eebd1d8bef4284ULL) },
1090 { make_floatx80_init(0x3ffe, 0x9000000000005d67ULL),
1091 make_floatx80_init(0x3fff, 0xbd08a39f580c668dULL),
1092 make_floatx80_init(0x3ffd, 0xf4228e7d60319a34ULL) },
1093 { make_floatx80_init(0x3ffe, 0x9800000000009127ULL),
1094 make_floatx80_init(0x3fff, 0xc12c4cca6670e042ULL),
1095 make_floatx80_init(0x3ffe, 0x82589994cce1c084ULL) },
1096 { make_floatx80_init(0x3ffe, 0x9fffffffffff06f9ULL),
1097 make_floatx80_init(0x3fff, 0xc5672a11550655c3ULL),
1098 make_floatx80_init(0x3ffe, 0x8ace5422aa0cab86ULL) },
1099 { make_floatx80_init(0x3ffe, 0xa7fffffffffff80dULL),
1100 make_floatx80_init(0x3fff, 0xc9b9bd866e2f234bULL),
1101 make_floatx80_init(0x3ffe, 0x93737b0cdc5e4696ULL) },
1102 { make_floatx80_init(0x3ffe, 0xafffffffffff1470ULL),
1103 make_floatx80_init(0x3fff, 0xce248c151f83fd69ULL),
1104 make_floatx80_init(0x3ffe, 0x9c49182a3f07fad2ULL) },
1105 { make_floatx80_init(0x3ffe, 0xb800000000000e0aULL),
1106 make_floatx80_init(0x3fff, 0xd2a81d91f12aec5cULL),
1107 make_floatx80_init(0x3ffe, 0xa5503b23e255d8b8ULL) },
1108 { make_floatx80_init(0x3ffe, 0xc00000000000b7faULL),
1109 make_floatx80_init(0x3fff, 0xd744fccad69dd630ULL),
1110 make_floatx80_init(0x3ffe, 0xae89f995ad3bac60ULL) },
1111 { make_floatx80_init(0x3ffe, 0xc800000000003aa6ULL),
1112 make_floatx80_init(0x3fff, 0xdbfbb797daf25a44ULL),
1113 make_floatx80_init(0x3ffe, 0xb7f76f2fb5e4b488ULL) },
1114 { make_floatx80_init(0x3ffe, 0xd00000000000a6aeULL),
1115 make_floatx80_init(0x3fff, 0xe0ccdeec2a954685ULL),
1116 make_floatx80_init(0x3ffe, 0xc199bdd8552a8d0aULL) },
1117 { make_floatx80_init(0x3ffe, 0xd800000000004165ULL),
1118 make_floatx80_init(0x3fff, 0xe5b906e77c837155ULL),
1119 make_floatx80_init(0x3ffe, 0xcb720dcef906e2aaULL) },
1120 { make_floatx80_init(0x3ffe, 0xe00000000000582cULL),
1121 make_floatx80_init(0x3fff, 0xeac0c6e7dd24713aULL),
1122 make_floatx80_init(0x3ffe, 0xd5818dcfba48e274ULL) },
1123 { make_floatx80_init(0x3ffe, 0xe800000000001a5dULL),
1124 make_floatx80_init(0x3fff, 0xefe4b99bdcdb06ebULL),
1125 make_floatx80_init(0x3ffe, 0xdfc97337b9b60dd6ULL) },
1126 { make_floatx80_init(0x3ffe, 0xefffffffffffc1efULL),
1127 make_floatx80_init(0x3fff, 0xf5257d152486a2faULL),
1128 make_floatx80_init(0x3ffe, 0xea4afa2a490d45f4ULL) },
1129 { make_floatx80_init(0x3ffe, 0xf800000000001069ULL),
1130 make_floatx80_init(0x3fff, 0xfa83b2db722a0e5cULL),
1131 make_floatx80_init(0x3ffe, 0xf50765b6e4541cb8ULL) },
1132 { make_floatx80_init(0x3fff, 0x8000000000000000ULL),
1133 make_floatx80_init(0x4000, 0x8000000000000000ULL),
1134 make_floatx80_init(0x3fff, 0x8000000000000000ULL) },
1152 } else if (exp > 0x3fff || in helper_f2xm1()
1153 (exp == 0x3fff && sig != (0x8000000000000000ULL))) { in helper_f2xm1()
1157 } else if (exp == 0x3fff) { in helper_f2xm1()
1160 ST0 = make_floatx80(0xbffe, 0x8000000000000000ULL); in helper_f2xm1()
1162 } else if (exp < 0x3fb0) { in helper_f2xm1()
1170 if (exp == 0) { in helper_f2xm1()
1235 shift128RightJamming(extractFloatx80Frac(accum), 0, in helper_f2xm1()
1239 bsig1 = 0; in helper_f2xm1()
1248 aexp += extractFloatx80Exp(y) - 0x3ffe; in helper_f2xm1()
1258 aexp += extractFloatx80Exp(f2xm1_table[n].exp2) - 0x3ffe; in helper_f2xm1()
1261 bsig1 = 0; in helper_f2xm1()
1303 env->fpus |= 0x400; in helper_fptan()
1309 env->fpus &= ~0x400; /* C2 <-- 0 */ in helper_fptan()
1315 #define pi_4_exp 0x3ffe
1316 #define pi_4_sig_high 0xc90fdaa22168c234ULL
1317 #define pi_4_sig_low 0xc4c6628b80dc1cd1ULL
1318 #define pi_2_exp 0x3fff
1319 #define pi_2_sig_high 0xc90fdaa22168c234ULL
1320 #define pi_2_sig_low 0xc4c6628b80dc1cd1ULL
1321 #define pi_34_exp 0x4000
1322 #define pi_34_sig_high 0x96cbe3f9990e91a7ULL
1323 #define pi_34_sig_low 0x9394c9e8a0a5159dULL
1324 #define pi_exp 0x4000
1325 #define pi_sig_high 0xc90fdaa22168c234ULL
1326 #define pi_sig_low 0xc4c6628b80dc1cd1ULL
1336 #define fpatan_coeff_0 make_floatx80(0x3fff, 0x8000000000000000ULL)
1337 #define fpatan_coeff_1 make_floatx80(0xbffd, 0xaaaaaaaaaaaaaa43ULL)
1338 #define fpatan_coeff_2 make_floatx80(0x3ffc, 0xccccccccccbfe4f8ULL)
1339 #define fpatan_coeff_3 make_floatx80(0xbffc, 0x92492491fbab2e66ULL)
1340 #define fpatan_coeff_4 make_floatx80(0x3ffb, 0xe38e372881ea1e0bULL)
1341 #define fpatan_coeff_5 make_floatx80(0xbffb, 0xba2c0104bbdd0615ULL)
1342 #define fpatan_coeff_6 make_floatx80(0x3ffb, 0x9baf7ebf898b42efULL)
1352 { make_floatx80_init(0x3ffb, 0xfeadd4d5617b6e33ULL),
1353 make_floatx80_init(0xbfb9, 0xdda19d8305ddc420ULL) },
1354 { make_floatx80_init(0x3ffc, 0xfadbafc96406eb15ULL),
1355 make_floatx80_init(0x3fbb, 0xdb8f3debef442fccULL) },
1356 { make_floatx80_init(0x3ffd, 0xb7b0ca0f26f78474ULL),
1357 make_floatx80_init(0xbfbc, 0xeab9bdba460376faULL) },
1358 { make_floatx80_init(0x3ffd, 0xed63382b0dda7b45ULL),
1359 make_floatx80_init(0x3fbc, 0xdfc88bd978751a06ULL) },
1360 { make_floatx80_init(0x3ffe, 0x8f005d5ef7f59f9bULL),
1361 make_floatx80_init(0x3fbd, 0xb906bc2ccb886e90ULL) },
1362 { make_floatx80_init(0x3ffe, 0xa4bc7d1934f70924ULL),
1363 make_floatx80_init(0x3fbb, 0xcd43f9522bed64f8ULL) },
1364 { make_floatx80_init(0x3ffe, 0xb8053e2bc2319e74ULL),
1365 make_floatx80_init(0xbfbc, 0xd3496ab7bd6eef0cULL) },
1366 { make_floatx80_init(0x3ffe, 0xc90fdaa22168c235ULL),
1367 make_floatx80_init(0xbfbc, 0xece675d1fc8f8cbcULL) },
1426 if (exp == 0) { in helper_fpatan()
1492 if (arg0_exp == 0) { in helper_fpatan()
1495 if (arg1_exp == 0) { in helper_fpatan()
1513 adj_exp = 0; in helper_fpatan()
1514 adj_sig0 = 0; in helper_fpatan()
1515 adj_sig1 = 0; in helper_fpatan()
1532 * Compute x = num/den, where 0 < x <= 1 and x is not too in helper_fpatan()
1535 xexp = num_exp - den_exp + 0x3ffe; in helper_fpatan()
1537 remsig1 = 0; in helper_fpatan()
1545 while ((int64_t) remsig0 < 0) { in helper_fpatan()
1547 add128(remsig0, remsig1, 0, den_sig, &remsig0, &remsig1); in helper_fpatan()
1549 xsig1 = estimateDiv128To64(remsig1, 0, den_sig); in helper_fpatan()
1563 if (n == 0) { in helper_fpatan()
1568 texp = 0; in helper_fpatan()
1569 tsig = 0; in helper_fpatan()
1572 texp = 0x403b - shift; in helper_fpatan()
1576 sub128(xsig0, xsig1, tsig, 0, &ysig0, &ysig1); in helper_fpatan()
1577 if ((int64_t) ysig0 >= 0) { in helper_fpatan()
1579 if (ysig0 == 0) { in helper_fpatan()
1580 if (ysig1 == 0) { in helper_fpatan()
1581 yexp = 0; in helper_fpatan()
1595 sub128(0, 0, ysig0, ysig1, &ysig0, &ysig1); in helper_fpatan()
1596 if (ysig0 == 0) { in helper_fpatan()
1616 sub128(tsig, 0, usig0, usig1, &ysig0, &ysig1); in helper_fpatan()
1617 if (ysig0 == 0) { in helper_fpatan()
1632 if (texp == 0 || yexp == 0) { in helper_fpatan()
1638 * t <= 1, x <= 1 and if both are 1 then y is 0, so tx < 1. in helper_fpatan()
1640 int32_t dexp = texp + xexp - 0x3ffe; in helper_fpatan()
1644 * dexp <= 0x3fff (and if equal, dsig0 has a leading 0 in helper_fpatan()
1647 shift128RightJamming(dsig0, dsig1, 0x3fff - dexp, in helper_fpatan()
1649 dsig0 |= 0x8000000000000000ULL; in helper_fpatan()
1653 remsig2 = 0; in helper_fpatan()
1662 while ((int64_t) remsig0 < 0) { in helper_fpatan()
1664 add192(remsig0, remsig1, remsig2, 0, dsig0, dsig1, in helper_fpatan()
1671 if (zexp == 0) { in helper_fpatan()
1672 azexp = 0; in helper_fpatan()
1673 azsig0 = 0; in helper_fpatan()
1674 azsig1 = 0; in helper_fpatan()
1682 zexp + zexp - 0x3ffe, in helper_fpatan()
1704 shift128RightJamming(extractFloatx80Frac(accum), 0, in helper_fpatan()
1707 sub128(extractFloatx80Frac(fpatan_coeff_0), 0, asig0, asig1, in helper_fpatan()
1710 azexp = aexp + zexp - 0x3ffe; in helper_fpatan()
1716 if (texp == 0) { in helper_fpatan()
1726 uint64_t low_sig1 = 0; in helper_fpatan()
1729 axsig1 = 0; in helper_fpatan()
1761 if (adj_exp == 0) { in helper_fpatan()
1817 /* Easy way to generate -inf and raising division by 0 exception */ in helper_fxtract()
1837 ST1 = floatx80_default_inf(0, &env->fp_status); in helper_fxtract()
1841 if (EXPD(temp) == 0) { in helper_fxtract()
1870 env->fpus &= ~0x4700; /* (C3,C2,C1,C0) <-- 0000 */ in helper_fprem_common()
1872 exp0 == 0x7fff || exp1 == 0x7fff || in helper_fprem_common()
1877 if (exp0 == 0) { in helper_fprem_common()
1880 if (exp1 == 0) { in helper_fprem_common()
1886 env->fpus |= (quotient & 0x4) << (8 - 2); /* (C0) <-- q2 */ in helper_fprem_common()
1887 env->fpus |= (quotient & 0x2) << (14 - 1); /* (C3) <-- q1 */ in helper_fprem_common()
1888 env->fpus |= (quotient & 0x1) << (9 - 0); /* (C1) <-- q0 */ in helper_fprem_common()
1903 env->fpus |= 0x400; /* C2 <-- 1 */ in helper_fprem_common()
1920 #define log2_e_sig_high 0xb8aa3b295c17f0bbULL
1921 #define log2_e_sig_low 0xbe87fed0691d3e89ULL
1929 #define fyl2x_coeff_0 make_floatx80(0x4000, 0xb8aa3b295c17f0bcULL)
1930 #define fyl2x_coeff_0_low make_floatx80(0xbfbf, 0x834972fe2d7bab1bULL)
1931 #define fyl2x_coeff_1 make_floatx80(0x3ffe, 0xf6384ee1d01febb8ULL)
1932 #define fyl2x_coeff_2 make_floatx80(0x3ffe, 0x93bb62877cdfa2e3ULL)
1933 #define fyl2x_coeff_3 make_floatx80(0x3ffd, 0xd30bb153d808f269ULL)
1934 #define fyl2x_coeff_4 make_floatx80(0x3ffd, 0xa42589eaf451499eULL)
1935 #define fyl2x_coeff_5 make_floatx80(0x3ffd, 0x864d42c0f8f17517ULL)
1936 #define fyl2x_coeff_6 make_floatx80(0x3ffc, 0xe3476578adf26272ULL)
1937 #define fyl2x_coeff_7 make_floatx80(0x3ffc, 0xc506c5f874e6d80fULL)
1938 #define fyl2x_coeff_8 make_floatx80(0x3ffc, 0xac5cf50cc57d6372ULL)
1939 #define fyl2x_coeff_9 make_floatx80(0x3ffc, 0xb1ed0066d971a103ULL)
1970 dexp = 0x3fff; in helper_fyl2x_common()
1971 shift128RightJamming(arg0_sig, 0, dexp - arg0_exp, &dsig0, &dsig1); in helper_fyl2x_common()
1972 sub128(0, 0, dsig0, dsig1, &dsig0, &dsig1); in helper_fyl2x_common()
1974 dexp = 0x4000; in helper_fyl2x_common()
1975 shift128RightJamming(arg0_sig, 0, dexp - arg0_exp, &dsig0, &dsig1); in helper_fyl2x_common()
1976 dsig0 |= 0x8000000000000000ULL; in helper_fyl2x_common()
1978 texp = arg0_exp - dexp + 0x3ffe; in helper_fyl2x_common()
1980 rsig1 = 0; in helper_fyl2x_common()
1981 rsig2 = 0; in helper_fyl2x_common()
1990 while ((int64_t) rsig0 < 0) { in helper_fyl2x_common()
1992 add192(rsig0, rsig1, rsig2, 0, dsig0, dsig1, in helper_fyl2x_common()
2004 texp + texp - 0x3ffe, in helper_fyl2x_common()
2035 shift128RightJamming(extractFloatx80Frac(accum), 0, in helper_fyl2x_common()
2039 bsig1 = 0; in helper_fyl2x_common()
2048 aexp += texp - 0x3ffe; in helper_fyl2x_common()
2078 } else if (arg0_exp > 0x3ffd || in helper_fyl2xp1()
2079 (arg0_exp == 0x3ffd && arg0_sig > (arg0_sign ? in helper_fyl2xp1()
2080 0x95f619980c4336f7ULL : in helper_fyl2xp1()
2081 0xd413cccfe7799211ULL))) { in helper_fyl2xp1()
2091 arg1_exp == 0x7fff) { in helper_fyl2xp1()
2098 } else if (arg0_exp < 0x3fb0) { in helper_fyl2xp1()
2105 if (arg0_exp == 0) { in helper_fyl2xp1()
2108 if (arg1_exp == 0) { in helper_fyl2xp1()
2115 exp += arg1_exp - 0x3ffe; in helper_fyl2xp1()
2135 if (arg1_exp == 0) { in helper_fyl2xp1()
2139 aexp += arg1_exp - 0x3ffe; in helper_fyl2xp1()
2210 ST1 = make_floatx80(arg1_sign ? 0x7fff : 0xffff, in helper_fyl2x()
2211 0x8000000000000000ULL); in helper_fyl2x()
2233 if (arg0_exp == 0) { in helper_fyl2x()
2236 if (arg1_exp == 0) { in helper_fyl2x()
2239 int_exp = arg0_exp - 0x3fff; in helper_fyl2x()
2240 if (arg0_sig > 0xb504f333f9de6484ULL) { in helper_fyl2x()
2256 if (int_exp != 0) { in helper_fyl2x()
2257 bool isign = (int_exp < 0); in helper_fyl2x()
2265 iexp = 0x403e - shift; in helper_fyl2x()
2269 add128(isig, 0, asig0, asig1, &asig0, &asig1); in helper_fyl2x()
2271 sub128(isig, 0, asig0, asig1, &asig0, &asig1); in helper_fyl2x()
2280 if (arg1_exp == 0) { in helper_fyl2x()
2284 aexp += arg1_exp - 0x3ffe; in helper_fyl2x()
2303 env->fpus &= ~0x4700; /* (C3,C2,C1,C0) <-- 0000 */ in helper_fsqrt()
2304 env->fpus |= 0x400; in helper_fsqrt()
2315 env->fpus |= 0x400; in helper_fsincos()
2320 env->fpus &= ~0x400; /* C2 <-- 0 */ in helper_fsincos()
2373 set_float_exception_flags(0, &env->fp_status); in helper_fscale()
2388 env->fpus |= 0x400; in helper_fsin()
2391 env->fpus &= ~0x400; /* C2 <-- 0 */ in helper_fsin()
2401 env->fpus |= 0x400; in helper_fcos()
2404 env->fpus &= ~0x400; /* C2 <-- 0 */ in helper_fcos()
2416 env->fpus &= ~0x4700; /* (C3,C2,C1,C0) <-- 0000 */ in helper_fxam_ST0()
2418 env->fpus |= 0x200; /* C1 <-- 1 */ in helper_fxam_ST0()
2422 env->fpus |= 0x4100; /* Empty */ in helper_fxam_ST0()
2428 if (MANTD(temp) == 0x8000000000000000ULL) { in helper_fxam_ST0()
2429 env->fpus |= 0x500; /* Infinity */ in helper_fxam_ST0()
2430 } else if (MANTD(temp) & 0x8000000000000000ULL) { in helper_fxam_ST0()
2431 env->fpus |= 0x100; /* NaN */ in helper_fxam_ST0()
2433 } else if (expdif == 0) { in helper_fxam_ST0()
2434 if (MANTD(temp) == 0) { in helper_fxam_ST0()
2435 env->fpus |= 0x4000; /* Zero */ in helper_fxam_ST0()
2437 env->fpus |= 0x4400; /* Denormal */ in helper_fxam_ST0()
2439 } else if (MANTD(temp) & 0x8000000000000000ULL) { in helper_fxam_ST0()
2440 env->fpus |= 0x400; in helper_fxam_ST0()
2451 fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; in do_fstenv()
2452 fptag = 0; in do_fstenv()
2453 for (i = 7; i >= 0; i--) { in do_fstenv()
2461 if (exp == 0 && mant == 0) { in do_fstenv()
2464 } else if (exp == 0 || exp == MAXEXPD in do_fstenv()
2465 || (mant & (1LL << 63)) == 0) { in do_fstenv()
2503 env->fpus = fpus & ~0x3800 & ~FPUS_B; in cpu_set_fpus()
2504 env->fpus |= env->fpus & FPUS_SE ? FPUS_B : 0; in cpu_set_fpus()
2526 for (i = 0; i < 8; i++) { in do_fldenv()
2547 for (int i = 0; i < 8; i++) { in do_fsave()
2572 for (int i = 0; i < 8; i++) { in do_frstor()
2596 fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; in do_xsave_fpu()
2597 fptag = 0; in do_xsave_fpu()
2598 for (i = 0; i < 8; i++) { in do_xsave_fpu()
2604 access_stw(ac, ptr + XO(legacy.ftw), fptag ^ 0xff); in do_xsave_fpu()
2609 access_stq(ac, ptr + XO(legacy.fpip), 0); /* eip+sel; rip */ in do_xsave_fpu()
2610 access_stq(ac, ptr + XO(legacy.fpdp), 0); /* edp+sel; rdp */ in do_xsave_fpu()
2614 for (i = 0; i < 8; i++) { in do_xsave_fpu()
2627 access_stl(ac, ptr + XO(legacy.mxcsr_mask), 0x0000ffff); in do_xsave_mxcsr()
2643 for (i = 0; i < nb_xmm_regs; i++) { in do_xsave_sse()
2644 access_stq(ac, addr, env->xmm_regs[i].ZMM_Q(0)); in do_xsave_sse()
2661 for (i = 0; i < nb_xmm_regs; i++, ptr += 16) { in do_xsave_ymmh()
2673 for (i = 0; i < 4; i++, addr += 16) { in do_xsave_bndregs()
2716 if (ptr & 0xf) { in helper_fxsave()
2733 if ((env->hflags & HF_MPX_IU_MASK) == 0) { in get_xinuse()
2826 fptag ^= 0xff; in do_xrstor_fpu()
2827 for (i = 0; i < 8; i++) { in do_xrstor_fpu()
2833 for (i = 0; i < 8; i++) { in do_xrstor_fpu()
2859 for (i = 0; i < nb_xmm_regs; i++) { in do_xrstor_sse()
2860 env->xmm_regs[i].ZMM_Q(0) = access_ldq(ac, addr); in do_xrstor_sse()
2876 for (i = 0; i < nb_xmm_regs; i++) { in do_clear_sse()
2877 env->xmm_regs[i].ZMM_Q(0) = 0; in do_clear_sse()
2878 env->xmm_regs[i].ZMM_Q(1) = 0; in do_clear_sse()
2893 for (i = 0; i < nb_xmm_regs; i++, ptr += 16) { in do_xrstor_ymmh()
2909 for (i = 0; i < nb_xmm_regs; i++) { in do_clear_ymmh()
2910 env->xmm_regs[i].ZMM_Q(2) = 0; in do_clear_ymmh()
2911 env->xmm_regs[i].ZMM_Q(3) = 0; in do_clear_ymmh()
2921 for (i = 0; i < 4; i++, addr += 16) { in do_xrstor_bndregs()
2965 if (ptr & 0xf) { in helper_fxrstor()
2995 return (xstate_bv & ~ac->env->xcr0) == 0; in valid_xrstor_header()
3008 memset(env->fpregs, 0, sizeof(env->fpregs)); in do_xrstor()
3033 memset(env->bnd_regs, 0, sizeof(env->bnd_regs)); in do_xrstor()
3041 memset(&env->bndcs_regs, 0, sizeof(env->bndcs_regs)); in do_xrstor()
3050 env->pkru = 0; in do_xrstor()
3097 do_fsave(&ac, 0, true); in cpu_x86_fsave()
3109 do_frstor(&ac, 0, true); in cpu_x86_frstor()
3121 do_fxsave(&ac, 0); in cpu_x86_fxsave()
3133 do_fxrstor(&ac, 0); in cpu_x86_fxrstor()
3147 assert((rfbm & ~env->xcr0) == 0); in cpu_x86_xsave()
3150 do_xsave_access(&ac, 0, rfbm, get_xinuse(env), rfbm); in cpu_x86_xsave()
3165 assert((rfbm & ~env->xcr0) == 0); in cpu_x86_xrstor()
3169 if (!valid_xrstor_header(&ac, &xstate_bv, 0)) { in cpu_x86_xrstor()
3172 do_xrstor(&ac, 0, rfbm, xstate_bv); in cpu_x86_xrstor()
3185 case 0: in helper_xgetbv()
3207 if (ecx != 0 || (mask & XSTATE_FP_MASK) == 0) { in helper_xsetbv()
3217 cpu_x86_cpuid(env, 0x0d, 0, &ena_lo, &dummy, &dummy, &ena_hi); in helper_xsetbv()
3241 #define SSE_DAZ 0x0040
3244 #define SSE_FZ 0x8000
3256 set_float_exception_flags((mxcsr & FPUS_IE ? float_flag_invalid : 0) | in update_mxcsr_status()
3257 (mxcsr & FPUS_ZE ? float_flag_divbyzero : 0) | in update_mxcsr_status()
3258 (mxcsr & FPUS_OE ? float_flag_overflow : 0) | in update_mxcsr_status()
3259 (mxcsr & FPUS_UE ? float_flag_underflow : 0) | in update_mxcsr_status()
3260 (mxcsr & FPUS_PE ? float_flag_inexact : 0), in update_mxcsr_status()
3264 set_flush_inputs_to_zero((mxcsr & SSE_DAZ) ? 1 : 0, &env->sse_status); in update_mxcsr_status()
3267 set_flush_to_zero((mxcsr & SSE_FZ) ? 1 : 0, &env->sse_status); in update_mxcsr_status()
3280 env->mxcsr |= ((flags & float_flag_invalid ? FPUS_IE : 0) | in update_mxcsr_from_sse_status()
3281 (flags & float_flag_divbyzero ? FPUS_ZE : 0) | in update_mxcsr_from_sse_status()
3282 (flags & float_flag_overflow ? FPUS_OE : 0) | in update_mxcsr_from_sse_status()
3283 (flags & float_flag_underflow ? FPUS_UE : 0) | in update_mxcsr_from_sse_status()
3284 (flags & float_flag_inexact ? FPUS_PE : 0) | in update_mxcsr_from_sse_status()
3286 0)); in update_mxcsr_from_sse_status()
3301 env->fpstt = 0; in helper_enter_mmx()
3302 *(uint32_t *)(env->fptags) = 0; in helper_enter_mmx()
3303 *(uint32_t *)(env->fptags + 4) = 0; in helper_enter_mmx()
3309 *(uint32_t *)(env->fptags) = 0x01010101; in helper_emms()
3310 *(uint32_t *)(env->fptags + 4) = 0x01010101; in helper_emms()
3313 #define SHIFT 0