^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) | x_unimp.sa 3.3 7/1/91
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) | fpsp_unimp --- FPSP handler for unimplemented instruction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) | exception.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) | Invoked when the user program encounters a floating-point
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) | op-code that hardware does not support. Trap vector# 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) | (See table 8-1 MC68030 User's Manual).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) | Note: An fsave for an unimplemented inst. will create a short
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) | fsave stack.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) | Input: 1. Six word stack frame for unimplemented inst, four word
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) | for illegal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) | (See table 8-7 MC68030 User's Manual).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) | 2. Unimp (short) fsave state frame created here by fsave
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) | instruction.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) | Copyright (C) Motorola, Inc. 1990
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) | All Rights Reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) | For details on the license for this file, please see the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) | file, README, in this same directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) X_UNIMP: |idnt 2,1 | Motorola 040 Floating Point Software Package
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) |section 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #include "fpsp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) |xref get_op
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) |xref do_func
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) |xref sto_res
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) |xref gen_except
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) |xref fpsp_fmt_error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) .global fpsp_unimp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) .global uni_2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) fpsp_unimp:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) link %a6,#-LOCAL_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) fsave -(%a7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) uni_2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) moveml %d0-%d1/%a0-%a1,USER_DA(%a6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) fmovemx %fp0-%fp3,USER_FP0(%a6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) moveb (%a7),%d0 |test for valid version num
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) andib #0xf0,%d0 |test for $4x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) cmpib #VER_4,%d0 |must be $4x or exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) bnel fpsp_fmt_error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) | Temporary D25B Fix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) | The following lines are used to ensure that the FPSR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) | exception byte and condition codes are clear before proceeding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) movel USER_FPSR(%a6),%d0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) andl #0xFF00FF,%d0 |clear all but accrued exceptions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) movel %d0,USER_FPSR(%a6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) fmovel #0,%FPSR |clear all user bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) fmovel #0,%FPCR |clear all user exceptions for FPSP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) clrb UFLG_TMP(%a6) |clr flag for unsupp data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) bsrl get_op |go get operand(s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) clrb STORE_FLG(%a6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) bsrl do_func |do the function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) fsave -(%a7) |capture possible exc state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) tstb STORE_FLG(%a6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) bnes no_store |if STORE_FLG is set, no store
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) bsrl sto_res |store the result in user space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) no_store:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) bral gen_except |post any exceptions and return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) |end