~ubuntu-branches/ubuntu/intrepid/xulrunner-1.9/intrepid

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/freebl/mpi/hppa20.s

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Alexander Sack, Fabien Tassin
  • Date: 2008-02-13 11:47:21 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080213114721-7om0mgzngvuk9czv
Tags: 1.9~b3+nobinonly-0ubuntu1
* release FIREFOX_3_0b3_RELEASE

[ Alexander Sack ]
* submit patch that ships xpcshell to bugzilla
  - rename debian/patches/ship_xpcshell.patch =>
           debian/patches/bz410617_att295212_ship_xpcshell.patch
  - update debian/patches/series
* fix tooltip in epiphany: previously displayed out of screen bounds
  (LP: #37507)
  - add debian/patches/bz233371_att297343_fix_outofscreen_embed_tooltip.patch
  - update debian/patches/series
* use default upstream gcc tweaks for improved performance - especially of the
  javascript engine
  - update debian/rules
* update global extension/plugin patch to apply cleanly against latest code
  - update debian/patches/bzXXX_gre_extension_plugin_support.patch
* fix pyxpcom build failure introduced by recent commit
  - add debian/patches/bzXXX_fix_pyxpcom_build_failure.patch
  - update debian/patches/series
* add distro independent global install locations for extensions,
  /usr/lib/mozilla/extensions and /usr/share/mozilla/extensions
  - update debian/xulrunner-1.9.dirs
* support embedded tarball layout when either there is a *.tar.bz2 in orig tarball
  or if DEBIAN_MOZCLIENT_EMBEDDED is not unset (you will need this to produce embedded
  tarballs during |get-orig-source|
  - update debian/rules
* bump minimum libnss3-dev build requirements to >= 3.12.0~1.9b3
  - update debian/control
* bump minimum libnspr4-dev build requirements to >= 4.7.0~1.9b3
  - update debian/control

[ Fabien Tassin ]
* Drop patches applied upstream
  - drop debian/patches/bz410617_att295212_ship_xpcshell.patch
  - drop debian/patches/bz404634_att294921.patch
  - drop debian/patches/bz386610_python2.5_ftbfs_amd64.patch
  - drop debian/patches/bz373918_att295042.patch
  - drop debian/patches/bz408062_unstable_pc.patch
  - drop debian/patches/bz384304_fix_recursive_symlinks.patch
  - update debian/patches/series
* Refresh diverged patches:
  - update debian/patches/bzXXX_pc_honour_system_nspr_nss.patch
  - update debian/patches/rename_venkman_addon.patch
  - update debian/patches/bz344818_cairo_xrender.patch
* Install links for all .so libs in the -dev package
  - update debian/patches/dont_install_so_in_dev.patch
* Bump gtk requirement to 2.12 as per Mozilla bug 412432
  - update debian/control
* Add #DEBHELPER# token to postinst/prerm scripts
  - update debian/xulrunner-1.9.{postinst,prerm}
* Install previously missed libdbusservice.so
  - update debian/xulrunner-1.9.install
* Update venkman patch to also rename locales
  - update debian/patches/rename_venkman_addon.patch
* Bump requirement for system cairo to >= 1.5.8 as we now need
  the newly added cairo_path_extents()
  - update debian/rules
* Include mozilla-devscripts file using -include so ifneq could be omitted
  - update debian/rules
* Fix missing .so symlinks regression
  - update debian/patches/dont_install_so_in_dev.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
; ***** BEGIN LICENSE BLOCK *****
2
 
; Version: MPL 1.1/GPL 2.0/LGPL 2.1
3
 
;
4
 
; The contents of this file are subject to the Mozilla Public License Version
5
 
; 1.1 (the "License"); you may not use this file except in compliance with
6
 
; the License. You may obtain a copy of the License at
7
 
; http://www.mozilla.org/MPL/
8
 
;
9
 
; Software distributed under the License is distributed on an "AS IS" basis,
10
 
; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
 
; for the specific language governing rights and limitations under the
12
 
; License.
13
 
;
14
 
; The Original Code is MAXPY multiple-precision integer arithmetic.
15
 
;
16
 
; The Initial Developer of the Original Code is
17
 
; the Hewlett-Packard Company.
18
 
; Portions created by the Initial Developer are Copyright (C) 1997
19
 
; the Initial Developer. All Rights Reserved.
20
 
;
21
 
; Contributor(s):
22
 
;   coded by:   William B. Ackerman
23
 
;
24
 
; Alternatively, the contents of this file may be used under the terms of
25
 
; either the GNU General Public License Version 2 or later (the "GPL"), or
26
 
; the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
 
; in which case the provisions of the GPL or the LGPL are applicable instead
28
 
; of those above. If you wish to allow use of your version of this file only
29
 
; under the terms of either the GPL or the LGPL, and not to allow others to
30
 
; use your version of this file under the terms of the MPL, indicate your
31
 
; decision by deleting the provisions above and replace them with the notice
32
 
; and other provisions required by the GPL or the LGPL. If you do not delete
33
 
; the provisions above, a recipient may use your version of this file under
34
 
; the terms of any one of the MPL, the GPL or the LGPL.
35
 
;
36
 
; ***** END LICENSE BLOCK *****
37
 
 
38
 
#ifdef __LP64__
39
 
        .LEVEL   2.0W
40
 
#else
41
 
;       .LEVEL   1.1
42
 
;       .ALLOW   2.0N
43
 
        .LEVEL   2.0N
44
 
#endif
45
 
        .SPACE   $TEXT$,SORT=8
46
 
        .SUBSPA  $CODE$,QUAD=0,ALIGN=4,ACCESS=0x2c,CODE_ONLY,SORT=24
47
 
 
48
 
; ***************************************************************
49
 
;
50
 
;                 maxpy_[little/big]
51
 
;
52
 
; ***************************************************************
53
 
 
54
 
; There is no default -- you must specify one or the other.
55
 
#define LITTLE_WORDIAN 1
56
 
 
57
 
#ifdef LITTLE_WORDIAN
58
 
#define EIGHT 8
59
 
#define SIXTEEN 16
60
 
#define THIRTY_TWO 32
61
 
#define UN_EIGHT -8
62
 
#define UN_SIXTEEN -16
63
 
#define UN_TWENTY_FOUR -24
64
 
#endif
65
 
 
66
 
#ifdef BIG_WORDIAN
67
 
#define EIGHT -8
68
 
#define SIXTEEN -16
69
 
#define THIRTY_TWO -32
70
 
#define UN_EIGHT 8
71
 
#define UN_SIXTEEN 16
72
 
#define UN_TWENTY_FOUR 24
73
 
#endif
74
 
 
75
 
; This performs a multiple-precision integer version of "daxpy",
76
 
; Using the selected addressing direction.  "Little-wordian" means that
77
 
; the least significant word of a number is stored at the lowest address.
78
 
; "Big-wordian" means that the most significant word is at the lowest
79
 
; address.  Either way, the incoming address of the vector is that
80
 
; of the least significant word.  That means that, for little-wordian
81
 
; addressing, we move the address upward as we propagate carries
82
 
; from the least significant word to the most significant.  For
83
 
; big-wordian we move the address downward.
84
 
 
85
 
; We use the following registers:
86
 
;
87
 
;     r2   return PC, of course
88
 
;     r26 = arg1 =  length
89
 
;     r25 = arg2 =  address of scalar
90
 
;     r24 = arg3 =  multiplicand vector
91
 
;     r23 = arg4 =  result vector
92
 
;
93
 
;     fr9 = scalar loaded once only from r25
94
 
 
95
 
; The cycle counts shown in the bodies below are simply the result of a
96
 
; scheduling by hand.  The actual PCX-U hardware does it differently.
97
 
; The intention is that the overall speed is the same.
98
 
 
99
 
; The pipeline startup and shutdown code is constructed in the usual way,
100
 
; by taking the loop bodies and removing unnecessary instructions.
101
 
; We have left the comments describing cycle numbers in the code.
102
 
; These are intended for reference when comparing with the main loop,
103
 
; and have no particular relationship to actual cycle numbers.
104
 
 
105
 
#ifdef LITTLE_WORDIAN
106
 
maxpy_little
107
 
#else
108
 
maxpy_big
109
 
#endif
110
 
        .PROC
111
 
        .CALLINFO FRAME=120,ENTRY_GR=%r4
112
 
        .ENTER
113
 
 
114
 
; Of course, real men don't use the sissy "enter" and "leave" commands.
115
 
; They write their own stack manipulation stuff.  Unfortunately,
116
 
; that doesn't generate complete unwind info, whereas "enter" and
117
 
; "leave" (if the documentation is to be believed) do so.  Therefore,
118
 
; we use the sissy commands.  We have verified (by real-man methods)
119
 
; that the above command generates what we want:
120
 
;       STW,MA  %r3,128(%sp)
121
 
;       STW     %r4,-124(%sp)
122
 
 
123
 
        ADDIB,< -1,%r26,$L0         ; If N = 0, exit immediately.
124
 
        FLDD    0(%r25),%fr9        ; fr9 = scalar
125
 
 
126
 
; First startup
127
 
 
128
 
        FLDD    0(%r24),%fr24       ; Cycle 1
129
 
        XMPYU   %fr9R,%fr24R,%fr27  ; Cycle 3
130
 
        XMPYU   %fr9R,%fr24L,%fr25  ; Cycle 4
131
 
        XMPYU   %fr9L,%fr24L,%fr26  ; Cycle 5
132
 
        CMPIB,> 3,%r26,$N_IS_SMALL  ; Pick out cases N = 1, 2, or 3
133
 
        XMPYU   %fr9L,%fr24R,%fr24  ; Cycle 6
134
 
        FLDD    EIGHT(%r24),%fr28   ; Cycle 8
135
 
        XMPYU   %fr9L,%fr28R,%fr31  ; Cycle 10
136
 
        FSTD    %fr24,-96(%sp)
137
 
        XMPYU   %fr9R,%fr28L,%fr30  ; Cycle 11
138
 
        FSTD    %fr25,-80(%sp)
139
 
        LDO     SIXTEEN(%r24),%r24  ; Cycle 12
140
 
        FSTD    %fr31,-64(%sp)
141
 
        XMPYU   %fr9R,%fr28R,%fr29  ; Cycle 13
142
 
        FSTD    %fr27,-48(%sp)
143
 
 
144
 
; Second startup
145
 
 
146
 
        XMPYU   %fr9L,%fr28L,%fr28  ; Cycle 1
147
 
        FSTD    %fr30,-56(%sp)
148
 
        FLDD    0(%r24),%fr24
149
 
 
150
 
        FSTD    %fr26,-88(%sp)      ; Cycle 2
151
 
 
152
 
        XMPYU   %fr9R,%fr24R,%fr27  ; Cycle 3
153
 
        FSTD    %fr28,-104(%sp)
154
 
 
155
 
        XMPYU   %fr9R,%fr24L,%fr25  ; Cycle 4
156
 
        LDD     -96(%sp),%r3
157
 
        FSTD    %fr29,-72(%sp)
158
 
 
159
 
        XMPYU   %fr9L,%fr24L,%fr26  ; Cycle 5
160
 
        LDD     -64(%sp),%r19
161
 
        LDD     -80(%sp),%r21
162
 
 
163
 
        XMPYU   %fr9L,%fr24R,%fr24  ; Cycle 6
164
 
        LDD     -56(%sp),%r20
165
 
        ADD     %r21,%r3,%r3
166
 
 
167
 
        ADD,DC  %r20,%r19,%r19      ; Cycle 7
168
 
        LDD     -88(%sp),%r4
169
 
        SHRPD   %r3,%r0,32,%r21
170
 
        LDD     -48(%sp),%r1
171
 
 
172
 
        FLDD    EIGHT(%r24),%fr28   ; Cycle 8
173
 
        LDD     -104(%sp),%r31
174
 
        ADD,DC  %r0,%r0,%r20
175
 
        SHRPD   %r19,%r3,32,%r3
176
 
 
177
 
        LDD     -72(%sp),%r29       ; Cycle 9
178
 
        SHRPD   %r20,%r19,32,%r20
179
 
        ADD     %r21,%r1,%r1
180
 
 
181
 
        XMPYU   %fr9L,%fr28R,%fr31  ; Cycle 10
182
 
        ADD,DC  %r3,%r4,%r4
183
 
        FSTD    %fr24,-96(%sp)
184
 
 
185
 
        XMPYU   %fr9R,%fr28L,%fr30  ; Cycle 11
186
 
        ADD,DC  %r0,%r20,%r20
187
 
        LDD     0(%r23),%r3
188
 
        FSTD    %fr25,-80(%sp)
189
 
 
190
 
        LDO     SIXTEEN(%r24),%r24  ; Cycle 12
191
 
        FSTD    %fr31,-64(%sp)
192
 
 
193
 
        XMPYU   %fr9R,%fr28R,%fr29  ; Cycle 13
194
 
        ADD     %r0,%r0,%r0         ; clear the carry bit
195
 
        ADDIB,<= -4,%r26,$ENDLOOP   ; actually happens in cycle 12
196
 
        FSTD    %fr27,-48(%sp)
197
 
;        MFCTL   %cr16,%r21         ; for timing
198
 
;        STD     %r21,-112(%sp)
199
 
 
200
 
; Here is the loop.
201
 
 
202
 
$LOOP   XMPYU   %fr9L,%fr28L,%fr28  ; Cycle 1
203
 
        ADD,DC  %r29,%r4,%r4
204
 
        FSTD    %fr30,-56(%sp)
205
 
        FLDD    0(%r24),%fr24
206
 
 
207
 
        LDO     SIXTEEN(%r23),%r23  ; Cycle 2
208
 
        ADD,DC  %r0,%r20,%r20
209
 
        FSTD    %fr26,-88(%sp)
210
 
 
211
 
        XMPYU   %fr9R,%fr24R,%fr27  ; Cycle 3
212
 
        ADD     %r3,%r1,%r1
213
 
        FSTD    %fr28,-104(%sp)
214
 
        LDD     UN_EIGHT(%r23),%r21
215
 
 
216
 
        XMPYU   %fr9R,%fr24L,%fr25  ; Cycle 4
217
 
        ADD,DC  %r21,%r4,%r28
218
 
        FSTD    %fr29,-72(%sp)    
219
 
        LDD     -96(%sp),%r3
220
 
 
221
 
        XMPYU   %fr9L,%fr24L,%fr26  ; Cycle 5
222
 
        ADD,DC  %r20,%r31,%r22
223
 
        LDD     -64(%sp),%r19
224
 
        LDD     -80(%sp),%r21
225
 
 
226
 
        XMPYU   %fr9L,%fr24R,%fr24  ; Cycle 6
227
 
        ADD     %r21,%r3,%r3
228
 
        LDD     -56(%sp),%r20
229
 
        STD     %r1,UN_SIXTEEN(%r23)
230
 
 
231
 
        ADD,DC  %r20,%r19,%r19      ; Cycle 7
232
 
        SHRPD   %r3,%r0,32,%r21
233
 
        LDD     -88(%sp),%r4
234
 
        LDD     -48(%sp),%r1
235
 
 
236
 
        ADD,DC  %r0,%r0,%r20        ; Cycle 8
237
 
        SHRPD   %r19,%r3,32,%r3
238
 
        FLDD    EIGHT(%r24),%fr28
239
 
        LDD     -104(%sp),%r31
240
 
 
241
 
        SHRPD   %r20,%r19,32,%r20   ; Cycle 9
242
 
        ADD     %r21,%r1,%r1
243
 
        STD     %r28,UN_EIGHT(%r23)
244
 
        LDD     -72(%sp),%r29
245
 
 
246
 
        XMPYU   %fr9L,%fr28R,%fr31  ; Cycle 10
247
 
        ADD,DC  %r3,%r4,%r4
248
 
        FSTD    %fr24,-96(%sp)
249
 
 
250
 
        XMPYU   %fr9R,%fr28L,%fr30  ; Cycle 11
251
 
        ADD,DC  %r0,%r20,%r20
252
 
        FSTD    %fr25,-80(%sp)
253
 
        LDD     0(%r23),%r3
254
 
 
255
 
        LDO     SIXTEEN(%r24),%r24  ; Cycle 12
256
 
        FSTD    %fr31,-64(%sp)
257
 
 
258
 
        XMPYU   %fr9R,%fr28R,%fr29  ; Cycle 13
259
 
        ADD     %r22,%r1,%r1
260
 
        ADDIB,> -2,%r26,$LOOP       ; actually happens in cycle 12
261
 
        FSTD    %fr27,-48(%sp)
262
 
 
263
 
$ENDLOOP
264
 
 
265
 
; Shutdown code, first stage.
266
 
 
267
 
;        MFCTL   %cr16,%r21         ; for timing
268
 
;        STD     %r21,UN_SIXTEEN(%r23)
269
 
;        LDD     -112(%sp),%r21
270
 
;        STD     %r21,UN_EIGHT(%r23)
271
 
 
272
 
        XMPYU   %fr9L,%fr28L,%fr28  ; Cycle 1
273
 
        ADD,DC  %r29,%r4,%r4
274
 
        CMPIB,= 0,%r26,$ONEMORE
275
 
        FSTD    %fr30,-56(%sp)
276
 
 
277
 
        LDO     SIXTEEN(%r23),%r23  ; Cycle 2
278
 
        ADD,DC  %r0,%r20,%r20
279
 
        FSTD    %fr26,-88(%sp)
280
 
 
281
 
        ADD     %r3,%r1,%r1         ; Cycle 3
282
 
        FSTD    %fr28,-104(%sp)
283
 
        LDD     UN_EIGHT(%r23),%r21
284
 
 
285
 
        ADD,DC  %r21,%r4,%r28       ; Cycle 4
286
 
        FSTD    %fr29,-72(%sp)    
287
 
        STD     %r28,UN_EIGHT(%r23) ; moved up from cycle 9
288
 
        LDD     -96(%sp),%r3
289
 
 
290
 
        ADD,DC  %r20,%r31,%r22      ; Cycle 5
291
 
        STD     %r1,UN_SIXTEEN(%r23)
292
 
$JOIN4
293
 
        LDD     -64(%sp),%r19
294
 
        LDD     -80(%sp),%r21
295
 
 
296
 
        ADD     %r21,%r3,%r3        ; Cycle 6
297
 
        LDD     -56(%sp),%r20
298
 
 
299
 
        ADD,DC  %r20,%r19,%r19      ; Cycle 7
300
 
        SHRPD   %r3,%r0,32,%r21
301
 
        LDD     -88(%sp),%r4
302
 
        LDD     -48(%sp),%r1
303
 
 
304
 
        ADD,DC  %r0,%r0,%r20        ; Cycle 8
305
 
        SHRPD   %r19,%r3,32,%r3
306
 
        LDD     -104(%sp),%r31
307
 
 
308
 
        SHRPD   %r20,%r19,32,%r20   ; Cycle 9
309
 
        ADD     %r21,%r1,%r1
310
 
        LDD     -72(%sp),%r29
311
 
 
312
 
        ADD,DC  %r3,%r4,%r4         ; Cycle 10
313
 
 
314
 
        ADD,DC  %r0,%r20,%r20       ; Cycle 11
315
 
        LDD     0(%r23),%r3
316
 
 
317
 
        ADD     %r22,%r1,%r1        ; Cycle 13
318
 
 
319
 
; Shutdown code, second stage.
320
 
 
321
 
        ADD,DC  %r29,%r4,%r4        ; Cycle 1
322
 
 
323
 
        LDO     SIXTEEN(%r23),%r23  ; Cycle 2
324
 
        ADD,DC  %r0,%r20,%r20
325
 
 
326
 
        LDD     UN_EIGHT(%r23),%r21 ; Cycle 3
327
 
        ADD     %r3,%r1,%r1
328
 
 
329
 
        ADD,DC  %r21,%r4,%r28       ; Cycle 4
330
 
 
331
 
        ADD,DC  %r20,%r31,%r22      ; Cycle 5
332
 
 
333
 
        STD     %r1,UN_SIXTEEN(%r23); Cycle 6
334
 
 
335
 
        STD     %r28,UN_EIGHT(%r23) ; Cycle 9
336
 
 
337
 
        LDD     0(%r23),%r3         ; Cycle 11
338
 
 
339
 
; Shutdown code, third stage.
340
 
 
341
 
        LDO     SIXTEEN(%r23),%r23
342
 
        ADD     %r3,%r22,%r1
343
 
$JOIN1  ADD,DC  %r0,%r0,%r21
344
 
        CMPIB,*= 0,%r21,$L0         ; if no overflow, exit
345
 
        STD     %r1,UN_SIXTEEN(%r23)
346
 
 
347
 
; Final carry propagation
348
 
 
349
 
$FINAL1 LDO     EIGHT(%r23),%r23
350
 
        LDD     UN_SIXTEEN(%r23),%r21
351
 
        ADDI    1,%r21,%r21
352
 
        CMPIB,*= 0,%r21,$FINAL1     ; Keep looping if there is a carry.
353
 
        STD     %r21,UN_SIXTEEN(%r23)
354
 
        B       $L0
355
 
        NOP
356
 
 
357
 
; Here is the code that handles the difficult cases N=1, N=2, and N=3.
358
 
; We do the usual trick -- branch out of the startup code at appropriate
359
 
; points, and branch into the shutdown code.
360
 
 
361
 
$N_IS_SMALL
362
 
        CMPIB,= 0,%r26,$N_IS_ONE
363
 
        FSTD    %fr24,-96(%sp)      ; Cycle 10
364
 
        FLDD    EIGHT(%r24),%fr28   ; Cycle 8
365
 
        XMPYU   %fr9L,%fr28R,%fr31  ; Cycle 10
366
 
        XMPYU   %fr9R,%fr28L,%fr30  ; Cycle 11
367
 
        FSTD    %fr25,-80(%sp)
368
 
        FSTD    %fr31,-64(%sp)      ; Cycle 12
369
 
        XMPYU   %fr9R,%fr28R,%fr29  ; Cycle 13
370
 
        FSTD    %fr27,-48(%sp)
371
 
        XMPYU   %fr9L,%fr28L,%fr28  ; Cycle 1
372
 
        CMPIB,= 2,%r26,$N_IS_THREE
373
 
        FSTD    %fr30,-56(%sp)
374
 
 
375
 
; N = 2
376
 
        FSTD    %fr26,-88(%sp)      ; Cycle 2
377
 
        FSTD    %fr28,-104(%sp)     ; Cycle 3
378
 
        LDD     -96(%sp),%r3        ; Cycle 4
379
 
        FSTD    %fr29,-72(%sp)
380
 
        B       $JOIN4
381
 
        ADD     %r0,%r0,%r22
382
 
 
383
 
$N_IS_THREE
384
 
        FLDD    SIXTEEN(%r24),%fr24
385
 
        FSTD    %fr26,-88(%sp)      ; Cycle 2
386
 
        XMPYU   %fr9R,%fr24R,%fr27  ; Cycle 3
387
 
        FSTD    %fr28,-104(%sp)
388
 
        XMPYU   %fr9R,%fr24L,%fr25  ; Cycle 4
389
 
        LDD     -96(%sp),%r3
390
 
        FSTD    %fr29,-72(%sp)
391
 
        XMPYU   %fr9L,%fr24L,%fr26  ; Cycle 5
392
 
        LDD     -64(%sp),%r19
393
 
        LDD     -80(%sp),%r21
394
 
        B       $JOIN3
395
 
        ADD     %r0,%r0,%r22
396
 
 
397
 
$N_IS_ONE
398
 
        FSTD    %fr25,-80(%sp)
399
 
        FSTD    %fr27,-48(%sp)
400
 
        FSTD    %fr26,-88(%sp)      ; Cycle 2
401
 
        B       $JOIN5
402
 
        ADD     %r0,%r0,%r22
403
 
 
404
 
; We came out of the unrolled loop with wrong parity.  Do one more
405
 
; single cycle.  This is quite tricky, because of the way the
406
 
; carry chains and SHRPD chains have been chopped up.
407
 
 
408
 
$ONEMORE
409
 
 
410
 
        FLDD    0(%r24),%fr24
411
 
 
412
 
        LDO     SIXTEEN(%r23),%r23  ; Cycle 2
413
 
        ADD,DC  %r0,%r20,%r20
414
 
        FSTD    %fr26,-88(%sp)
415
 
 
416
 
        XMPYU   %fr9R,%fr24R,%fr27  ; Cycle 3
417
 
        FSTD    %fr28,-104(%sp)
418
 
        LDD     UN_EIGHT(%r23),%r21
419
 
        ADD     %r3,%r1,%r1
420
 
 
421
 
        XMPYU   %fr9R,%fr24L,%fr25  ; Cycle 4
422
 
        ADD,DC  %r21,%r4,%r28
423
 
        STD     %r28,UN_EIGHT(%r23) ; moved from cycle 9
424
 
        LDD     -96(%sp),%r3
425
 
        FSTD    %fr29,-72(%sp)    
426
 
 
427
 
        XMPYU   %fr9L,%fr24L,%fr26  ; Cycle 5
428
 
        ADD,DC  %r20,%r31,%r22
429
 
        LDD     -64(%sp),%r19
430
 
        LDD     -80(%sp),%r21
431
 
 
432
 
        STD     %r1,UN_SIXTEEN(%r23); Cycle 6
433
 
$JOIN3
434
 
        XMPYU   %fr9L,%fr24R,%fr24
435
 
        LDD     -56(%sp),%r20
436
 
        ADD     %r21,%r3,%r3
437
 
 
438
 
        ADD,DC  %r20,%r19,%r19      ; Cycle 7
439
 
        LDD     -88(%sp),%r4
440
 
        SHRPD   %r3,%r0,32,%r21
441
 
        LDD     -48(%sp),%r1
442
 
 
443
 
        LDD     -104(%sp),%r31      ; Cycle 8
444
 
        ADD,DC  %r0,%r0,%r20
445
 
        SHRPD   %r19,%r3,32,%r3
446
 
 
447
 
        LDD     -72(%sp),%r29       ; Cycle 9
448
 
        SHRPD   %r20,%r19,32,%r20
449
 
        ADD     %r21,%r1,%r1
450
 
 
451
 
        ADD,DC  %r3,%r4,%r4         ; Cycle 10
452
 
        FSTD    %fr24,-96(%sp)
453
 
 
454
 
        ADD,DC  %r0,%r20,%r20       ; Cycle 11
455
 
        LDD     0(%r23),%r3
456
 
        FSTD    %fr25,-80(%sp)
457
 
 
458
 
        ADD     %r22,%r1,%r1        ; Cycle 13
459
 
        FSTD    %fr27,-48(%sp)
460
 
 
461
 
; Shutdown code, stage 1-1/2.
462
 
 
463
 
        ADD,DC  %r29,%r4,%r4        ; Cycle 1
464
 
 
465
 
        LDO     SIXTEEN(%r23),%r23  ; Cycle 2
466
 
        ADD,DC  %r0,%r20,%r20     
467
 
        FSTD    %fr26,-88(%sp)
468
 
 
469
 
        LDD     UN_EIGHT(%r23),%r21 ; Cycle 3
470
 
        ADD     %r3,%r1,%r1
471
 
 
472
 
        ADD,DC  %r21,%r4,%r28       ; Cycle 4
473
 
        STD     %r28,UN_EIGHT(%r23) ; moved from cycle 9
474
 
 
475
 
        ADD,DC  %r20,%r31,%r22      ; Cycle 5
476
 
        STD     %r1,UN_SIXTEEN(%r23)
477
 
$JOIN5
478
 
        LDD     -96(%sp),%r3        ; moved from cycle 4
479
 
        LDD     -80(%sp),%r21
480
 
        ADD     %r21,%r3,%r3        ; Cycle 6
481
 
        ADD,DC  %r0,%r0,%r19        ; Cycle 7
482
 
        LDD     -88(%sp),%r4
483
 
        SHRPD   %r3,%r0,32,%r21
484
 
        LDD     -48(%sp),%r1
485
 
        SHRPD   %r19,%r3,32,%r3     ; Cycle 8
486
 
        ADD     %r21,%r1,%r1        ; Cycle 9
487
 
        ADD,DC  %r3,%r4,%r4         ; Cycle 10
488
 
        LDD     0(%r23),%r3         ; Cycle 11
489
 
        ADD     %r22,%r1,%r1        ; Cycle 13
490
 
 
491
 
; Shutdown code, stage 2-1/2.
492
 
 
493
 
        ADD,DC  %r0,%r4,%r4         ; Cycle 1
494
 
        LDO     SIXTEEN(%r23),%r23  ; Cycle 2
495
 
        LDD     UN_EIGHT(%r23),%r21 ; Cycle 3
496
 
        ADD     %r3,%r1,%r1
497
 
        STD     %r1,UN_SIXTEEN(%r23)
498
 
        ADD,DC  %r21,%r4,%r1
499
 
        B       $JOIN1
500
 
        LDO     EIGHT(%r23),%r23
501
 
 
502
 
; exit
503
 
 
504
 
$L0
505
 
        .LEAVE
506
 
 
507
 
; We have verified that the above command generates what we want:
508
 
;       LDW     -124(%sp),%r4
509
 
;       BVE     (%r2)
510
 
;       LDW,MB  -128(%sp),%r3
511
 
 
512
 
        .PROCEND
513
 
 
514
 
; ***************************************************************
515
 
;
516
 
;                 add_diag_[little/big]
517
 
;
518
 
; ***************************************************************
519
 
 
520
 
; The arguments are as follows:
521
 
;     r2   return PC, of course
522
 
;     r26 = arg1 =  length
523
 
;     r25 = arg2 =  vector to square
524
 
;     r24 = arg3 =  result vector
525
 
 
526
 
#ifdef LITTLE_WORDIAN
527
 
add_diag_little
528
 
#else
529
 
add_diag_big
530
 
#endif
531
 
        .PROC
532
 
        .CALLINFO FRAME=120,ENTRY_GR=%r4
533
 
        .ENTER
534
 
 
535
 
        ADDIB,< -1,%r26,$Z0         ; If N=0, exit immediately.
536
 
        NOP
537
 
 
538
 
; Startup code
539
 
 
540
 
        FLDD    0(%r25),%fr7        ; Cycle 2 (alternate body)
541
 
        XMPYU   %fr7R,%fr7R,%fr29   ; Cycle 4
542
 
        XMPYU   %fr7L,%fr7R,%fr27   ; Cycle 5
543
 
        XMPYU   %fr7L,%fr7L,%fr30
544
 
        LDO     SIXTEEN(%r25),%r25  ; Cycle 6
545
 
        FSTD    %fr29,-88(%sp)
546
 
        FSTD    %fr27,-72(%sp)      ; Cycle 7
547
 
        CMPIB,= 0,%r26,$DIAG_N_IS_ONE ; Cycle 1 (main body)
548
 
        FSTD    %fr30,-96(%sp)
549
 
        FLDD    UN_EIGHT(%r25),%fr7 ; Cycle 2
550
 
        LDD     -88(%sp),%r22       ; Cycle 3
551
 
        LDD     -72(%sp),%r31       ; Cycle 4
552
 
        XMPYU   %fr7R,%fr7R,%fr28
553
 
        XMPYU   %fr7L,%fr7R,%fr24   ; Cycle 5
554
 
        XMPYU   %fr7L,%fr7L,%fr31
555
 
        LDD     -96(%sp),%r20       ; Cycle 6
556
 
        FSTD    %fr28,-80(%sp)
557
 
        ADD     %r0,%r0,%r0         ; clear the carry bit
558
 
        ADDIB,<= -2,%r26,$ENDDIAGLOOP ; Cycle 7
559
 
        FSTD    %fr24,-64(%sp)
560
 
 
561
 
; Here is the loop.  It is unrolled twice, modelled after the "alternate body" and then the "main body".
562
 
 
563
 
$DIAGLOOP
564
 
        SHRPD   %r31,%r0,31,%r3     ; Cycle 1 (alternate body)
565
 
        LDO     SIXTEEN(%r25),%r25
566
 
        LDD     0(%r24),%r1
567
 
        FSTD    %fr31,-104(%sp)
568
 
        SHRPD   %r0,%r31,31,%r4     ; Cycle 2
569
 
        ADD,DC  %r22,%r3,%r3
570
 
        FLDD    UN_SIXTEEN(%r25),%fr7   
571
 
        ADD,DC  %r0,%r20,%r20       ; Cycle 3
572
 
        ADD     %r1,%r3,%r3
573
 
        XMPYU   %fr7R,%fr7R,%fr29   ; Cycle 4
574
 
        LDD     -80(%sp),%r21
575
 
        STD     %r3,0(%r24)
576
 
        XMPYU   %fr7L,%fr7R,%fr27   ; Cycle 5
577
 
        XMPYU   %fr7L,%fr7L,%fr30
578
 
        LDD     -64(%sp),%r29       
579
 
        LDD     EIGHT(%r24),%r1  
580
 
        ADD,DC  %r4,%r20,%r20       ; Cycle 6
581
 
        LDD     -104(%sp),%r19
582
 
        FSTD    %fr29,-88(%sp)
583
 
        ADD     %r20,%r1,%r1        ; Cycle 7
584
 
        FSTD    %fr27,-72(%sp)
585
 
        SHRPD   %r29,%r0,31,%r4     ; Cycle 1 (main body)
586
 
        LDO     THIRTY_TWO(%r24),%r24
587
 
        LDD     UN_SIXTEEN(%r24),%r28
588
 
        FSTD    %fr30,-96(%sp)
589
 
        SHRPD   %r0,%r29,31,%r3     ; Cycle 2
590
 
        ADD,DC  %r21,%r4,%r4
591
 
        FLDD    UN_EIGHT(%r25),%fr7
592
 
        STD     %r1,UN_TWENTY_FOUR(%r24)
593
 
        ADD,DC  %r0,%r19,%r19       ; Cycle 3
594
 
        ADD     %r28,%r4,%r4
595
 
        XMPYU   %fr7R,%fr7R,%fr28   ; Cycle 4
596
 
        LDD     -88(%sp),%r22
597
 
        STD     %r4,UN_SIXTEEN(%r24)
598
 
        XMPYU   %fr7L,%fr7R,%fr24   ; Cycle 5
599
 
        XMPYU   %fr7L,%fr7L,%fr31
600
 
        LDD     -72(%sp),%r31
601
 
        LDD     UN_EIGHT(%r24),%r28
602
 
        ADD,DC  %r3,%r19,%r19       ; Cycle 6
603
 
        LDD     -96(%sp),%r20
604
 
        FSTD    %fr28,-80(%sp)
605
 
        ADD     %r19,%r28,%r28      ; Cycle 7
606
 
        FSTD    %fr24,-64(%sp)
607
 
        ADDIB,> -2,%r26,$DIAGLOOP   ; Cycle 8
608
 
        STD     %r28,UN_EIGHT(%r24)
609
 
 
610
 
$ENDDIAGLOOP
611
 
 
612
 
        ADD,DC  %r0,%r22,%r22    
613
 
        CMPIB,= 0,%r26,$ONEMOREDIAG
614
 
        SHRPD   %r31,%r0,31,%r3
615
 
 
616
 
; Shutdown code, first stage.
617
 
 
618
 
        FSTD    %fr31,-104(%sp)     ; Cycle 1 (alternate body)
619
 
        LDD     0(%r24),%r28
620
 
        SHRPD   %r0,%r31,31,%r4     ; Cycle 2
621
 
        ADD     %r3,%r22,%r3
622
 
        ADD,DC  %r0,%r20,%r20       ; Cycle 3
623
 
        LDD     -80(%sp),%r21
624
 
        ADD     %r3,%r28,%r3
625
 
        LDD     -64(%sp),%r29       ; Cycle 4
626
 
        STD     %r3,0(%r24)
627
 
        LDD     EIGHT(%r24),%r1     ; Cycle 5
628
 
        LDO     SIXTEEN(%r25),%r25  ; Cycle 6
629
 
        LDD     -104(%sp),%r19
630
 
        ADD,DC  %r4,%r20,%r20
631
 
        ADD     %r20,%r1,%r1        ; Cycle 7
632
 
        ADD,DC  %r0,%r21,%r21       ; Cycle 8
633
 
        STD     %r1,EIGHT(%r24)
634
 
 
635
 
; Shutdown code, second stage.
636
 
 
637
 
        SHRPD   %r29,%r0,31,%r4     ; Cycle 1 (main body)
638
 
        LDO     THIRTY_TWO(%r24),%r24
639
 
        LDD     UN_SIXTEEN(%r24),%r1
640
 
        SHRPD   %r0,%r29,31,%r3      ; Cycle 2
641
 
        ADD     %r4,%r21,%r4
642
 
        ADD,DC  %r0,%r19,%r19       ; Cycle 3
643
 
        ADD     %r4,%r1,%r4
644
 
        STD     %r4,UN_SIXTEEN(%r24); Cycle 4
645
 
        LDD     UN_EIGHT(%r24),%r28 ; Cycle 5
646
 
        ADD,DC  %r3,%r19,%r19       ; Cycle 6       
647
 
        ADD     %r19,%r28,%r28      ; Cycle 7
648
 
        ADD,DC  %r0,%r0,%r22        ; Cycle 8
649
 
        CMPIB,*= 0,%r22,$Z0         ; if no overflow, exit
650
 
        STD     %r28,UN_EIGHT(%r24)
651
 
 
652
 
; Final carry propagation
653
 
 
654
 
$FDIAG2
655
 
        LDO     EIGHT(%r24),%r24
656
 
        LDD     UN_EIGHT(%r24),%r26
657
 
        ADDI    1,%r26,%r26
658
 
        CMPIB,*= 0,%r26,$FDIAG2     ; Keep looping if there is a carry.
659
 
        STD     %r26,UN_EIGHT(%r24)
660
 
 
661
 
        B   $Z0
662
 
        NOP
663
 
 
664
 
; Here is the code that handles the difficult case N=1.
665
 
; We do the usual trick -- branch out of the startup code at appropriate
666
 
; points, and branch into the shutdown code.
667
 
 
668
 
$DIAG_N_IS_ONE
669
 
 
670
 
        LDD     -88(%sp),%r22
671
 
        LDD     -72(%sp),%r31
672
 
        B       $JOINDIAG
673
 
        LDD     -96(%sp),%r20
674
 
 
675
 
; We came out of the unrolled loop with wrong parity.  Do one more
676
 
; single cycle.  This is the "alternate body".  It will, of course,
677
 
; give us opposite registers from the other case, so we need
678
 
; completely different shutdown code.
679
 
 
680
 
$ONEMOREDIAG
681
 
        FSTD    %fr31,-104(%sp)     ; Cycle 1 (alternate body)
682
 
        LDD     0(%r24),%r28
683
 
        FLDD    0(%r25),%fr7        ; Cycle 2
684
 
        SHRPD   %r0,%r31,31,%r4
685
 
        ADD     %r3,%r22,%r3
686
 
        ADD,DC  %r0,%r20,%r20       ; Cycle 3
687
 
        LDD     -80(%sp),%r21
688
 
        ADD     %r3,%r28,%r3
689
 
        LDD     -64(%sp),%r29       ; Cycle 4
690
 
        STD     %r3,0(%r24)
691
 
        XMPYU   %fr7R,%fr7R,%fr29
692
 
        LDD     EIGHT(%r24),%r1     ; Cycle 5
693
 
        XMPYU   %fr7L,%fr7R,%fr27
694
 
        XMPYU   %fr7L,%fr7L,%fr30
695
 
        LDD     -104(%sp),%r19      ; Cycle 6
696
 
        FSTD    %fr29,-88(%sp)
697
 
        ADD,DC  %r4,%r20,%r20
698
 
        FSTD    %fr27,-72(%sp)      ; Cycle 7
699
 
        ADD     %r20,%r1,%r1
700
 
        ADD,DC  %r0,%r21,%r21       ; Cycle 8
701
 
        STD     %r1,EIGHT(%r24)
702
 
 
703
 
; Shutdown code, first stage.
704
 
 
705
 
        SHRPD   %r29,%r0,31,%r4     ; Cycle 1 (main body)
706
 
        LDO     THIRTY_TWO(%r24),%r24
707
 
        FSTD    %fr30,-96(%sp)
708
 
        LDD     UN_SIXTEEN(%r24),%r1
709
 
        SHRPD   %r0,%r29,31,%r3     ; Cycle 2
710
 
        ADD     %r4,%r21,%r4
711
 
        ADD,DC  %r0,%r19,%r19       ; Cycle 3
712
 
        LDD     -88(%sp),%r22
713
 
        ADD     %r4,%r1,%r4
714
 
        LDD     -72(%sp),%r31       ; Cycle 4
715
 
        STD     %r4,UN_SIXTEEN(%r24)
716
 
        LDD     UN_EIGHT(%r24),%r28 ; Cycle 5
717
 
        LDD     -96(%sp),%r20       ; Cycle 6
718
 
        ADD,DC  %r3,%r19,%r19
719
 
        ADD     %r19,%r28,%r28      ; Cycle 7
720
 
        ADD,DC  %r0,%r22,%r22       ; Cycle 8
721
 
        STD     %r28,UN_EIGHT(%r24)
722
 
 
723
 
; Shutdown code, second stage.
724
 
 
725
 
$JOINDIAG
726
 
        SHRPD   %r31,%r0,31,%r3     ; Cycle 1 (alternate body)
727
 
        LDD     0(%r24),%r28        
728
 
        SHRPD   %r0,%r31,31,%r4     ; Cycle 2
729
 
        ADD     %r3,%r22,%r3
730
 
        ADD,DC  %r0,%r20,%r20       ; Cycle 3
731
 
        ADD     %r3,%r28,%r3
732
 
        STD     %r3,0(%r24)         ; Cycle 4
733
 
        LDD     EIGHT(%r24),%r1     ; Cycle 5
734
 
        ADD,DC  %r4,%r20,%r20
735
 
        ADD     %r20,%r1,%r1        ; Cycle 7
736
 
        ADD,DC  %r0,%r0,%r21        ; Cycle 8
737
 
        CMPIB,*= 0,%r21,$Z0         ; if no overflow, exit
738
 
        STD     %r1,EIGHT(%r24)
739
 
 
740
 
; Final carry propagation
741
 
 
742
 
$FDIAG1
743
 
        LDO     EIGHT(%r24),%r24
744
 
        LDD     EIGHT(%r24),%r26
745
 
        ADDI    1,%r26,%r26
746
 
        CMPIB,*= 0,%r26,$FDIAG1    ; Keep looping if there is a carry.
747
 
        STD     %r26,EIGHT(%r24)
748
 
 
749
 
$Z0
750
 
        .LEAVE
751
 
        .PROCEND
752
 
;       .ALLOW
753
 
 
754
 
        .SPACE         $TEXT$
755
 
        .SUBSPA        $CODE$
756
 
#ifdef LITTLE_WORDIAN
757
 
        .EXPORT        maxpy_little,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,LONG_RETURN
758
 
        .EXPORT        add_diag_little,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,LONG_RETURN
759
 
#else
760
 
        .EXPORT        maxpy_big,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,LONG_RETURN
761
 
        .EXPORT        add_diag_big,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,LONG_RETURN
762
 
#endif
763
 
        .END
764
 
 
765
 
 
766
 
; How to use "maxpy_PA20_little" and "maxpy_PA20_big"
767
 
768
 
; The routine "maxpy_PA20_little" or "maxpy_PA20_big"
769
 
; performs a 64-bit x any-size multiply, and adds the
770
 
; result to an area of memory.  That is, it performs
771
 
; something like
772
 
773
 
;      A B C D
774
 
;    *       Z
775
 
;   __________
776
 
;    P Q R S T
777
 
778
 
; and then adds the "PQRST" vector into an area of memory,
779
 
; handling all carries.
780
 
781
 
; Digression on nomenclature and endian-ness:
782
 
783
 
; Each of the capital letters in the above represents a 64-bit
784
 
; quantity.  That is, you could think of the discussion as
785
 
; being in terms of radix-16-quintillion arithmetic.  The data
786
 
; type being manipulated is "unsigned long long int".  This
787
 
; requires the 64-bit extension of the HP-UX C compiler,
788
 
; available at release 10.  You need these compiler flags to
789
 
; enable these extensions:
790
 
791
 
;       -Aa +e +DA2.0 +DS2.0
792
 
793
 
; (The first specifies ANSI C, the second enables the
794
 
; extensions, which are beyond ANSI C, and the third and
795
 
; fourth tell the compiler to use whatever features of the
796
 
; PA2.0 architecture it wishes, in order to made the code more
797
 
; efficient.  Since the presence of the assembly code will
798
 
; make the program unable to run on anything less than PA2.0,
799
 
; you might as well gain the performance enhancements in the C
800
 
; code as well.)
801
 
802
 
; Questions of "endian-ness" often come up, usually in the
803
 
; context of byte ordering in a word.  These routines have a
804
 
; similar issue, that could be called "wordian-ness".
805
 
; Independent of byte ordering (PA is always big-endian), one
806
 
; can make two choices when representing extremely large
807
 
; numbers as arrays of 64-bit doublewords in memory.
808
 
809
 
; "Little-wordian" layout means that the least significant
810
 
; word of a number is stored at the lowest address.
811
 
812
 
;   MSW     LSW
813
 
;    |       |
814
 
;    V       V
815
 
816
 
;    A B C D E
817
 
818
 
;    ^     ^ ^
819
 
;    |     | |____ address 0
820
 
;    |     |
821
 
;    |     |_______address 8
822
 
;    |
823
 
;    address 32
824
 
825
 
; "Big-wordian" means that the most significant word is at the
826
 
; lowest address.
827
 
828
 
;   MSW     LSW
829
 
;    |       |
830
 
;    V       V
831
 
832
 
;    A B C D E
833
 
834
 
;    ^     ^ ^
835
 
;    |     | |____ address 32
836
 
;    |     |
837
 
;    |     |_______address 24
838
 
;    |
839
 
;    address 0
840
 
841
 
; When you compile the file, you must specify one or the other, with
842
 
; a switch "-DLITTLE_WORDIAN" or "-DBIG_WORDIAN".
843
 
844
 
;     Incidentally, you assemble this file as part of your
845
 
;     project with the same C compiler as the rest of the program.
846
 
;     My "makefile" for a superprecision arithmetic package has
847
 
;     the following stuff:
848
 
849
 
;     # definitions:
850
 
;     CC = cc -Aa +e -z +DA2.0 +DS2.0 +w1
851
 
;     CFLAGS = +O3
852
 
;     LDFLAGS = -L /usr/lib -Wl,-aarchive
853
 
854
 
;     # general build rule for ".s" files:
855
 
;     .s.o:
856
 
;             $(CC) $(CFLAGS) -c $< -DBIG_WORDIAN
857
 
858
 
;     # Now any bind step that calls for pa20.o will assemble pa20.s
859
 
860
 
; End of digression, back to arithmetic:
861
 
862
 
; The way we multiply two huge numbers is, of course, to multiply
863
 
; the "ABCD" vector by each of the "WXYZ" doublewords, adding
864
 
; the result vectors with increasing offsets, the way we learned
865
 
; in school, back before we all used calculators:
866
 
867
 
;            A B C D
868
 
;          * W X Y Z
869
 
;         __________
870
 
;          P Q R S T
871
 
;        E F G H I
872
 
;      M N O P Q
873
 
;  + R S T U V
874
 
;    _______________
875
 
;    F I N A L S U M
876
 
877
 
; So we call maxpy_PA20_big (in my case; my package is
878
 
; big-wordian) repeatedly, giving the W, X, Y, and Z arguments
879
 
; in turn as the "scalar", and giving the "ABCD" vector each
880
 
; time.  We direct it to add its result into an area of memory
881
 
; that we have cleared at the start.  We skew the exact
882
 
; location into that area with each call.
883
 
884
 
; The prototype for the function is
885
 
886
 
; extern void maxpy_PA20_big(
887
 
;    int length,        /* Number of doublewords in the multiplicand vector. */
888
 
;    const long long int *scalaraddr,    /* Address to fetch the scalar. */
889
 
;    const long long int *multiplicand,  /* The multiplicand vector. */
890
 
;    long long int *result);             /* Where to accumulate the result. */
891
 
892
 
; (You should place a copy of this prototype in an include file
893
 
; or in your C file.)
894
 
895
 
; Now, IN ALL CASES, the given address for the multiplicand or
896
 
; the result is that of the LEAST SIGNIFICANT DOUBLEWORD.
897
 
; That word is, of course, the word at which the routine
898
 
; starts processing.  "maxpy_PA20_little" then increases the
899
 
; addresses as it computes.  "maxpy_PA20_big" decreases them.
900
 
901
 
; In our example above, "length" would be 4 in each case.
902
 
; "multiplicand" would be the "ABCD" vector.  Specifically,
903
 
; the address of the element "D".  "scalaraddr" would be the
904
 
; address of "W", "X", "Y", or "Z" on the four calls that we
905
 
; would make.  (The order doesn't matter, of course.)
906
 
; "result" would be the appropriate address in the result
907
 
; area.  When multiplying by "Z", that would be the least
908
 
; significant word.  When multiplying by "Y", it would be the
909
 
; next higher word (8 bytes higher if little-wordian; 8 bytes
910
 
; lower if big-wordian), and so on.  The size of the result
911
 
; area must be the the sum of the sizes of the multiplicand
912
 
; and multiplier vectors, and must be initialized to zero
913
 
; before we start.
914
 
915
 
; Whenever the routine adds its partial product into the result
916
 
; vector, it follows carry chains as far as they need to go.
917
 
918
 
; Here is the super-precision multiply routine that I use for
919
 
; my package.  The package is big-wordian.  I have taken out
920
 
; handling of exponents (it's a floating point package):
921
 
922
 
; static void mul_PA20(
923
 
;   int size,
924
 
;   const long long int *arg1,
925
 
;   const long long int *arg2,
926
 
;   long long int *result)
927
 
; {
928
 
;    int i;
929
 
930
 
;    for (i=0 ; i<2*size ; i++) result[i] = 0ULL;
931
 
932
 
;    for (i=0 ; i<size ; i++) {
933
 
;       maxpy_PA20_big(size, &arg2[i], &arg1[size-1], &result[size+i]);
934
 
;    }
935
 
; }