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