x_unimp.S 2.0 KB

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