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()
181 set_float_exception_flags(0, &env->fp_status); in save_exception_flags()
190 ((new_flags & float_flag_invalid ? FPUS_IE : 0) | in merge_exception_flags()
191 (new_flags & float_flag_divbyzero ? FPUS_ZE : 0) | in merge_exception_flags()
192 (new_flags & float_flag_overflow ? FPUS_OE : 0) | in merge_exception_flags()
193 (new_flags & float_flag_underflow ? FPUS_UE : 0) | in merge_exception_flags()
194 (new_flags & float_flag_inexact ? FPUS_PE : 0) | in merge_exception_flags()
195 (new_flags & float_flag_input_denormal ? FPUS_DE : 0))); in merge_exception_flags()
208 if (env->cr[0] & CR0_NE_MASK) { in fpu_raise_exception()
262 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_flds_ST0()
279 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_fldl_ST0()
298 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_fildl_ST0()
311 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_fildll_ST0()
363 val = 0x80000000; in helper_fistl_ST0()
376 val = 0x8000000000000000ULL; in helper_fistll_ST0()
403 val = 0x80000000; in helper_fisttl_ST0()
416 val = 0x8000000000000000ULL; in helper_fisttll_ST0()
432 env->fptags[new_fpstt] = 0; /* validate stack entry */ in helper_fldt_ST0()
456 env->fpus &= ~0x4700; in helper_fdecstp()
462 env->fpus &= ~0x4700; in helper_fincstp()
503 static const int fcom_ccval[4] = {0x0100, 0x4000, 0x0000, 0x4500};
511 env->fpus = (env->fpus & ~0x4500) | fcom_ccval[ret + 1]; in helper_fcom_ST0_FT0()
521 env->fpus = (env->fpus & ~0x4500) | fcom_ccval[ret + 1]; in helper_fucom_ST0_FT0()
525 static const int fcomi_ccval[4] = {CC_C, CC_Z, 0, CC_Z | CC_P | CC_C};
729 return (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; in helper_fnstsw()
759 case 0: in update_fp_status()
780 env->fpus &= 0x7f00; in helper_fclex()
792 env->fpus = 0; in do_fninit()
793 env->fpstt = 0; in do_fninit()
794 env->fpcs = 0; in do_fninit()
795 env->fpds = 0; in do_fninit()
796 env->fpip = 0; in do_fninit()
797 env->fpdp = 0; in do_fninit()
798 cpu_set_fpuc(env, 0x37f); in do_fninit()
799 env->fptags[0] = 1; in do_fninit()
826 val = 0; in helper_fbld_ST0()
827 for (i = 8; i >= 0; i--) { in helper_fbld_ST0()
829 val = (val * 100) + ((v >> 4) * 10) + (v & 0xf); in helper_fbld_ST0()
832 if (access_ldb(&ac, ptr + 9) & 0x80) { in helper_fbld_ST0()
856 access_stb(&ac, mem_ref++, 0); in helper_fbst_ST0()
858 access_stb(&ac, mem_ref++, 0xc0); in helper_fbst_ST0()
859 access_stb(&ac, mem_ref++, 0xff); in helper_fbst_ST0()
860 access_stb(&ac, mem_ref++, 0xff); in helper_fbst_ST0()
866 access_stb(&ac, mem_end, 0x80); in helper_fbst_ST0()
869 access_stb(&ac, mem_end, 0x00); in helper_fbst_ST0()
872 if (val == 0) { in helper_fbst_ST0()
881 access_stb(&ac, mem_ref++, 0); in helper_fbst_ST0()
887 #define ln2_sig_high 0xb17217f7d1cf79abULL
888 #define ln2_sig_low 0xc9e3b39803f2f6afULL
894 #define f2xm1_coeff_0 make_floatx80(0x3ffe, 0xb17217f7d1cf79acULL)
895 #define f2xm1_coeff_0_low make_floatx80(0xbfbc, 0xd87edabf495b3762ULL)
896 #define f2xm1_coeff_1 make_floatx80(0x3ffc, 0xf5fdeffc162c7543ULL)
897 #define f2xm1_coeff_2 make_floatx80(0x3ffa, 0xe35846b82505fcc7ULL)
898 #define f2xm1_coeff_3 make_floatx80(0x3ff8, 0x9d955b7dd273b899ULL)
899 #define f2xm1_coeff_4 make_floatx80(0x3ff5, 0xaec3ff3c4ef4ac0cULL)
900 #define f2xm1_coeff_5 make_floatx80(0x3ff2, 0xa184897c3a7f0de9ULL)
901 #define f2xm1_coeff_6 make_floatx80(0x3fee, 0xffe634d0ec30d504ULL)
902 #define f2xm1_coeff_7 make_floatx80(0x3feb, 0xb160111d2db515e4ULL)
917 { make_floatx80_init(0xbfff, 0x8000000000000000ULL),
918 make_floatx80_init(0x3ffe, 0x8000000000000000ULL),
919 make_floatx80_init(0xbffe, 0x8000000000000000ULL) },
920 { make_floatx80_init(0xbffe, 0xf800000000002e7eULL),
921 make_floatx80_init(0x3ffe, 0x82cd8698ac2b9160ULL),
922 make_floatx80_init(0xbffd, 0xfa64f2cea7a8dd40ULL) },
923 { make_floatx80_init(0xbffe, 0xefffffffffffe960ULL),
924 make_floatx80_init(0x3ffe, 0x85aac367cc488345ULL),
925 make_floatx80_init(0xbffd, 0xf4aa7930676ef976ULL) },
926 { make_floatx80_init(0xbffe, 0xe800000000006f10ULL),
927 make_floatx80_init(0x3ffe, 0x88980e8092da5c14ULL),
928 make_floatx80_init(0xbffd, 0xeecfe2feda4b47d8ULL) },
929 { make_floatx80_init(0xbffe, 0xe000000000008a45ULL),
930 make_floatx80_init(0x3ffe, 0x8b95c1e3ea8ba2a5ULL),
931 make_floatx80_init(0xbffd, 0xe8d47c382ae8bab6ULL) },
932 { make_floatx80_init(0xbffe, 0xd7ffffffffff8a9eULL),
933 make_floatx80_init(0x3ffe, 0x8ea4398b45cd8116ULL),
934 make_floatx80_init(0xbffd, 0xe2b78ce97464fdd4ULL) },
935 { make_floatx80_init(0xbffe, 0xd0000000000019a0ULL),
936 make_floatx80_init(0x3ffe, 0x91c3d373ab11b919ULL),
937 make_floatx80_init(0xbffd, 0xdc785918a9dc8dceULL) },
938 { make_floatx80_init(0xbffe, 0xc7ffffffffff14dfULL),
939 make_floatx80_init(0x3ffe, 0x94f4efa8fef76836ULL),
940 make_floatx80_init(0xbffd, 0xd61620ae02112f94ULL) },
941 { make_floatx80_init(0xbffe, 0xc000000000006530ULL),
942 make_floatx80_init(0x3ffe, 0x9837f0518db87fbbULL),
943 make_floatx80_init(0xbffd, 0xcf901f5ce48f008aULL) },
944 { make_floatx80_init(0xbffe, 0xb7ffffffffff1723ULL),
945 make_floatx80_init(0x3ffe, 0x9b8d39b9d54eb74cULL),
946 make_floatx80_init(0xbffd, 0xc8e58c8c55629168ULL) },
947 { make_floatx80_init(0xbffe, 0xb00000000000b5e1ULL),
948 make_floatx80_init(0x3ffe, 0x9ef5326091a0c366ULL),
949 make_floatx80_init(0xbffd, 0xc2159b3edcbe7934ULL) },
950 { make_floatx80_init(0xbffe, 0xa800000000006f8aULL),
951 make_floatx80_init(0x3ffe, 0xa27043030c49370aULL),
952 make_floatx80_init(0xbffd, 0xbb1f79f9e76d91ecULL) },
953 { make_floatx80_init(0xbffe, 0x9fffffffffff816aULL),
954 make_floatx80_init(0x3ffe, 0xa5fed6a9b15171cfULL),
955 make_floatx80_init(0xbffd, 0xb40252ac9d5d1c62ULL) },
956 { make_floatx80_init(0xbffe, 0x97ffffffffffb621ULL),
957 make_floatx80_init(0x3ffe, 0xa9a15ab4ea7c30e6ULL),
958 make_floatx80_init(0xbffd, 0xacbd4a962b079e34ULL) },
959 { make_floatx80_init(0xbffe, 0x8fffffffffff162bULL),
960 make_floatx80_init(0x3ffe, 0xad583eea42a1b886ULL),
961 make_floatx80_init(0xbffd, 0xa54f822b7abc8ef4ULL) },
962 { make_floatx80_init(0xbffe, 0x87ffffffffff4d34ULL),
963 make_floatx80_init(0x3ffe, 0xb123f581d2ac7b51ULL),
964 make_floatx80_init(0xbffd, 0x9db814fc5aa7095eULL) },
965 { make_floatx80_init(0xbffe, 0x800000000000227dULL),
966 make_floatx80_init(0x3ffe, 0xb504f333f9de539dULL),
967 make_floatx80_init(0xbffd, 0x95f619980c4358c6ULL) },
968 { make_floatx80_init(0xbffd, 0xefffffffffff3978ULL),
969 make_floatx80_init(0x3ffe, 0xb8fbaf4762fbd0a1ULL),
970 make_floatx80_init(0xbffd, 0x8e08a1713a085ebeULL) },
971 { make_floatx80_init(0xbffd, 0xe00000000000df81ULL),
972 make_floatx80_init(0x3ffe, 0xbd08a39f580bfd8cULL),
973 make_floatx80_init(0xbffd, 0x85eeb8c14fe804e8ULL) },
974 { make_floatx80_init(0xbffd, 0xd00000000000bccfULL),
975 make_floatx80_init(0x3ffe, 0xc12c4cca667062f6ULL),
976 make_floatx80_init(0xbffc, 0xfb4eccd6663e7428ULL) },
977 { make_floatx80_init(0xbffd, 0xc00000000000eff0ULL),
978 make_floatx80_init(0x3ffe, 0xc5672a1155069abeULL),
979 make_floatx80_init(0xbffc, 0xea6357baabe59508ULL) },
980 { make_floatx80_init(0xbffd, 0xb000000000000fe6ULL),
981 make_floatx80_init(0x3ffe, 0xc9b9bd866e2f234bULL),
982 make_floatx80_init(0xbffc, 0xd91909e6474372d4ULL) },
983 { make_floatx80_init(0xbffd, 0x9fffffffffff2172ULL),
984 make_floatx80_init(0x3ffe, 0xce248c151f84bf00ULL),
985 make_floatx80_init(0xbffc, 0xc76dcfab81ed0400ULL) },
986 { make_floatx80_init(0xbffd, 0x8fffffffffffafffULL),
987 make_floatx80_init(0x3ffe, 0xd2a81d91f12afb2bULL),
988 make_floatx80_init(0xbffc, 0xb55f89b83b541354ULL) },
989 { make_floatx80_init(0xbffc, 0xffffffffffff81a3ULL),
990 make_floatx80_init(0x3ffe, 0xd744fccad69d7d5eULL),
991 make_floatx80_init(0xbffc, 0xa2ec0cd4a58a0a88ULL) },
992 { make_floatx80_init(0xbffc, 0xdfffffffffff1568ULL),
993 make_floatx80_init(0x3ffe, 0xdbfbb797daf25a44ULL),
994 make_floatx80_init(0xbffc, 0x901121a0943696f0ULL) },
995 { make_floatx80_init(0xbffc, 0xbfffffffffff68daULL),
996 make_floatx80_init(0x3ffe, 0xe0ccdeec2a94f811ULL),
997 make_floatx80_init(0xbffb, 0xf999089eab583f78ULL) },
998 { make_floatx80_init(0xbffc, 0x9fffffffffff4690ULL),
999 make_floatx80_init(0x3ffe, 0xe5b906e77c83657eULL),
1000 make_floatx80_init(0xbffb, 0xd237c8c41be4d410ULL) },
1001 { make_floatx80_init(0xbffb, 0xffffffffffff8aeeULL),
1002 make_floatx80_init(0x3ffe, 0xeac0c6e7dd24427cULL),
1003 make_floatx80_init(0xbffb, 0xa9f9c8c116ddec20ULL) },
1004 { make_floatx80_init(0xbffb, 0xbfffffffffff2d18ULL),
1005 make_floatx80_init(0x3ffe, 0xefe4b99bdcdb06ebULL),
1006 make_floatx80_init(0xbffb, 0x80da33211927c8a8ULL) },
1007 { make_floatx80_init(0xbffa, 0xffffffffffff8ccbULL),
1008 make_floatx80_init(0x3ffe, 0xf5257d152486d0f4ULL),
1009 make_floatx80_init(0xbffa, 0xada82eadb792f0c0ULL) },
1010 { make_floatx80_init(0xbff9, 0xffffffffffff11feULL),
1011 make_floatx80_init(0x3ffe, 0xfa83b2db722a0846ULL),
1012 make_floatx80_init(0xbff9, 0xaf89a491babef740ULL) },
1014 make_floatx80_init(0x3fff, 0x8000000000000000ULL),
1016 { make_floatx80_init(0x3ff9, 0xffffffffffff2680ULL),
1017 make_floatx80_init(0x3fff, 0x82cd8698ac2b9f6fULL),
1018 make_floatx80_init(0x3ff9, 0xb361a62b0ae7dbc0ULL) },
1019 { make_floatx80_init(0x3ffb, 0x800000000000b500ULL),
1020 make_floatx80_init(0x3fff, 0x85aac367cc488345ULL),
1021 make_floatx80_init(0x3ffa, 0xb5586cf9891068a0ULL) },
1022 { make_floatx80_init(0x3ffb, 0xbfffffffffff4b67ULL),
1023 make_floatx80_init(0x3fff, 0x88980e8092da7cceULL),
1024 make_floatx80_init(0x3ffb, 0x8980e8092da7cce0ULL) },
1025 { make_floatx80_init(0x3ffb, 0xffffffffffffff57ULL),
1026 make_floatx80_init(0x3fff, 0x8b95c1e3ea8bd6dfULL),
1027 make_floatx80_init(0x3ffb, 0xb95c1e3ea8bd6df0ULL) },
1028 { make_floatx80_init(0x3ffc, 0x9fffffffffff811fULL),
1029 make_floatx80_init(0x3fff, 0x8ea4398b45cd4780ULL),
1030 make_floatx80_init(0x3ffb, 0xea4398b45cd47800ULL) },
1031 { make_floatx80_init(0x3ffc, 0xbfffffffffff9980ULL),
1032 make_floatx80_init(0x3fff, 0x91c3d373ab11b919ULL),
1033 make_floatx80_init(0x3ffc, 0x8e1e9b9d588dc8c8ULL) },
1034 { make_floatx80_init(0x3ffc, 0xdffffffffffff631ULL),
1035 make_floatx80_init(0x3fff, 0x94f4efa8fef70864ULL),
1036 make_floatx80_init(0x3ffc, 0xa7a77d47f7b84320ULL) },
1037 { make_floatx80_init(0x3ffc, 0xffffffffffff2499ULL),
1038 make_floatx80_init(0x3fff, 0x9837f0518db892d4ULL),
1039 make_floatx80_init(0x3ffc, 0xc1bf828c6dc496a0ULL) },
1040 { make_floatx80_init(0x3ffd, 0x8fffffffffff80fbULL),
1041 make_floatx80_init(0x3fff, 0x9b8d39b9d54e3a79ULL),
1042 make_floatx80_init(0x3ffc, 0xdc69cdceaa71d3c8ULL) },
1043 { make_floatx80_init(0x3ffd, 0x9fffffffffffbc23ULL),
1044 make_floatx80_init(0x3fff, 0x9ef5326091a10313ULL),
1045 make_floatx80_init(0x3ffc, 0xf7a993048d081898ULL) },
1046 { make_floatx80_init(0x3ffd, 0xafffffffffff20ecULL),
1047 make_floatx80_init(0x3fff, 0xa27043030c49370aULL),
1048 make_floatx80_init(0x3ffd, 0x89c10c0c3124dc28ULL) },
1049 { make_floatx80_init(0x3ffd, 0xc00000000000fd2cULL),
1050 make_floatx80_init(0x3fff, 0xa5fed6a9b15171cfULL),
1051 make_floatx80_init(0x3ffd, 0x97fb5aa6c545c73cULL) },
1052 { make_floatx80_init(0x3ffd, 0xd0000000000093beULL),
1053 make_floatx80_init(0x3fff, 0xa9a15ab4ea7c30e6ULL),
1054 make_floatx80_init(0x3ffd, 0xa6856ad3a9f0c398ULL) },
1055 { make_floatx80_init(0x3ffd, 0xe00000000000c2aeULL),
1056 make_floatx80_init(0x3fff, 0xad583eea42a17876ULL),
1057 make_floatx80_init(0x3ffd, 0xb560fba90a85e1d8ULL) },
1058 { make_floatx80_init(0x3ffd, 0xefffffffffff1e3fULL),
1059 make_floatx80_init(0x3fff, 0xb123f581d2abef6cULL),
1060 make_floatx80_init(0x3ffd, 0xc48fd6074aafbdb0ULL) },
1061 { make_floatx80_init(0x3ffd, 0xffffffffffff1c23ULL),
1062 make_floatx80_init(0x3fff, 0xb504f333f9de2cadULL),
1063 make_floatx80_init(0x3ffd, 0xd413cccfe778b2b4ULL) },
1064 { make_floatx80_init(0x3ffe, 0x8800000000006344ULL),
1065 make_floatx80_init(0x3fff, 0xb8fbaf4762fbd0a1ULL),
1066 make_floatx80_init(0x3ffd, 0xe3eebd1d8bef4284ULL) },
1067 { make_floatx80_init(0x3ffe, 0x9000000000005d67ULL),
1068 make_floatx80_init(0x3fff, 0xbd08a39f580c668dULL),
1069 make_floatx80_init(0x3ffd, 0xf4228e7d60319a34ULL) },
1070 { make_floatx80_init(0x3ffe, 0x9800000000009127ULL),
1071 make_floatx80_init(0x3fff, 0xc12c4cca6670e042ULL),
1072 make_floatx80_init(0x3ffe, 0x82589994cce1c084ULL) },
1073 { make_floatx80_init(0x3ffe, 0x9fffffffffff06f9ULL),
1074 make_floatx80_init(0x3fff, 0xc5672a11550655c3ULL),
1075 make_floatx80_init(0x3ffe, 0x8ace5422aa0cab86ULL) },
1076 { make_floatx80_init(0x3ffe, 0xa7fffffffffff80dULL),
1077 make_floatx80_init(0x3fff, 0xc9b9bd866e2f234bULL),
1078 make_floatx80_init(0x3ffe, 0x93737b0cdc5e4696ULL) },
1079 { make_floatx80_init(0x3ffe, 0xafffffffffff1470ULL),
1080 make_floatx80_init(0x3fff, 0xce248c151f83fd69ULL),
1081 make_floatx80_init(0x3ffe, 0x9c49182a3f07fad2ULL) },
1082 { make_floatx80_init(0x3ffe, 0xb800000000000e0aULL),
1083 make_floatx80_init(0x3fff, 0xd2a81d91f12aec5cULL),
1084 make_floatx80_init(0x3ffe, 0xa5503b23e255d8b8ULL) },
1085 { make_floatx80_init(0x3ffe, 0xc00000000000b7faULL),
1086 make_floatx80_init(0x3fff, 0xd744fccad69dd630ULL),
1087 make_floatx80_init(0x3ffe, 0xae89f995ad3bac60ULL) },
1088 { make_floatx80_init(0x3ffe, 0xc800000000003aa6ULL),
1089 make_floatx80_init(0x3fff, 0xdbfbb797daf25a44ULL),
1090 make_floatx80_init(0x3ffe, 0xb7f76f2fb5e4b488ULL) },
1091 { make_floatx80_init(0x3ffe, 0xd00000000000a6aeULL),
1092 make_floatx80_init(0x3fff, 0xe0ccdeec2a954685ULL),
1093 make_floatx80_init(0x3ffe, 0xc199bdd8552a8d0aULL) },
1094 { make_floatx80_init(0x3ffe, 0xd800000000004165ULL),
1095 make_floatx80_init(0x3fff, 0xe5b906e77c837155ULL),
1096 make_floatx80_init(0x3ffe, 0xcb720dcef906e2aaULL) },
1097 { make_floatx80_init(0x3ffe, 0xe00000000000582cULL),
1098 make_floatx80_init(0x3fff, 0xeac0c6e7dd24713aULL),
1099 make_floatx80_init(0x3ffe, 0xd5818dcfba48e274ULL) },
1100 { make_floatx80_init(0x3ffe, 0xe800000000001a5dULL),
1101 make_floatx80_init(0x3fff, 0xefe4b99bdcdb06ebULL),
1102 make_floatx80_init(0x3ffe, 0xdfc97337b9b60dd6ULL) },
1103 { make_floatx80_init(0x3ffe, 0xefffffffffffc1efULL),
1104 make_floatx80_init(0x3fff, 0xf5257d152486a2faULL),
1105 make_floatx80_init(0x3ffe, 0xea4afa2a490d45f4ULL) },
1106 { make_floatx80_init(0x3ffe, 0xf800000000001069ULL),
1107 make_floatx80_init(0x3fff, 0xfa83b2db722a0e5cULL),
1108 make_floatx80_init(0x3ffe, 0xf50765b6e4541cb8ULL) },
1109 { make_floatx80_init(0x3fff, 0x8000000000000000ULL),
1110 make_floatx80_init(0x4000, 0x8000000000000000ULL),
1111 make_floatx80_init(0x3fff, 0x8000000000000000ULL) },
1129 } else if (exp > 0x3fff || in helper_f2xm1()
1130 (exp == 0x3fff && sig != (0x8000000000000000ULL))) { in helper_f2xm1()
1134 } else if (exp == 0x3fff) { in helper_f2xm1()
1137 ST0 = make_floatx80(0xbffe, 0x8000000000000000ULL); in helper_f2xm1()
1139 } else if (exp < 0x3fb0) { in helper_f2xm1()
1147 if (exp == 0) { in helper_f2xm1()
1212 shift128RightJamming(extractFloatx80Frac(accum), 0, in helper_f2xm1()
1216 bsig1 = 0; in helper_f2xm1()
1225 aexp += extractFloatx80Exp(y) - 0x3ffe; in helper_f2xm1()
1235 aexp += extractFloatx80Exp(f2xm1_table[n].exp2) - 0x3ffe; in helper_f2xm1()
1238 bsig1 = 0; in helper_f2xm1()
1280 env->fpus |= 0x400; in helper_fptan()
1286 env->fpus &= ~0x400; /* C2 <-- 0 */ in helper_fptan()
1292 #define pi_4_exp 0x3ffe
1293 #define pi_4_sig_high 0xc90fdaa22168c234ULL
1294 #define pi_4_sig_low 0xc4c6628b80dc1cd1ULL
1295 #define pi_2_exp 0x3fff
1296 #define pi_2_sig_high 0xc90fdaa22168c234ULL
1297 #define pi_2_sig_low 0xc4c6628b80dc1cd1ULL
1298 #define pi_34_exp 0x4000
1299 #define pi_34_sig_high 0x96cbe3f9990e91a7ULL
1300 #define pi_34_sig_low 0x9394c9e8a0a5159dULL
1301 #define pi_exp 0x4000
1302 #define pi_sig_high 0xc90fdaa22168c234ULL
1303 #define pi_sig_low 0xc4c6628b80dc1cd1ULL
1313 #define fpatan_coeff_0 make_floatx80(0x3fff, 0x8000000000000000ULL)
1314 #define fpatan_coeff_1 make_floatx80(0xbffd, 0xaaaaaaaaaaaaaa43ULL)
1315 #define fpatan_coeff_2 make_floatx80(0x3ffc, 0xccccccccccbfe4f8ULL)
1316 #define fpatan_coeff_3 make_floatx80(0xbffc, 0x92492491fbab2e66ULL)
1317 #define fpatan_coeff_4 make_floatx80(0x3ffb, 0xe38e372881ea1e0bULL)
1318 #define fpatan_coeff_5 make_floatx80(0xbffb, 0xba2c0104bbdd0615ULL)
1319 #define fpatan_coeff_6 make_floatx80(0x3ffb, 0x9baf7ebf898b42efULL)
1329 { make_floatx80_init(0x3ffb, 0xfeadd4d5617b6e33ULL),
1330 make_floatx80_init(0xbfb9, 0xdda19d8305ddc420ULL) },
1331 { make_floatx80_init(0x3ffc, 0xfadbafc96406eb15ULL),
1332 make_floatx80_init(0x3fbb, 0xdb8f3debef442fccULL) },
1333 { make_floatx80_init(0x3ffd, 0xb7b0ca0f26f78474ULL),
1334 make_floatx80_init(0xbfbc, 0xeab9bdba460376faULL) },
1335 { make_floatx80_init(0x3ffd, 0xed63382b0dda7b45ULL),
1336 make_floatx80_init(0x3fbc, 0xdfc88bd978751a06ULL) },
1337 { make_floatx80_init(0x3ffe, 0x8f005d5ef7f59f9bULL),
1338 make_floatx80_init(0x3fbd, 0xb906bc2ccb886e90ULL) },
1339 { make_floatx80_init(0x3ffe, 0xa4bc7d1934f70924ULL),
1340 make_floatx80_init(0x3fbb, 0xcd43f9522bed64f8ULL) },
1341 { make_floatx80_init(0x3ffe, 0xb8053e2bc2319e74ULL),
1342 make_floatx80_init(0xbfbc, 0xd3496ab7bd6eef0cULL) },
1343 { make_floatx80_init(0x3ffe, 0xc90fdaa22168c235ULL),
1344 make_floatx80_init(0xbfbc, 0xece675d1fc8f8cbcULL) },
1402 if (exp == 0) { in helper_fpatan()
1467 if (arg0_exp == 0) { in helper_fpatan()
1470 if (arg1_exp == 0) { in helper_fpatan()
1488 adj_exp = 0; in helper_fpatan()
1489 adj_sig0 = 0; in helper_fpatan()
1490 adj_sig1 = 0; in helper_fpatan()
1507 * Compute x = num/den, where 0 < x <= 1 and x is not too in helper_fpatan()
1510 xexp = num_exp - den_exp + 0x3ffe; in helper_fpatan()
1512 remsig1 = 0; in helper_fpatan()
1520 while ((int64_t) remsig0 < 0) { in helper_fpatan()
1522 add128(remsig0, remsig1, 0, den_sig, &remsig0, &remsig1); in helper_fpatan()
1524 xsig1 = estimateDiv128To64(remsig1, 0, den_sig); in helper_fpatan()
1538 if (n == 0) { in helper_fpatan()
1543 texp = 0; in helper_fpatan()
1544 tsig = 0; in helper_fpatan()
1547 texp = 0x403b - shift; in helper_fpatan()
1551 sub128(xsig0, xsig1, tsig, 0, &ysig0, &ysig1); in helper_fpatan()
1552 if ((int64_t) ysig0 >= 0) { in helper_fpatan()
1554 if (ysig0 == 0) { in helper_fpatan()
1555 if (ysig1 == 0) { in helper_fpatan()
1556 yexp = 0; in helper_fpatan()
1570 sub128(0, 0, ysig0, ysig1, &ysig0, &ysig1); in helper_fpatan()
1571 if (ysig0 == 0) { in helper_fpatan()
1591 sub128(tsig, 0, usig0, usig1, &ysig0, &ysig1); in helper_fpatan()
1592 if (ysig0 == 0) { in helper_fpatan()
1607 if (texp == 0 || yexp == 0) { in helper_fpatan()
1613 * t <= 1, x <= 1 and if both are 1 then y is 0, so tx < 1. in helper_fpatan()
1615 int32_t dexp = texp + xexp - 0x3ffe; in helper_fpatan()
1619 * dexp <= 0x3fff (and if equal, dsig0 has a leading 0 in helper_fpatan()
1622 shift128RightJamming(dsig0, dsig1, 0x3fff - dexp, in helper_fpatan()
1624 dsig0 |= 0x8000000000000000ULL; in helper_fpatan()
1628 remsig2 = 0; in helper_fpatan()
1637 while ((int64_t) remsig0 < 0) { in helper_fpatan()
1639 add192(remsig0, remsig1, remsig2, 0, dsig0, dsig1, in helper_fpatan()
1646 if (zexp == 0) { in helper_fpatan()
1647 azexp = 0; in helper_fpatan()
1648 azsig0 = 0; in helper_fpatan()
1649 azsig1 = 0; in helper_fpatan()
1657 zexp + zexp - 0x3ffe, in helper_fpatan()
1679 shift128RightJamming(extractFloatx80Frac(accum), 0, in helper_fpatan()
1682 sub128(extractFloatx80Frac(fpatan_coeff_0), 0, asig0, asig1, in helper_fpatan()
1685 azexp = aexp + zexp - 0x3ffe; in helper_fpatan()
1691 if (texp == 0) { in helper_fpatan()
1701 uint64_t low_sig1 = 0; in helper_fpatan()
1704 axsig1 = 0; in helper_fpatan()
1736 if (adj_exp == 0) { in helper_fpatan()
1792 /* Easy way to generate -inf and raising division by 0 exception */ in helper_fxtract()
1816 if (EXPD(temp) == 0) { in helper_fxtract()
1845 env->fpus &= ~0x4700; /* (C3,C2,C1,C0) <-- 0000 */ in helper_fprem_common()
1847 exp0 == 0x7fff || exp1 == 0x7fff || in helper_fprem_common()
1851 if (exp0 == 0) { in helper_fprem_common()
1854 if (exp1 == 0) { in helper_fprem_common()
1860 env->fpus |= (quotient & 0x4) << (8 - 2); /* (C0) <-- q2 */ in helper_fprem_common()
1861 env->fpus |= (quotient & 0x2) << (14 - 1); /* (C3) <-- q1 */ in helper_fprem_common()
1862 env->fpus |= (quotient & 0x1) << (9 - 0); /* (C1) <-- q0 */ in helper_fprem_common()
1877 env->fpus |= 0x400; /* C2 <-- 1 */ in helper_fprem_common()
1894 #define log2_e_sig_high 0xb8aa3b295c17f0bbULL
1895 #define log2_e_sig_low 0xbe87fed0691d3e89ULL
1903 #define fyl2x_coeff_0 make_floatx80(0x4000, 0xb8aa3b295c17f0bcULL)
1904 #define fyl2x_coeff_0_low make_floatx80(0xbfbf, 0x834972fe2d7bab1bULL)
1905 #define fyl2x_coeff_1 make_floatx80(0x3ffe, 0xf6384ee1d01febb8ULL)
1906 #define fyl2x_coeff_2 make_floatx80(0x3ffe, 0x93bb62877cdfa2e3ULL)
1907 #define fyl2x_coeff_3 make_floatx80(0x3ffd, 0xd30bb153d808f269ULL)
1908 #define fyl2x_coeff_4 make_floatx80(0x3ffd, 0xa42589eaf451499eULL)
1909 #define fyl2x_coeff_5 make_floatx80(0x3ffd, 0x864d42c0f8f17517ULL)
1910 #define fyl2x_coeff_6 make_floatx80(0x3ffc, 0xe3476578adf26272ULL)
1911 #define fyl2x_coeff_7 make_floatx80(0x3ffc, 0xc506c5f874e6d80fULL)
1912 #define fyl2x_coeff_8 make_floatx80(0x3ffc, 0xac5cf50cc57d6372ULL)
1913 #define fyl2x_coeff_9 make_floatx80(0x3ffc, 0xb1ed0066d971a103ULL)
1944 dexp = 0x3fff; in helper_fyl2x_common()
1945 shift128RightJamming(arg0_sig, 0, dexp - arg0_exp, &dsig0, &dsig1); in helper_fyl2x_common()
1946 sub128(0, 0, dsig0, dsig1, &dsig0, &dsig1); in helper_fyl2x_common()
1948 dexp = 0x4000; in helper_fyl2x_common()
1949 shift128RightJamming(arg0_sig, 0, dexp - arg0_exp, &dsig0, &dsig1); in helper_fyl2x_common()
1950 dsig0 |= 0x8000000000000000ULL; in helper_fyl2x_common()
1952 texp = arg0_exp - dexp + 0x3ffe; in helper_fyl2x_common()
1954 rsig1 = 0; in helper_fyl2x_common()
1955 rsig2 = 0; in helper_fyl2x_common()
1964 while ((int64_t) rsig0 < 0) { in helper_fyl2x_common()
1966 add192(rsig0, rsig1, rsig2, 0, dsig0, dsig1, in helper_fyl2x_common()
1978 texp + texp - 0x3ffe, in helper_fyl2x_common()
2009 shift128RightJamming(extractFloatx80Frac(accum), 0, in helper_fyl2x_common()
2013 bsig1 = 0; in helper_fyl2x_common()
2022 aexp += texp - 0x3ffe; in helper_fyl2x_common()
2052 } else if (arg0_exp > 0x3ffd || in helper_fyl2xp1()
2053 (arg0_exp == 0x3ffd && arg0_sig > (arg0_sign ? in helper_fyl2xp1()
2054 0x95f619980c4336f7ULL : in helper_fyl2xp1()
2055 0xd413cccfe7799211ULL))) { in helper_fyl2xp1()
2065 arg1_exp == 0x7fff) { in helper_fyl2xp1()
2072 } else if (arg0_exp < 0x3fb0) { in helper_fyl2xp1()
2079 if (arg0_exp == 0) { in helper_fyl2xp1()
2082 if (arg1_exp == 0) { in helper_fyl2xp1()
2089 exp += arg1_exp - 0x3ffe; in helper_fyl2xp1()
2109 if (arg1_exp == 0) { in helper_fyl2xp1()
2113 aexp += arg1_exp - 0x3ffe; in helper_fyl2xp1()
2184 ST1 = make_floatx80(arg1_sign ? 0x7fff : 0xffff, in helper_fyl2x()
2185 0x8000000000000000ULL); in helper_fyl2x()
2207 if (arg0_exp == 0) { in helper_fyl2x()
2210 if (arg1_exp == 0) { in helper_fyl2x()
2213 int_exp = arg0_exp - 0x3fff; in helper_fyl2x()
2214 if (arg0_sig > 0xb504f333f9de6484ULL) { in helper_fyl2x()
2230 if (int_exp != 0) { in helper_fyl2x()
2231 bool isign = (int_exp < 0); in helper_fyl2x()
2239 iexp = 0x403e - shift; in helper_fyl2x()
2243 add128(isig, 0, asig0, asig1, &asig0, &asig1); in helper_fyl2x()
2245 sub128(isig, 0, asig0, asig1, &asig0, &asig1); in helper_fyl2x()
2254 if (arg1_exp == 0) { in helper_fyl2x()
2258 aexp += arg1_exp - 0x3ffe; in helper_fyl2x()
2277 env->fpus &= ~0x4700; /* (C3,C2,C1,C0) <-- 0000 */ in helper_fsqrt()
2278 env->fpus |= 0x400; in helper_fsqrt()
2289 env->fpus |= 0x400; in helper_fsincos()
2294 env->fpus &= ~0x400; /* C2 <-- 0 */ in helper_fsincos()
2347 set_float_exception_flags(0, &env->fp_status); in helper_fscale()
2362 env->fpus |= 0x400; in helper_fsin()
2365 env->fpus &= ~0x400; /* C2 <-- 0 */ in helper_fsin()
2375 env->fpus |= 0x400; in helper_fcos()
2378 env->fpus &= ~0x400; /* C2 <-- 0 */ in helper_fcos()
2390 env->fpus &= ~0x4700; /* (C3,C2,C1,C0) <-- 0000 */ in helper_fxam_ST0()
2392 env->fpus |= 0x200; /* C1 <-- 1 */ in helper_fxam_ST0()
2396 env->fpus |= 0x4100; /* Empty */ in helper_fxam_ST0()
2402 if (MANTD(temp) == 0x8000000000000000ULL) { in helper_fxam_ST0()
2403 env->fpus |= 0x500; /* Infinity */ in helper_fxam_ST0()
2404 } else if (MANTD(temp) & 0x8000000000000000ULL) { in helper_fxam_ST0()
2405 env->fpus |= 0x100; /* NaN */ in helper_fxam_ST0()
2407 } else if (expdif == 0) { in helper_fxam_ST0()
2408 if (MANTD(temp) == 0) { in helper_fxam_ST0()
2409 env->fpus |= 0x4000; /* Zero */ in helper_fxam_ST0()
2411 env->fpus |= 0x4400; /* Denormal */ in helper_fxam_ST0()
2413 } else if (MANTD(temp) & 0x8000000000000000ULL) { in helper_fxam_ST0()
2414 env->fpus |= 0x400; in helper_fxam_ST0()
2425 fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; in do_fstenv()
2426 fptag = 0; in do_fstenv()
2427 for (i = 7; i >= 0; i--) { in do_fstenv()
2435 if (exp == 0 && mant == 0) { in do_fstenv()
2438 } else if (exp == 0 || exp == MAXEXPD in do_fstenv()
2439 || (mant & (1LL << 63)) == 0) { in do_fstenv()
2477 env->fpus = fpus & ~0x3800 & ~FPUS_B; in cpu_set_fpus()
2478 env->fpus |= env->fpus & FPUS_SE ? FPUS_B : 0; in cpu_set_fpus()
2500 for (i = 0; i < 8; i++) { in do_fldenv()
2521 for (int i = 0; i < 8; i++) { in do_fsave()
2546 for (int i = 0; i < 8; i++) { in do_frstor()
2570 fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; in do_xsave_fpu()
2571 fptag = 0; in do_xsave_fpu()
2572 for (i = 0; i < 8; i++) { in do_xsave_fpu()
2578 access_stw(ac, ptr + XO(legacy.ftw), fptag ^ 0xff); in do_xsave_fpu()
2583 access_stq(ac, ptr + XO(legacy.fpip), 0); /* eip+sel; rip */ in do_xsave_fpu()
2584 access_stq(ac, ptr + XO(legacy.fpdp), 0); /* edp+sel; rdp */ in do_xsave_fpu()
2588 for (i = 0; i < 8; i++) { in do_xsave_fpu()
2601 access_stl(ac, ptr + XO(legacy.mxcsr_mask), 0x0000ffff); in do_xsave_mxcsr()
2617 for (i = 0; i < nb_xmm_regs; i++) { in do_xsave_sse()
2618 access_stq(ac, addr, env->xmm_regs[i].ZMM_Q(0)); in do_xsave_sse()
2635 for (i = 0; i < nb_xmm_regs; i++, ptr += 16) { in do_xsave_ymmh()
2647 for (i = 0; i < 4; i++, addr += 16) { in do_xsave_bndregs()
2690 if (ptr & 0xf) { in helper_fxsave()
2707 if ((env->hflags & HF_MPX_IU_MASK) == 0) { in get_xinuse()
2800 fptag ^= 0xff; in do_xrstor_fpu()
2801 for (i = 0; i < 8; i++) { in do_xrstor_fpu()
2807 for (i = 0; i < 8; i++) { in do_xrstor_fpu()
2833 for (i = 0; i < nb_xmm_regs; i++) { in do_xrstor_sse()
2834 env->xmm_regs[i].ZMM_Q(0) = access_ldq(ac, addr); in do_xrstor_sse()
2850 for (i = 0; i < nb_xmm_regs; i++) { in do_clear_sse()
2851 env->xmm_regs[i].ZMM_Q(0) = 0; in do_clear_sse()
2852 env->xmm_regs[i].ZMM_Q(1) = 0; in do_clear_sse()
2867 for (i = 0; i < nb_xmm_regs; i++, ptr += 16) { in do_xrstor_ymmh()
2883 for (i = 0; i < nb_xmm_regs; i++) { in do_clear_ymmh()
2884 env->xmm_regs[i].ZMM_Q(2) = 0; in do_clear_ymmh()
2885 env->xmm_regs[i].ZMM_Q(3) = 0; in do_clear_ymmh()
2895 for (i = 0; i < 4; i++, addr += 16) { in do_xrstor_bndregs()
2939 if (ptr & 0xf) { in helper_fxrstor()
2969 return (xstate_bv & ~ac->env->xcr0) == 0; in valid_xrstor_header()
2982 memset(env->fpregs, 0, sizeof(env->fpregs)); in do_xrstor()
3007 memset(env->bnd_regs, 0, sizeof(env->bnd_regs)); in do_xrstor()
3015 memset(&env->bndcs_regs, 0, sizeof(env->bndcs_regs)); in do_xrstor()
3024 env->pkru = 0; in do_xrstor()
3071 do_fsave(&ac, 0, true); in cpu_x86_fsave()
3083 do_frstor(&ac, 0, true); in cpu_x86_frstor()
3095 do_fxsave(&ac, 0); in cpu_x86_fxsave()
3107 do_fxrstor(&ac, 0); in cpu_x86_fxrstor()
3121 assert((rfbm & ~env->xcr0) == 0); in cpu_x86_xsave()
3124 do_xsave_access(&ac, 0, rfbm, get_xinuse(env), rfbm); in cpu_x86_xsave()
3139 assert((rfbm & ~env->xcr0) == 0); in cpu_x86_xrstor()
3143 if (!valid_xrstor_header(&ac, &xstate_bv, 0)) { in cpu_x86_xrstor()
3146 do_xrstor(&ac, 0, rfbm, xstate_bv); in cpu_x86_xrstor()
3159 case 0: in helper_xgetbv()
3181 if (ecx != 0 || (mask & XSTATE_FP_MASK) == 0) { in helper_xsetbv()
3191 cpu_x86_cpuid(env, 0x0d, 0, &ena_lo, &dummy, &dummy, &ena_hi); in helper_xsetbv()
3215 #define SSE_DAZ 0x0040
3218 #define SSE_FZ 0x8000
3230 set_float_exception_flags((mxcsr & FPUS_IE ? float_flag_invalid : 0) | in update_mxcsr_status()
3231 (mxcsr & FPUS_ZE ? float_flag_divbyzero : 0) | in update_mxcsr_status()
3232 (mxcsr & FPUS_OE ? float_flag_overflow : 0) | in update_mxcsr_status()
3233 (mxcsr & FPUS_UE ? float_flag_underflow : 0) | in update_mxcsr_status()
3234 (mxcsr & FPUS_PE ? float_flag_inexact : 0), in update_mxcsr_status()
3238 set_flush_inputs_to_zero((mxcsr & SSE_DAZ) ? 1 : 0, &env->sse_status); in update_mxcsr_status()
3241 set_flush_to_zero((mxcsr & SSE_FZ) ? 1 : 0, &env->sse_status); in update_mxcsr_status()
3254 env->mxcsr |= ((flags & float_flag_invalid ? FPUS_IE : 0) | in update_mxcsr_from_sse_status()
3255 (flags & float_flag_divbyzero ? FPUS_ZE : 0) | in update_mxcsr_from_sse_status()
3256 (flags & float_flag_overflow ? FPUS_OE : 0) | in update_mxcsr_from_sse_status()
3257 (flags & float_flag_underflow ? FPUS_UE : 0) | in update_mxcsr_from_sse_status()
3258 (flags & float_flag_inexact ? FPUS_PE : 0) | in update_mxcsr_from_sse_status()
3260 0)); in update_mxcsr_from_sse_status()
3275 env->fpstt = 0; in helper_enter_mmx()
3276 *(uint32_t *)(env->fptags) = 0; in helper_enter_mmx()
3277 *(uint32_t *)(env->fptags + 4) = 0; in helper_enter_mmx()
3283 *(uint32_t *)(env->fptags) = 0x01010101; in helper_emms()
3284 *(uint32_t *)(env->fptags + 4) = 0x01010101; in helper_emms()
3287 #define SHIFT 0