2 | x_unimp.sa 3.3 7/1/91
4 | fpsp_unimp --- FPSP handler for unimplemented instruction
7 | Invoked when the user program encounters a floating-point
8 | op-code that hardware does not support. Trap vector# 11
9 | (See table 8-1 MC68030 User's Manual).
12 | Note: An fsave for an unimplemented inst. will create a short
15 | Input: 1. Six word stack frame for unimplemented inst, four word
17 | (See table 8-7 MC68030 User's Manual).
18 | 2. Unimp (short) fsave state frame created here by fsave
22 | Copyright (C) Motorola, Inc. 1990
25 | For details on the license for this file, please see the
26 | file, README, in this same directory.
28 X_UNIMP: |idnt 2,1 | Motorola 040 Floating Point Software Package
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 moveb (%a7),%d0 |test for valid version num
50 andib #0xf0,%d0 |test for $4x
51 cmpib #VER_4,%d0 |must be $4x or exit
55 | The following lines are used to ensure that the FPSR
56 | exception byte and condition codes are clear before proceeding
58 movel USER_FPSR(%a6),%d0
59 andl #0xFF00FF,%d0 |clear all but accrued exceptions
60 movel %d0,USER_FPSR(%a6)
61 fmovel #0,%FPSR |clear all user bits
62 fmovel #0,%FPCR |clear all user exceptions for FPSP
64 clrb UFLG_TMP(%a6) |clr flag for unsupp data
66 bsrl get_op |go get operand(s)
68 bsrl do_func |do the function
69 fsave -(%a7) |capture possible exc state
71 bnes no_store |if STORE_FLG is set, no store
72 bsrl sto_res |store the result in user space
74 bral gen_except |post any exceptions and return