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