Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:49

0001 #include "fpsp-namespace.h"
0002 //
0003 //
0004 //  sto_res.sa 3.1 12/10/90
0005 //
0006 //  Takes the result and puts it in where the user expects it.
0007 //  Library functions return result in fp0. If fp0 is not the
0008 //  users destination register then fp0 is moved to the the
0009 //  correct floating-point destination register.  fp0 and fp1
0010 //  are then restored to the original contents.
0011 //
0012 //  Input:  result in fp0,fp1
0013 //
0014 //      d2 & a0 should be kept unmodified
0015 //
0016 //  Output: moves the result to the true destination reg or mem
0017 //
0018 //  Modifies: destination floating point register
0019 //
0020 
0021 //      Copyright (C) Motorola, Inc. 1990
0022 //          All Rights Reserved
0023 //
0024 //  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
0025 //  The copyright notice above does not evidence any
0026 //  actual or intended publication of such source code.
0027 
0028 STO_RES:    //idnt  2,1 | Motorola 040 Floating Point Software Package
0029 
0030 
0031     |section    8
0032 
0033 #include "fpsp.defs"
0034 
0035     .global sto_cos
0036 sto_cos:
0037     bfextu      CMDREG1B(%a6){#13:#3},%d0   //extract cos destination
0038     cmpib       #3,%d0      //check for fp0/fp1 cases
0039     bles        c_fp0123
0040     fmovemx %fp1-%fp1,-(%a7)
0041     moveql      #7,%d1
0042     subl        %d0,%d1     //d1 = 7- (dest. reg. no.)
0043     clrl        %d0
0044     bsetl       %d1,%d0     //d0 is dynamic register mask
0045     fmovemx (%a7)+,%d0
0046     rts
0047 c_fp0123:
0048     cmpib       #0,%d0
0049     beqs        c_is_fp0
0050     cmpib       #1,%d0
0051     beqs        c_is_fp1
0052     cmpib       #2,%d0
0053     beqs        c_is_fp2
0054 c_is_fp3:
0055     fmovemx %fp1-%fp1,USER_FP3(%a6)
0056     rts
0057 c_is_fp2:
0058     fmovemx %fp1-%fp1,USER_FP2(%a6)
0059     rts
0060 c_is_fp1:
0061     fmovemx %fp1-%fp1,USER_FP1(%a6)
0062     rts
0063 c_is_fp0:
0064     fmovemx %fp1-%fp1,USER_FP0(%a6)
0065     rts
0066 
0067 
0068     .global sto_res
0069 sto_res:
0070     bfextu      CMDREG1B(%a6){#6:#3},%d0    //extract destination register
0071     cmpib       #3,%d0      //check for fp0/fp1 cases
0072     bles        fp0123
0073     fmovemx %fp0-%fp0,-(%a7)
0074     moveql      #7,%d1
0075     subl        %d0,%d1     //d1 = 7- (dest. reg. no.)
0076     clrl        %d0
0077     bsetl       %d1,%d0     //d0 is dynamic register mask
0078     fmovemx (%a7)+,%d0
0079     rts
0080 fp0123:
0081     cmpib       #0,%d0
0082     beqs        is_fp0
0083     cmpib       #1,%d0
0084     beqs        is_fp1
0085     cmpib       #2,%d0
0086     beqs        is_fp2
0087 is_fp3:
0088     fmovemx %fp0-%fp0,USER_FP3(%a6)
0089     rts
0090 is_fp2:
0091     fmovemx %fp0-%fp0,USER_FP2(%a6)
0092     rts
0093 is_fp1:
0094     fmovemx %fp0-%fp0,USER_FP1(%a6)
0095     rts
0096 is_fp0:
0097     fmovemx %fp0-%fp0,USER_FP0(%a6)
0098     rts
0099 
0100     |end