OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libcpu/] [m68k/] [m68040/] [fpsp/] [x_unimp.S] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.