1 * $NetBSD: x_unimp.sa,v 1.2 1994/10/26 07:50:32 cgd Exp $
3 * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
4 * M68000 Hi-Performance Microprocessor Division
5 * M68040 Software Package
7 * M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
10 * THE SOFTWARE is provided on an "AS IS" basis and without warranty.
11 * To the maximum extent permitted by applicable law,
12 * MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
13 * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
14 * PARTICULAR PURPOSE and any warranty against infringement with
15 * regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
16 * and any accompanying written materials.
18 * To the maximum extent permitted by applicable law,
19 * IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
20 * (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
21 * PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
22 * OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
23 * SOFTWARE. Motorola assumes no responsibility for the maintenance
24 * and support of the SOFTWARE.
26 * You are hereby granted a copyright license to use, modify, and
27 * distribute the SOFTWARE so long as this entire notice is retained
28 * without alteration in any modified and/or redistributed versions,
29 * and that such modified versions are clearly identified as such.
30 * No licenses are granted by implication, estoppel or otherwise
31 * under any patents or trademarks of Motorola, Inc.
34 * x_unimp.sa 3.3 7/1/91
36 * fpsp_unimp --- FPSP handler for unimplemented instruction
39 * Invoked when the user program encounters a floating-point
40 * op-code that hardware does not support. Trap vector# 11
41 * (See table 8-1 MC68030 User's Manual).
44 * Note: An fsave for an unimplemented inst. will create a short
47 * Input: 1. Six word stack frame for unimplemented inst, four word
49 * (See table 8-7 MC68030 User's Manual).
50 * 2. Unimp (short) fsave state frame created here by fsave
54 X_UNIMP IDNT 2,1 Motorola 040 Floating Point Software Package
72 movem.l d0-d1/a0-a1,USER_DA(a6)
73 fmovem.x fp0-fp3,USER_FP0(a6)
74 fmovem.l fpcr/fpsr/fpiar,USER_FPCR(a6)
75 move.b (a7),d0 ;test for valid version num
76 andi.b #$f0,d0 ;test for $4x
77 cmpi.b #VER_4,d0 ;must be $4x or exit
81 * The following lines are used to ensure that the FPSR
82 * exception byte and condition codes are clear before proceeding
84 move.l USER_FPSR(a6),d0
85 and.l #$FF00FF,d0 ;clear all but accrued exceptions
86 move.l d0,USER_FPSR(a6)
87 fmove.l #0,FPSR ;clear all user bits
88 fmove.l #0,FPCR ;clear all user exceptions for FPSP
90 clr.b UFLG_TMP(a6) ;clr flag for unsupp data
92 bsr.l get_op ;go get operand(s)
94 bsr.l do_func ;do the function
95 fsave -(a7) ;capture possible exc state
97 bne.b no_store ;if STORE_FLG is set, no store
98 bsr.l sto_res ;store the result in user space
100 bra.l gen_except ;post any exceptions and return