Skip to content

Commit f69a691

Browse files
committed
First set of files pulled from VM Workshop VMARC archive
1 parent 5e30a20 commit f69a691

File tree

223 files changed

+29491
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+29491
-0
lines changed

vmworkshop-vmarcs/1995/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Source
2+
3+
Code from VMARCs distributed as part of the 1995 VM Workshop.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# ibm-cray(3,L) - IBM-Cray data conversion
2+
3+
"", 3 June 1991
4+
5+
6+
<a name="purpose-"></a>
7+
8+
# Purpose
9+
10+
Converts arrays of floating point numbers between IBM and Cray data formats.
11+
12+
<a name="library"></a>
13+
14+
# Library
15+
16+
faux, Cornell's Fortran Auxiliary Subroutine Library (libfaux.a)
17+
18+
<a name="syntax"></a>
19+
20+
# Syntax
21+
22+
```
23+
call cfdc(ibm, cray, n)
24+
25+
call cfcd(cray, ibm, n)
26+
27+
where:
28+
ibm Array of IBM floating point numbers, REAL*8 values.
29+
cray Array of CRAY floating point numbers.
30+
n Number of elements in arrays to convert, integer.
31+
```
32+
33+
<a name="description"></a>
34+
35+
# Description
36+
37+
cfdc converts floating point double precision numbers to Cray floating point numbers
38+
39+
cfcd converts floating point Cray numbers to floating point double precision IBM numbers
40+
41+
Routines are written in VS FORTRAN and thus are available for both CMS and AIX/370 systems. They could be compiled by either 'fortvs' command under VM/CMS or 'fvs' command under AIX/370.
42+
43+
Precision of the conversion is the best possible. When floating point formats differ in number of bits for mantissa, which affects data precision, the least mantissa bits are rounded. When formats differ in number of bits for exponent, which affects the range of data, the biggest possible value or zero value is assigned if the old number can't be represented.
44+
45+
Routines convert data in memory and must be invoked with three arguments: input array name, output array name, and number of elements in each of two arrays. When called from a C program, the last parameter must be passed by the pointer. The same variable name can be used for the first and the second arguments. This means that conversion can be done "in place" thus saving memory space, if necessary.
46+
47+
The table below shows a summary of conversion time per element in microseconds of virtual cpu time on a 3090 J processor. Each entry represents the average value of one thousand conversions of an array with a thousand elements.
48+
49+
```
50+
----------------------------------
51+
| Routine name | Time to convert |
52+
----------------------------------
53+
| cfdc | 0.83 |
54+
| cfcd | 0.75 |
55+
----------------------------------
56+
```
57+
58+
<a name="notes"></a>
59+
60+
# Notes
61+
62+
1. Non-normalized numbers with zero exponents are kept intact.
63+
64+
2. In IBM to CRAY conversion, precision in the mantissa could be lost by rounding off the least significant bits. 0 &lt;= |error| &lt;= .18E-14 (From 5 to 8 least significant bits out of 56 mantissa bits could be rounded.)
65+
66+
3. CRAY to IBM conversion does not incur the lost of mantissa accuracy.
67+
68+
4. CRAY values that don't fit IBM standard are converted to either the biggest IBM values (positive or negative) or to zero.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
* ------------------------------------------------------------------- *
2+
* *
3+
* copyright - virtual machine / system product *
4+
* contains restricted materials of cornell university *
5+
* 5664-167 (c) copyright cornell university 1990 *
6+
* licensed materials - property of cornell university *
7+
* refer to copyright instructions *
8+
* form number g120-2083 *
9+
* ------------------------------------------------------------------- *
10+
* processor - assebmler release 5.0 5/1/83 under aix/370 *
11+
* *
12+
* dependences - none *
13+
* *
14+
* attributes - reenterant *
15+
* *
16+
* entry point - _cfcd_ *
17+
* *
18+
* errors - not found *
19+
* *
20+
* 06/16/89 valery i. garger, technology integration *
21+
* group, cnsf, cornell university *
22+
* ------------------------------------------------------------------- *
23+
* change log: some minor changes and bugs fixed 09/13/89 *
24+
* converted to aix/370 05/01/90 *
25+
* valery garger *
26+
* ------------------------------------------------------------------- *
27+
* convert floating point, cray 64-bit to ibm 64-bit (fortran real*8). *
28+
* call this subroutine by: *
29+
* *
30+
* call cfcd(cray, ibm, n) *
31+
* *
32+
* input: cray array of 64-bit cray floating point numbers. *
33+
* n number of elements in cray to convert, integer. *
34+
* output:ibm array of ibm floating point numbers, real*8 values. *
35+
* *
36+
* format (bits, left to right): | exponent bias: *
37+
* sign exponent mantissa | *
38+
* ibm 1 7 56 | 64 hex *
39+
* cray 1 15 48 | 16384 binary *
40+
* | *
41+
* latency: 1.064 microsecond per conversion of one element *
42+
* on one of the ibm 3090-600e processors. *
43+
* *
44+
* usage notes: *
45+
* 1. cray values that doesn't fit ibm standard are converted to *
46+
* either the biggest ibm values (positive or negative) or to zero. *
47+
* 2. non-normalized numbers with zero exponents are kept intact *
48+
* (suspected to be integer values). *
49+
* 3. conversion does not incur the lost of mantissa accuracy. *
50+
* ------------------------------------------------------------------- *
51+
_cfcd_ csect
52+
entry _cfcd_
53+
b 34(,15)
54+
dc al1(6+22)
55+
dc cl6'cfcd '
56+
dc cl22'05-01-90/vesion#1.9'
57+
stm 2,15,x'10'(13)
58+
lr 12,13
59+
la 11,x'68'
60+
slr 13,11
61+
st 12,4(13)
62+
lr 12,15
63+
using _cfcd_,12
64+
* -----------------------------------------------
65+
lr 4,2 pointer to n
66+
lr 3,1 pointer to ibm
67+
lr 2,0 pointer to cray
68+
l 4,00(,4) g4: n
69+
next ds 0h do j = 1,n
70+
lm 8,9,00(2) gr8,gr9: for tiss, now intact
71+
lr 6,8
72+
n 6,=x'80000000' gr6: sign
73+
lr 7,8
74+
n 7,=x'7fff0000' gr7: exponent
75+
lr 1,8
76+
n 1,=x'00008000' gr1: nrmbit
77+
or 1,7
78+
bz done if so, keep intact
79+
n 8,=x'0000ffff' tiss(1)
80+
expon ds 0h
81+
srl 7,16
82+
s 7,=f'16128' exp = exp - 16384 + 256
83+
lr 5,7
84+
n 5,=f'3' .and. last two bits
85+
bz *+8 avoid if mod(exp,4)=0
86+
a 7,=f'4' +1 to next to two last bits
87+
sra 7,2 see whole new exponent
88+
ltr 7,7
89+
bnm expos to exponet is positive
90+
sr 8,8
91+
sr 9,9
92+
b strsgn store zero w/sign
93+
expos ds 0h exp is pos
94+
c 7,=f'127'
95+
bnp exprng to exponent in a range
96+
l 8,=x'7fffffff'
97+
l 9,=x'ffffffff'
98+
b strsgn
99+
exprng ds 0h
100+
sll 7,24 exponent on place
101+
tissa ds 0h
102+
sldl 8,5 at least on 5 bits left
103+
ltr 5,5
104+
bnz *+8
105+
la 5,4
106+
s 5,=f'1'
107+
bz *+8
108+
sldl 8,00(5) logically double
109+
store ds 0h
110+
or 8,7
111+
strsgn or 8,6
112+
done stm 8,9,00(3)
113+
la 2,8(2)
114+
la 3,8(3)
115+
bct 4,next enddo
116+
* --------- epiloge -----------------------------------------------
117+
exit lm 2,14,x'78'(13)
118+
br 14
119+
end

0 commit comments

Comments
 (0)