22 #include <asm/uaccess.h>
30 #define DOUBLE_Emax 1023
31 #define DOUBLE_Ebias 1023
32 #define DOUBLE_Emin (-1022)
34 #define SINGLE_Emax 127
35 #define SINGLE_Ebias 127
36 #define SINGLE_Emin (-126)
70 if (!(ptr->
sigh & 0x80000000)) {
110 if ((m64 == 0) && (l64 == 0)) {
112 loaded_data->
sigh = 0x80000000;
113 loaded_data->
sigl = 0x00000000;
119 loaded_data->
sigh = (m64 << 11) | 0x80000000;
120 loaded_data->
sigh |= l64 >> 21;
121 loaded_data->
sigl = l64 << 11;
126 if ((m64 == 0) && (l64 == 0)) {
128 reg_copy(&
CONST_Z, loaded_data);
133 loaded_data->
sigh = m64 << 11;
134 loaded_data->
sigh |= l64 >> 21;
135 loaded_data->
sigl = l64 << 11;
137 return normalize_no_excep(loaded_data,
DOUBLE_Emin,
142 loaded_data->
sigh = (m64 << 11) | 0x80000000;
143 loaded_data->
sigh |= l64 >> 21;
144 loaded_data->
sigl = l64 << 11;
167 if (!(m32 & 0x7fffffff)) {
169 reg_copy(&
CONST_Z, loaded_data);
174 m32 = (m32 & 0x7fffff) << 8;
177 loaded_data->
sigh = m32;
178 loaded_data->
sigl = 0;
180 return normalize_no_excep(loaded_data,
SINGLE_Emin, negative)
186 loaded_data->
sigh = 0x80000000;
187 loaded_data->
sigl = 0x00000000;
193 loaded_data->
sigh = m32 | 0x80000000;
194 loaded_data->
sigl = 0;
198 loaded_data->
sigh = m32 | 0x80000000;
199 loaded_data->
sigl = 0;
235 return normalize_no_excep(st0_ptr, 63, sign);
250 reg_copy(&
CONST_Z, loaded_data);
261 loaded_data->
sigh =
s;
262 loaded_data->
sigl = 0;
264 return normalize_no_excep(loaded_data, 31, negative);
279 reg_copy(&
CONST_Z, loaded_data);
290 loaded_data->
sigh = s << 16;
291 loaded_data->
sigl = 0;
293 return normalize_no_excep(loaded_data, 15, negative);
308 for (pos = 8; pos >= 0; pos--) {
329 return normalize_no_excep(st0_ptr, 63, sign);
337 long double __user *
d)
381 unsigned long increment = 0;
389 reg_copy(st0_ptr, &tmp);
402 ((tmp.
sigh == 0x00100000) && (tmp.
sigl == 0)
403 && (st0_ptr->
sigl & 0x000007ff)))
419 if (tmp.
sigl & 0x000007ff) {
424 increment = ((tmp.
sigl & 0x7ff) > 0x400) |
425 ((tmp.
sigl & 0xc00) == 0xc00);
443 tmp.
sigl &= 0xfffff800;
446 if (tmp.
sigl >= 0xfffff800) {
448 if (tmp.
sigh == 0xffffffff) {
450 tmp.
sigh = 0x80000000;
457 tmp.
sigl = 0x00000000;
460 tmp.
sigl += 0x00000800;
466 l[0] = (tmp.
sigl >> 11) | (tmp.
sigh << 21);
467 l[1] = ((tmp.
sigh >> 11) & 0xfffff);
482 if (precision_loss) {
505 reg_copy(st0_ptr, &tmp);
509 }
else if (st0_tag ==
TW_NaN) {
512 && (st0_ptr->
sigh & 0x80000000)) {
515 (st0_ptr->
sigl >> 11) | (st0_ptr->
517 l[1] = ((st0_ptr->
sigh >> 11) & 0xfffff);
518 if (!(st0_ptr->
sigh & 0x40000000)) {
523 l[1] |= (0x40000000 >> 11);
544 1 + (
unsigned long __user *)dfloat);
566 unsigned long increment = 0;
573 reg_copy(st0_ptr, &tmp);
587 if (!((tmp.
sigl == 0x00800000) &&
588 ((st0_ptr->
sigh & 0x000000ff)
604 if (tmp.
sigl | (tmp.
sigh & 0x000000ff)) {
605 unsigned long sigh = tmp.
sigh;
606 unsigned long sigl = tmp.
sigl;
611 increment = ((sigh & 0xff) > 0x80)
612 ||(((sigh & 0xff) == 0x80) && sigl)
613 ||((sigh & 0x180) == 0x180);
617 ? 0 : (sigl | (sigh & 0xff));
621 ? (sigl | (sigh & 0xff)) : 0;
632 if (sigh >= 0xffffff00) {
634 tmp.
sigh = 0x80000000;
639 tmp.
sigh &= 0xffffff00;
643 tmp.
sigh &= 0xffffff00;
648 templ = (tmp.
sigh >> 8) & 0x007fffff;
663 if (precision_loss) {
678 reg_copy(st0_ptr, &tmp);
691 }
else if (st0_tag ==
TW_NaN) {
694 && (st0_ptr->
sigh & 0x80000000)) {
696 templ = st0_ptr->
sigh >> 8;
697 if (!(st0_ptr->
sigh & 0x40000000)) {
702 templ |= (0x40000000 >> 8);
728 (
unsigned long __user *)single);
761 goto invalid_operand;
766 goto invalid_operand;
770 reg_copy(st0_ptr, &t);
772 ((
long *)&tll)[0] = t.
sigl;
773 ((
long *)&tll)[1] = t.
sigh;
774 if ((precision_loss == 1) ||
775 ((t.
sigh & 0x80000000) &&
782 tll = 0x8000000000000000
LL;
810 goto invalid_operand;
815 goto invalid_operand;
819 reg_copy(st0_ptr, &t);
822 ((t.
sigl & 0x80000000) &&
856 goto invalid_operand;
861 goto invalid_operand;
865 reg_copy(st0_ptr, &t);
868 ((t.
sigl & 0xffff8000) &&
897 unsigned long long ll;
899 int i, precision_loss;
905 goto invalid_operand;
910 goto invalid_operand;
914 reg_copy(st0_ptr, &t);
919 if ((t.
sigh > 0x0de0b6b3) ||
920 ((t.
sigh == 0x0de0b6b3) && (t.
sigl > 0xa763ffff))) {
928 for (i = 0; i < 7; i++)
937 }
else if (precision_loss) {
945 for (i = 0; i < 9; i++) {
986 very_big = !(~(r->
sigh) | ~(r->
sigl));
987 #define half_or_more (eax & 0x80000000)
988 #define frac_part (eax)
989 #define more_than_half ((eax & 0x80000001) == 0x80000001)
1028 unsigned short tag_word = 0;
1041 (
unsigned short __user *)(s + 6));
1043 (
unsigned short __user *)(s + 8));
1045 (
unsigned short __user *)(s + 0x0a));
1047 (
unsigned short __user *)(s + 0x0c));
1063 (
unsigned long __user *)(s + 0x0c));
1065 (
unsigned short __user *)(s + 0x10));
1067 (
unsigned short __user *)(s + 0x12));
1069 (
unsigned long __user *)(s + 0x14));
1071 (
unsigned long __user *)(s + 0x18));
1087 for (i = 0; i < 8; i++) {
1133 for (i = 0; i < 8; i++) {
1134 regnr = (i +
top) & 7;
1157 (
unsigned short __user *)(d + 6));
1159 (
unsigned short __user *)(d + 0x0a));
1163 (
unsigned short __user *)(d + 8));
1165 (
unsigned short __user *)(d + 0x0c));
1168 (
unsigned short __user *)(d + 8));
1170 (
unsigned short __user *)(d + 0x0c));
1183 I387->soft.fcs &= ~0xf8000000;
1184 I387->soft.fos |= 0xffff0000;
1203 d =
fstenv(addr_modes, data_address);