20 #include <linux/signal.h>
22 #include <asm/uaccess.h>
44 printk(
"Unimplemented FPU Opcode at eip=%p : ", (
void __user *)address);
48 if ((byte1 & 0xf8) == 0xd8)
56 if (FPU_modrm >= 0300)
57 printk(
"%02x (%02x+%d)\n", FPU_modrm, FPU_modrm & 0xf8,
60 printk(
"/%d\n", (FPU_modrm >> 3) & 7);
84 static const char *tag_desc[] = {
"Valid",
"Zero",
"ERROR",
"Empty",
85 "DeNorm",
"Inf",
"NaN"
92 printk(
"At %p:", (
void *)address);
94 #define MAX_PRINTED_BYTES 20
97 if ((byte1 & 0xf8) == 0xd8) {
104 if (i == MAX_PRINTED_BYTES)
109 if (FPU_modrm >= 0300)
110 printk(
" %02x (%02x+%d)\n", FPU_modrm,
111 FPU_modrm & 0xf8, FPU_modrm & 7);
113 printk(
" /%d, mod=%d rm=%d\n",
114 (FPU_modrm >> 3) & 7,
115 (FPU_modrm >> 6) & 3, FPU_modrm & 7);
125 printk(
"SW: backward compatibility\n");
127 printk(
"SW: condition bit 3\n");
129 printk(
"SW: condition bit 2\n");
131 printk(
"SW: condition bit 1\n");
133 printk(
"SW: condition bit 0\n");
135 printk(
"SW: exception summary\n");
137 printk(
"SW: stack fault\n");
139 printk(
"SW: loss of precision\n");
141 printk(
"SW: underflow\n");
145 printk(
"SW: divide by zero\n");
147 printk(
"SW: denormalized operand\n");
149 printk(
"SW: invalid operation\n");
152 printk(
" SW: b=%d st=%d es=%d sf=%d cc=%d%d%d%d ef=%d%d%d%d%d%d\n",
partial_status & 0x8000 ? 1 : 0,
165 printk(
" CW: ic=%d rc=%d%d pc=%d%d iem=%d ef=%d%d%d%d%d%d\n",
177 for (i = 0; i < 8; i++) {
188 printk(
"st(%d) %c .%04lx %04lx %04lx %04lx e%+-6d ", i,
190 (
long)(r->
sigh >> 16),
191 (
long)(r->
sigh & 0xFFFF),
192 (
long)(r->
sigl >> 16),
193 (
long)(r->
sigl & 0xFFFF),
197 printk(
"Whoops! Error in errors.c: tag%d is %d ", i,
202 printk(
"%s\n", tag_desc[(
int)(
unsigned)tagi]);
212 } exception_names[] = {
333 #ifdef PRINT_MESSAGES
339 for (i = 0; exception_names[
i].type; i++)
340 if ((exception_names[i].
type & n) ==
341 exception_names[i].
type)
344 if (exception_names[i].type) {
345 #ifdef PRINT_MESSAGES
346 printk(
"FP Exception: %s!\n", exception_names[i].
name);
349 printk(
"FPU emulator: Unknown Exception: 0x%04x!\n", n);
351 if (n == EX_INTERNAL) {
352 printk(
"FPU emulator: Internal error type 0x%04x\n",
356 #ifdef PRINT_MESSAGES
379 int signalling,
isNaN;
385 signalling = isNaN && !(a->
sigh & 0x40000000);
402 if (!(a->
sigh & 0x80000000)) {
406 a->
sigh |= 0x40000000;
417 int deststnr,
FPU_REG const *defaultNaN)
423 int signalling, unsupported;
431 unsupported = ((taga ==
TW_NaN)
433 && (a->
sigh & 0x80000000)))
449 signalling = !(a->
sigh & b->
sigh & 0x40000000);
459 signalling = !(a->
sigh & 0x40000000);
466 signalling = !(b->
sigh & 0x40000000);
481 if (!(x->
sigh & 0x80000000))
490 dest->
sigh |= 0x40000000;