aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/fpsp040/x_unsupp.S
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/m68k/fpsp040/x_unsupp.S
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/m68k/fpsp040/x_unsupp.S')
-rw-r--r--arch/m68k/fpsp040/x_unsupp.S83
1 files changed, 83 insertions, 0 deletions
diff --git a/arch/m68k/fpsp040/x_unsupp.S b/arch/m68k/fpsp040/x_unsupp.S
new file mode 100644
index 000000000000..4ec57285b683
--- /dev/null
+++ b/arch/m68k/fpsp040/x_unsupp.S
@@ -0,0 +1,83 @@
1|
2| x_unsupp.sa 3.3 7/1/91
3|
4| fpsp_unsupp --- FPSP handler for unsupported data type exception
5|
6| Trap vector #55 (See table 8-1 Mc68030 User's manual).
7| Invoked when the user program encounters a data format (packed) that
8| hardware does not support or a data type (denormalized numbers or un-
9| normalized numbers).
10| Normalizes denorms and unnorms, unpacks packed numbers then stores
11| them back into the machine to let the 040 finish the operation.
12|
13| Unsupp calls two routines:
14| 1. get_op - gets the operand(s)
15| 2. res_func - restore the function back into the 040 or
16| if fmove.p fpm,<ea> then pack source (fpm)
17| and store in users memory <ea>.
18|
19| Input: Long fsave stack frame
20|
21|
22
23| Copyright (C) Motorola, Inc. 1990
24| All Rights Reserved
25|
26| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
27| The copyright notice above does not evidence any
28| actual or intended publication of such source code.
29
30X_UNSUPP: |idnt 2,1 | Motorola 040 Floating Point Software Package
31
32 |section 8
33
34#include "fpsp.h"
35
36 |xref get_op
37 |xref res_func
38 |xref gen_except
39 |xref fpsp_fmt_error
40
41 .global fpsp_unsupp
42fpsp_unsupp:
43|
44 link %a6,#-LOCAL_SIZE
45 fsave -(%a7)
46 moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
47 fmovemx %fp0-%fp3,USER_FP0(%a6)
48 fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
49
50
51 moveb (%a7),VER_TMP(%a6) |save version number
52 moveb (%a7),%d0 |test for valid version num
53 andib #0xf0,%d0 |test for $4x
54 cmpib #VER_4,%d0 |must be $4x or exit
55 bnel fpsp_fmt_error
56
57 fmovel #0,%FPSR |clear all user status bits
58 fmovel #0,%FPCR |clear all user control bits
59|
60| The following lines are used to ensure that the FPSR
61| exception byte and condition codes are clear before proceeding,
62| except in the case of fmove, which leaves the cc's intact.
63|
64unsupp_con:
65 movel USER_FPSR(%a6),%d1
66 btst #5,CMDREG1B(%a6) |looking for fmove out
67 bne fmove_con
68 andl #0xFF00FF,%d1 |clear all but aexcs and qbyte
69 bras end_fix
70fmove_con:
71 andl #0x0FFF40FF,%d1 |clear all but cc's, snan bit, aexcs, and qbyte
72end_fix:
73 movel %d1,USER_FPSR(%a6)
74
75 st UFLG_TMP(%a6) |set flag for unsupp data
76
77 bsrl get_op |everything okay, go get operand(s)
78 bsrl res_func |fix up stack frame so can restore it
79 clrl -(%a7)
80 moveb VER_TMP(%a6),(%a7) |move idle fmt word to top of stack
81 bral gen_except
82|
83 |end