1 * $NetBSD: sto_res.sa,v 1.4 2000/03/13 23:52:32 soren Exp $
3 * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
4 * M68000 Hi-Performance Microprocessor Division
5 * M68040 Software Package
7 * M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
10 * THE SOFTWARE is provided on an "AS IS" basis and without warranty.
11 * To the maximum extent permitted by applicable law,
12 * MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
13 * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
14 * PARTICULAR PURPOSE and any warranty against infringement with
15 * regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
16 * and any accompanying written materials.
18 * To the maximum extent permitted by applicable law,
19 * IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
20 * (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
21 * PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
22 * OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
23 * SOFTWARE. Motorola assumes no responsibility for the maintenance
24 * and support of the SOFTWARE.
26 * You are hereby granted a copyright license to use, modify, and
27 * distribute the SOFTWARE so long as this entire notice is retained
28 * without alteration in any modified and/or redistributed versions,
29 * and that such modified versions are clearly identified as such.
30 * No licenses are granted by implication, estoppel or otherwise
31 * under any patents or trademarks of Motorola, Inc.
34 * sto_res.sa 3.1 12/10/90
36 * Takes the result and puts it in where the user expects it.
37 * Library functions return result in fp0. If fp0 is not the
38 * users destination register then fp0 is moved to the
39 * correct floating-point destination register. fp0 and fp1
40 * are then restored to the original contents.
42 * Input: result in fp0,fp1
44 * d2 & a0 should be kept unmodified
46 * Output: moves the result to the true destination reg or mem
48 * Modifies: destination floating point register
51 STO_RES IDNT 2,1 Motorola 040 Floating Point Software Package
60 bfextu CMDREG1B(a6){13:3},d0 ;extract cos destination
61 cmpi.b #3,d0 ;check for fp0/fp1 cases
65 sub.l d0,d1 ;d1 = 7- (dest. reg. no.)
67 bset.l d1,d0 ;d0 is dynamic register mask
78 fmovem.x fp1,USER_FP3(a6)
81 fmovem.x fp1,USER_FP2(a6)
84 fmovem.x fp1,USER_FP1(a6)
87 fmovem.x fp1,USER_FP0(a6)
93 bfextu CMDREG1B(a6){6:3},d0 ;extract destination register
94 cmpi.b #3,d0 ;check for fp0/fp1 cases
98 sub.l d0,d1 ;d1 = 7- (dest. reg. no.)
100 bset.l d1,d0 ;d0 is dynamic register mask
111 fmovem.x fp0,USER_FP3(a6)
114 fmovem.x fp0,USER_FP2(a6)
117 fmovem.x fp0,USER_FP1(a6)
120 fmovem.x fp0,USER_FP0(a6)