1: /*
2: * Program: ultof.s
3: * Copyright 1993, GTE Government Systems
4: * Author: Steven M. Schultz
5: *
6: * Version Date Modification
7: * 0.0 02Feb91 1. Initial inspiration struck.
8: * 1.0 05Jun93 2. Released into the Public Domain.
9: */
10:
11: #include "DEFS.h"
12:
13: /*
14: * All routines have both a C interface and an assembly interface. Normally
15: * the two are the same. In the case of 'ulsh' the compiler has placed one
16: * of the operands in r0 and r1 so the assembly interface differs from the
17: * C interface.
18: */
19:
20: #define twogig 050000
21:
22: #if !defined(KERNEL)
23: /*
24: * float ultof(lhs)
25: * u_long lhs;
26: *
27: * unsigned 32-bit long to floating conversion. Calls to ultof generated
28: * automatically by the C compiler. This routine is purposefully
29: * not defined for the kernel since the kernel shouldn't (can't) do
30: * FP arithmetic.
31: */
32:
33: .globl ultof
34: ultof:
35: ENTRY(ultof)
36: jsr pc,l2f / 2(sp) -> fr0
37: seti
38: rts pc
39:
40: /*
41: * Common sequences used more than once. Moved here to save space at the
42: * expense of a jsr+rts. Both do a 'setl', the caller must do a 'seti'.
43: * Not for the kernel until the kernel can do FP arithmetic.
44: */
45:
46: ASENTRY(l2f)
47: setl
48: tst 4(sp)
49: bpl 1f
50: bic $100000,4(sp)
51: movif 4(sp),fr0
52: addf $twogig,fr0
53: rts pc
54: 1:
55: movif 4(sp),fr0
56: rts pc
57:
58: ASENTRY(l6f)
59: setl
60: tst 8.(sp)
61: bpl 1f
62: bic $100000,8.(sp)
63: movif 8.(sp),fr3
64: addf $twogig,fr3
65: rts pc
66: 1:
67: movif 8.(sp),fr3
68: rts pc
69: #endif KERNEL
Defined functions
l2f
defined in line
46; used 1 times
l6f
defined in line
58;
never used
ultof
declared in line
33; defined in line
34; used 1 times
Defined macros