~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/freebl/mpi/vis_32.il

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
!  The contents of this file are subject to the Mozilla Public
 
3
!  License Version 1.1 (the "License"); you may not use this file
 
4
!  except in compliance with the License. You may obtain a copy of
 
5
!  the License at http://www.mozilla.org/MPL/
 
6
!  
 
7
!  Software distributed under the License is distributed on an "AS
 
8
!  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
9
!  implied. See the License for the specific language governing
 
10
!  rights and limitations under the License.
 
11
!  
 
12
!  The Original Code is vis inline macros (32 bit).  (vis_32.il 3.3)
 
13
 
14
!  The Initial Developer of the Original Code is Sun Microsystems Inc.
 
15
!  Portions created by Sun Microsystems Inc. are 
 
16
!  Copyright (C) 1995-2000 Sun Microsystems Inc.  All Rights Reserved.
 
17
!  
 
18
!  Contributor(s):
 
19
!  
 
20
!  Alternatively, the contents of this file may be used under the
 
21
!  terms of the GNU General Public License Version 2 or later (the
 
22
!  "GPL"), in which case the provisions of the GPL are applicable 
 
23
!  instead of those above.      If you wish to allow use of your 
 
24
!  version of this file only under the terms of the GPL and not to
 
25
!  allow others to use your version of this file under the MPL,
 
26
!  indicate your decision by deleting the provisions above and
 
27
!  replace them with the notice and other provisions required by
 
28
!  the GPL.  If you do not delete the provisions above, a recipient
 
29
!  may use your version of this file under either the MPL or the
 
30
!  GPL.
 
31
!   $Id: vis_32.il,v 1.1 2000/09/29 23:38:04 nelsonb%netscape.com Exp $
 
32
 
33
! @(#)vis_32.il 3.3     00/03/02 SMI
 
34
 
 
35
! The interface to the VIS instructions as declared below (and in the VIS
 
36
! User's Manual) will not change, but the macro implementation might change
 
37
! in the future.
 
38
 
 
39
!--------------------------------------------------------------------
 
40
! Pure edge handling instructions
 
41
!
 
42
! int vis_edge8(void */*frs1*/, void */*frs2*/);
 
43
!
 
44
        .inline vis_edge8,8
 
45
        edge8   %o0,%o1,%o0
 
46
        .end
 
47
!
 
48
! int vis_edge8l(void */*frs1*/, void */*frs2*/);
 
49
!
 
50
        .inline vis_edge8l,8
 
51
        edge8l  %o0,%o1,%o0
 
52
        .end
 
53
!
 
54
! int vis_edge16(void */*frs1*/, void */*frs2*/);
 
55
!
 
56
        .inline vis_edge16,8
 
57
        edge16  %o0,%o1,%o0
 
58
        .end
 
59
!
 
60
! int vis_edge16l(void */*frs1*/, void */*frs2*/);
 
61
!
 
62
        .inline vis_edge16l,8
 
63
        edge16l %o0,%o1,%o0
 
64
        .end
 
65
!
 
66
! int vis_edge32(void */*frs1*/, void */*frs2*/);
 
67
!
 
68
        .inline vis_edge32,8
 
69
        edge32  %o0,%o1,%o0
 
70
        .end
 
71
!
 
72
! int vis_edge32l(void */*frs1*/, void */*frs2*/);
 
73
!
 
74
        .inline vis_edge32l,8
 
75
        edge32l %o0,%o1,%o0
 
76
        .end
 
77
 
 
78
!--------------------------------------------------------------------
 
79
! Edge handling instructions with negative return values if cc set
 
80
!
 
81
! int vis_edge8cc(void */*frs1*/, void */*frs2*/);
 
82
!
 
83
        .inline vis_edge8cc,8
 
84
        edge8   %o0,%o1,%o0
 
85
        mov     0,%o1
 
86
        movgu   %icc,-1024,%o1
 
87
        or      %o1,%o0,%o0
 
88
        .end
 
89
!
 
90
! int vis_edge8lcc(void */*frs1*/, void */*frs2*/);
 
91
!
 
92
        .inline vis_edge8lcc,8
 
93
        edge8l  %o0,%o1,%o0
 
94
        mov     0,%o1
 
95
        movgu   %icc,-1024,%o1
 
96
        or      %o1,%o0,%o0
 
97
        .end
 
98
!
 
99
! int vis_edge16cc(void */*frs1*/, void */*frs2*/);
 
100
!
 
101
        .inline vis_edge16cc,8
 
102
        edge16  %o0,%o1,%o0
 
103
        mov     0,%o1
 
104
        movgu   %icc,-1024,%o1
 
105
        or      %o1,%o0,%o0
 
106
        .end
 
107
!
 
108
! int vis_edge16lcc(void */*frs1*/, void */*frs2*/);
 
109
!
 
110
        .inline vis_edge16lcc,8
 
111
        edge16l %o0,%o1,%o0
 
112
        mov     0,%o1
 
113
        movgu   %icc,-1024,%o1
 
114
        or      %o1,%o0,%o0
 
115
        .end
 
116
!
 
117
! int vis_edge32cc(void */*frs1*/, void */*frs2*/);
 
118
!
 
119
        .inline vis_edge32cc,8
 
120
        edge32  %o0,%o1,%o0
 
121
        mov     0,%o1
 
122
        movgu   %icc,-1024,%o1
 
123
        or      %o1,%o0,%o0
 
124
        .end
 
125
!
 
126
! int vis_edge32lcc(void */*frs1*/, void */*frs2*/);
 
127
!
 
128
        .inline vis_edge32lcc,8
 
129
        edge32l %o0,%o1,%o0
 
130
        mov     0,%o1
 
131
        movgu   %icc,-1024,%o1
 
132
        or      %o1,%o0,%o0
 
133
        .end
 
134
 
 
135
!--------------------------------------------------------------------
 
136
! Alignment instructions
 
137
!
 
138
! void *vis_alignaddr(void */*rs1*/, int /*rs2*/);
 
139
!
 
140
        .inline vis_alignaddr,8
 
141
        alignaddr       %o0,%o1,%o0
 
142
        .end
 
143
!
 
144
! void *vis_alignaddrl(void */*rs1*/, int /*rs2*/);
 
145
!
 
146
        .inline vis_alignaddrl,8
 
147
        alignaddrl      %o0,%o1,%o0
 
148
        .end
 
149
!
 
150
! double vis_faligndata(double /*frs1*/, double /*frs2*/);
 
151
!
 
152
        .inline vis_faligndata,16
 
153
        std     %o0,[%sp+0x48]
 
154
        ldd     [%sp+0x48],%f4
 
155
        std     %o2,[%sp+0x48]
 
156
        ldd     [%sp+0x48],%f10
 
157
        faligndata      %f4,%f10,%f0
 
158
        .end
 
159
 
 
160
!--------------------------------------------------------------------
 
161
! Partitioned comparison instructions
 
162
!
 
163
! int vis_fcmple16(double /*frs1*/, double /*frs2*/);
 
164
!
 
165
        .inline vis_fcmple16,16
 
166
        std     %o0,[%sp+0x48]
 
167
        ldd     [%sp+0x48],%f4
 
168
        std     %o2,[%sp+0x48]
 
169
        ldd     [%sp+0x48],%f10
 
170
        fcmple16        %f4,%f10,%o0
 
171
        .end
 
172
!
 
173
! int vis_fcmpne16(double /*frs1*/, double /*frs2*/);
 
174
!
 
175
        .inline vis_fcmpne16,16
 
176
        std     %o0,[%sp+0x48]
 
177
        ldd     [%sp+0x48],%f4
 
178
        std     %o2,[%sp+0x48]
 
179
        ldd     [%sp+0x48],%f10
 
180
        fcmpne16        %f4,%f10,%o0
 
181
        .end
 
182
!
 
183
! int vis_fcmple32(double /*frs1*/, double /*frs2*/);
 
184
!
 
185
        .inline vis_fcmple32,16
 
186
        std     %o0,[%sp+0x48]
 
187
        ldd     [%sp+0x48],%f4
 
188
        std     %o2,[%sp+0x48]
 
189
        ldd     [%sp+0x48],%f10
 
190
        fcmple32        %f4,%f10,%o0
 
191
        .end
 
192
!
 
193
! int vis_fcmpne32(double /*frs1*/, double /*frs2*/);
 
194
!
 
195
        .inline vis_fcmpne32,16
 
196
        std     %o0,[%sp+0x48]
 
197
        ldd     [%sp+0x48],%f4
 
198
        std     %o2,[%sp+0x48]
 
199
        ldd     [%sp+0x48],%f10
 
200
        fcmpne32        %f4,%f10,%o0
 
201
        .end
 
202
!
 
203
! int vis_fcmpgt16(double /*frs1*/, double /*frs2*/);
 
204
!
 
205
        .inline vis_fcmpgt16,16
 
206
        std     %o0,[%sp+0x48]
 
207
        ldd     [%sp+0x48],%f4
 
208
        std     %o2,[%sp+0x48]
 
209
        ldd     [%sp+0x48],%f10
 
210
        fcmpgt16        %f4,%f10,%o0
 
211
        .end
 
212
!
 
213
! int vis_fcmpeq16(double /*frs1*/, double /*frs2*/);
 
214
!
 
215
        .inline vis_fcmpeq16,16
 
216
        std     %o0,[%sp+0x48]
 
217
        ldd     [%sp+0x48],%f4
 
218
        std     %o2,[%sp+0x48]
 
219
        ldd     [%sp+0x48],%f10
 
220
        fcmpeq16        %f4,%f10,%o0
 
221
        .end
 
222
!
 
223
! int vis_fcmpgt32(double /*frs1*/, double /*frs2*/);
 
224
!
 
225
        .inline vis_fcmpgt32,16
 
226
        std     %o0,[%sp+0x48]
 
227
        ldd     [%sp+0x48],%f4
 
228
        std     %o2,[%sp+0x48]
 
229
        ldd     [%sp+0x48],%f10
 
230
        fcmpgt32        %f4,%f10,%o0
 
231
        .end
 
232
!
 
233
! int vis_fcmpeq32(double /*frs1*/, double /*frs2*/);
 
234
!
 
235
        .inline vis_fcmpeq32,16
 
236
        std     %o0,[%sp+0x48]
 
237
        ldd     [%sp+0x48],%f4
 
238
        std     %o2,[%sp+0x48]
 
239
        ldd     [%sp+0x48],%f10
 
240
        fcmpeq32        %f4,%f10,%o0
 
241
        .end
 
242
 
 
243
!--------------------------------------------------------------------
 
244
! Partitioned arithmetic
 
245
!
 
246
! double vis_fmul8x16(float /*frs1*/, double /*frs2*/);
 
247
!
 
248
        .inline vis_fmul8x16,12
 
249
        st      %o0,[%sp+0x44]
 
250
        ld      [%sp+0x44],%f4
 
251
        st      %o1,[%sp+0x48]
 
252
        st      %o2,[%sp+0x4c]
 
253
        ldd     [%sp+0x48],%f10
 
254
        fmul8x16        %f4,%f10,%f0
 
255
        .end
 
256
!
 
257
! double vis_fmul8x16_dummy(float /*frs1*/, int /*dummy*/, double /*frs2*/);
 
258
!
 
259
        .inline vis_fmul8x16_dummy,16
 
260
        st      %o0,[%sp+0x44]
 
261
        ld      [%sp+0x44],%f4
 
262
        std     %o2,[%sp+0x48]
 
263
        ldd     [%sp+0x48],%f10
 
264
        fmul8x16        %f4,%f10,%f0
 
265
        .end
 
266
!
 
267
! double vis_fmul8x16au(float /*frs1*/, float /*frs2*/);
 
268
!
 
269
        .inline vis_fmul8x16au,8
 
270
        st      %o0,[%sp+0x48]
 
271
        ld      [%sp+0x48],%f4
 
272
        st      %o1,[%sp+0x48]
 
273
        ld      [%sp+0x48],%f10
 
274
        fmul8x16au      %f4,%f10,%f0
 
275
        .end
 
276
!
 
277
! double vis_fmul8x16al(float /*frs1*/, float /*frs2*/);
 
278
!
 
279
        .inline vis_fmul8x16al,8
 
280
        st      %o0,[%sp+0x44]
 
281
        ld      [%sp+0x44],%f4
 
282
        st      %o1,[%sp+0x48]
 
283
        ld      [%sp+0x48],%f10
 
284
        fmul8x16al      %f4,%f10,%f0
 
285
        .end
 
286
!
 
287
! double vis_fmul8sux16(double /*frs1*/, double /*frs2*/);
 
288
!
 
289
        .inline vis_fmul8sux16,16
 
290
        std     %o0,[%sp+0x48]
 
291
        ldd     [%sp+0x48],%f4
 
292
        std     %o2,[%sp+0x48]
 
293
        ldd     [%sp+0x48],%f10
 
294
        fmul8sux16      %f4,%f10,%f0
 
295
        .end
 
296
!
 
297
! double vis_fmul8ulx16(double /*frs1*/, double /*frs2*/);
 
298
!
 
299
        .inline vis_fmul8ulx16,16
 
300
        std     %o0,[%sp+0x48]
 
301
        ldd     [%sp+0x48],%f4
 
302
        std     %o2,[%sp+0x48]
 
303
        ldd     [%sp+0x48],%f10
 
304
        fmul8ulx16      %f4,%f10,%f0
 
305
        .end
 
306
!
 
307
! double vis_fmuld8sux16(float /*frs1*/, float /*frs2*/);
 
308
!
 
309
        .inline vis_fmuld8sux16,8
 
310
        st      %o0,[%sp+0x48]
 
311
        ld      [%sp+0x48],%f4
 
312
        st      %o1,[%sp+0x48]
 
313
        ld      [%sp+0x48],%f10
 
314
        fmuld8sux16     %f4,%f10,%f0
 
315
        .end
 
316
!
 
317
! double vis_fmuld8ulx16(float /*frs1*/, float /*frs2*/);
 
318
!
 
319
        .inline vis_fmuld8ulx16,8
 
320
        st      %o0,[%sp+0x48]
 
321
        ld      [%sp+0x48],%f4
 
322
        st      %o1,[%sp+0x48]
 
323
        ld      [%sp+0x48],%f10
 
324
        fmuld8ulx16     %f4,%f10,%f0
 
325
        .end
 
326
!
 
327
! double vis_fpadd16(double /*frs1*/, double /*frs2*/);
 
328
!
 
329
        .inline vis_fpadd16,16
 
330
        std     %o0,[%sp+0x40]
 
331
        ldd     [%sp+0x40],%f4
 
332
        std     %o2,[%sp+0x48]
 
333
        ldd     [%sp+0x48],%f10
 
334
        fpadd16 %f4,%f10,%f0
 
335
        .end
 
336
!
 
337
! float vis_fpadd16s(float /*frs1*/, float /*frs2*/);
 
338
!
 
339
        .inline vis_fpadd16s,8
 
340
        st      %o0,[%sp+0x48]
 
341
        ld      [%sp+0x48],%f4
 
342
        st      %o1,[%sp+0x48]
 
343
        ld      [%sp+0x48],%f10
 
344
        fpadd16s        %f4,%f10,%f0
 
345
        .end
 
346
!
 
347
! double vis_fpadd32(double /*frs1*/, double /*frs2*/);
 
348
!
 
349
        .inline vis_fpadd32,16
 
350
        std     %o0,[%sp+0x48]
 
351
        ldd     [%sp+0x48],%f4
 
352
        std     %o2,[%sp+0x48]
 
353
        ldd     [%sp+0x48],%f10
 
354
        fpadd32 %f4,%f10,%f0
 
355
        .end
 
356
!
 
357
! float vis_fpadd32s(float /*frs1*/, float /*frs2*/);
 
358
!
 
359
        .inline vis_fpadd32s,8
 
360
        st      %o0,[%sp+0x48]
 
361
        ld      [%sp+0x48],%f4
 
362
        st      %o1,[%sp+0x48]
 
363
        ld      [%sp+0x48],%f10
 
364
        fpadd32s        %f4,%f10,%f0
 
365
        .end
 
366
!
 
367
! double vis_fpsub16(double /*frs1*/, double /*frs2*/);
 
368
!
 
369
        .inline vis_fpsub16,16
 
370
        std     %o0,[%sp+0x48]
 
371
        ldd     [%sp+0x48],%f4
 
372
        std     %o2,[%sp+0x48]
 
373
        ldd     [%sp+0x48],%f10
 
374
        fpsub16 %f4,%f10,%f0
 
375
        .end
 
376
!
 
377
! float vis_fpsub16s(float /*frs1*/, float /*frs2*/);
 
378
!
 
379
        .inline vis_fpsub16s,8
 
380
        st      %o0,[%sp+0x48]
 
381
        ld      [%sp+0x48],%f4
 
382
        st      %o1,[%sp+0x48]
 
383
        ld      [%sp+0x48],%f10
 
384
        fpsub16s        %f4,%f10,%f0
 
385
        .end
 
386
!
 
387
! double vis_fpsub32(double /*frs1*/, double /*frs2*/);
 
388
!
 
389
        .inline vis_fpsub32,16
 
390
        std     %o0,[%sp+0x48]
 
391
        ldd     [%sp+0x48],%f4
 
392
        std     %o2,[%sp+0x48]
 
393
        ldd     [%sp+0x48],%f10
 
394
        fpsub32 %f4,%f10,%f0
 
395
        .end
 
396
!
 
397
! float vis_fpsub32s(float /*frs1*/, float /*frs2*/);
 
398
!
 
399
        .inline vis_fpsub32s,8
 
400
        st      %o0,[%sp+0x48]
 
401
        ld      [%sp+0x48],%f4
 
402
        st      %o1,[%sp+0x48]
 
403
        ld      [%sp+0x48],%f10
 
404
        fpsub32s        %f4,%f10,%f0
 
405
        .end
 
406
 
 
407
!--------------------------------------------------------------------
 
408
! Pixel packing
 
409
!
 
410
! float vis_fpack16(double /*frs2*/);
 
411
!
 
412
        .inline vis_fpack16,8
 
413
        std     %o0,[%sp+0x48]
 
414
        ldd     [%sp+0x48],%f4
 
415
        fpack16 %f4,%f0
 
416
        .end
 
417
 
 
418
!
 
419
! double vis_fpack16_pair(double /*frs2*/, double /*frs2*/);
 
420
!
 
421
        .inline vis_fpack16_pair,16
 
422
        std     %o0,[%sp+0x48]
 
423
        ldd     [%sp+0x48],%f4
 
424
        std     %o2,[%sp+0x48]
 
425
        ldd     [%sp+0x48],%f10
 
426
        fpack16 %f4,%f0
 
427
        fpack16 %f10,%f1
 
428
        .end
 
429
!
 
430
! void vis_st2_fpack16(double, double, double *)
 
431
!
 
432
        .inline vis_st2_fpack16,20
 
433
        std     %o0,[%sp+0x48]
 
434
        ldd     [%sp+0x48],%f4
 
435
        std     %o2,[%sp+0x48]
 
436
        ldd     [%sp+0x48],%f10
 
437
        fpack16 %f4,%f0
 
438
        fpack16 %f10,%f1
 
439
        st      %f0,[%o4+0]
 
440
        st      %f1,[%o4+4]
 
441
        .end
 
442
!
 
443
! void vis_std_fpack16(double, double, double *)
 
444
!
 
445
        .inline vis_std_fpack16,20
 
446
        std     %o0,[%sp+0x48]
 
447
        ldd     [%sp+0x48],%f4
 
448
        std     %o2,[%sp+0x48]
 
449
        ldd     [%sp+0x48],%f10
 
450
        fpack16 %f4,%f0
 
451
        fpack16 %f10,%f1
 
452
        std     %f0,[%o4]
 
453
        .end
 
454
!
 
455
! void vis_st2_fpackfix(double, double, double *)
 
456
!
 
457
        .inline vis_st2_fpackfix,20
 
458
        std     %o0,[%sp+0x48]
 
459
        ldd     [%sp+0x48],%f4
 
460
        std     %o2,[%sp+0x48]
 
461
        ldd     [%sp+0x48],%f10
 
462
        fpackfix %f4,%f0
 
463
        fpackfix %f10,%f1
 
464
        st      %f0,[%o4+0]
 
465
        st      %f1,[%o4+4]
 
466
        .end
 
467
!
 
468
! double vis_fpack16_to_hi(double /*frs1*/, double /*frs2*/);
 
469
!
 
470
        .inline vis_fpack16_to_hi,16
 
471
        std     %o0,[%sp+0x48]
 
472
        ldd     [%sp+0x48],%f0
 
473
        std     %o2,[%sp+0x48]
 
474
        ldd     [%sp+0x48],%f4
 
475
        fpack16 %f4,%f0
 
476
        .end
 
477
 
 
478
! double vis_fpack16_to_lo(double /*frs1*/, double /*frs2*/);
 
479
!
 
480
        .inline vis_fpack16_to_lo,16
 
481
        std     %o0,[%sp+0x48]
 
482
        ldd     [%sp+0x48],%f0
 
483
        std     %o2,[%sp+0x48]
 
484
        ldd     [%sp+0x48],%f4
 
485
        fpack16 %f4,%f3
 
486
        fmovs   %f3,%f1         /* without this, optimizer goes wrong */
 
487
        .end
 
488
 
 
489
!
 
490
! double vis_fpack32(double /*frs1*/, double /*frs2*/);
 
491
!
 
492
        .inline vis_fpack32,16
 
493
        std     %o0,[%sp+0x48]
 
494
        ldd     [%sp+0x48],%f4
 
495
        std     %o2,[%sp+0x48]
 
496
        ldd     [%sp+0x48],%f10
 
497
        fpack32 %f4,%f10,%f0
 
498
        .end
 
499
!
 
500
! float vis_fpackfix(double /*frs2*/);
 
501
!
 
502
        .inline vis_fpackfix,8
 
503
        std     %o0,[%sp+0x48]
 
504
        ldd     [%sp+0x48],%f4
 
505
        fpackfix        %f4,%f0
 
506
        .end
 
507
!
 
508
! double vis_fpackfix_pair(double /*frs2*/, double /*frs2*/);
 
509
!
 
510
        .inline vis_fpackfix_pair,16
 
511
        std     %o0,[%sp+0x48]
 
512
        ldd     [%sp+0x48],%f4
 
513
        std     %o2,[%sp+0x48]
 
514
        ldd     [%sp+0x48],%f6
 
515
        fpackfix        %f4,%f0
 
516
        fpackfix        %f6,%f1
 
517
        .end
 
518
 
 
519
!--------------------------------------------------------------------
 
520
! Motion estimation
 
521
!
 
522
! double vis_pdist(double /*frs1*/, double /*frs2*/, double /*frd*/);
 
523
!
 
524
        .inline vis_pdist,24
 
525
        std     %o4,[%sp+0x48]
 
526
        ldd     [%sp+0x48],%f0
 
527
        std     %o0,[%sp+0x48]
 
528
        ldd     [%sp+0x48],%f4
 
529
        std     %o2,[%sp+0x48]
 
530
        ldd     [%sp+0x48],%f10
 
531
        pdist   %f4,%f10,%f0
 
532
        .end
 
533
 
 
534
!--------------------------------------------------------------------
 
535
! Channel merging
 
536
!
 
537
! double vis_fpmerge(float /*frs1*/, float /*frs2*/);
 
538
!
 
539
        .inline vis_fpmerge,8
 
540
        st      %o0,[%sp+0x48]
 
541
        ld      [%sp+0x48],%f4
 
542
        st      %o1,[%sp+0x48]
 
543
        ld      [%sp+0x48],%f10
 
544
        fpmerge %f4,%f10,%f0
 
545
        .end
 
546
 
 
547
!--------------------------------------------------------------------
 
548
! Pixel expansion
 
549
!
 
550
! double vis_fexpand(float /*frs2*/);
 
551
!
 
552
        .inline vis_fexpand,4
 
553
        st      %o0,[%sp+0x48]
 
554
        ld      [%sp+0x48],%f4
 
555
        fexpand %f4,%f0
 
556
        .end
 
557
 
 
558
! double vis_fexpand_hi(double /*frs2*/);
 
559
!
 
560
        .inline vis_fexpand_hi,8
 
561
        std     %o0,[%sp+0x48]
 
562
        ldd     [%sp+0x48],%f4
 
563
        fexpand %f4,%f0
 
564
        .end
 
565
 
 
566
! double vis_fexpand_lo(double /*frs2*/);
 
567
!
 
568
        .inline vis_fexpand_lo,8
 
569
        std     %o0,[%sp+0x48]
 
570
        ldd     [%sp+0x48],%f4
 
571
        fmovs   %f5, %f2
 
572
        fexpand %f2,%f0
 
573
        .end
 
574
 
 
575
!--------------------------------------------------------------------
 
576
! Bitwise logical operations
 
577
!
 
578
! double vis_fnor(double /*frs1*/, double /*frs2*/);
 
579
!
 
580
        .inline vis_fnor,16
 
581
        std     %o0,[%sp+0x48]
 
582
        ldd     [%sp+0x48],%f4
 
583
        std     %o2,[%sp+0x48]
 
584
        ldd     [%sp+0x48],%f10
 
585
        fnor    %f4,%f10,%f0
 
586
        .end
 
587
!
 
588
! float vis_fnors(float /*frs1*/, float /*frs2*/);
 
589
!
 
590
        .inline vis_fnors,8
 
591
        st      %o0,[%sp+0x48]
 
592
        ld      [%sp+0x48],%f4
 
593
        st      %o1,[%sp+0x48]
 
594
        ld      [%sp+0x48],%f10
 
595
        fnors   %f4,%f10,%f0
 
596
        .end
 
597
!
 
598
! double vis_fandnot(double /*frs1*/, double /*frs2*/);
 
599
!
 
600
        .inline vis_fandnot,16
 
601
        std     %o0,[%sp+0x48]
 
602
        ldd     [%sp+0x48],%f4
 
603
        std     %o2,[%sp+0x48]
 
604
        ldd     [%sp+0x48],%f10
 
605
        fandnot1        %f4,%f10,%f0
 
606
        .end
 
607
!
 
608
! float vis_fandnots(float /*frs1*/, float /*frs2*/);
 
609
!
 
610
        .inline vis_fandnots,8
 
611
        st      %o0,[%sp+0x48]
 
612
        ld      [%sp+0x48],%f4
 
613
        st      %o1,[%sp+0x48]
 
614
        ld      [%sp+0x48],%f10
 
615
        fandnot1s       %f4,%f10,%f0
 
616
        .end
 
617
!
 
618
! double vis_fnot(double /*frs1*/);
 
619
!
 
620
        .inline vis_fnot,8
 
621
        std     %o0,[%sp+0x48]
 
622
        ldd     [%sp+0x48],%f4
 
623
        fnot1   %f4,%f0
 
624
        .end
 
625
!
 
626
! float vis_fnots(float /*frs1*/);
 
627
!
 
628
        .inline vis_fnots,4
 
629
        st      %o0,[%sp+0x48]
 
630
        ld      [%sp+0x48],%f4
 
631
        fnot1s  %f4,%f0
 
632
        .end
 
633
!
 
634
! double vis_fxor(double /*frs1*/, double /*frs2*/);
 
635
!
 
636
        .inline vis_fxor,16
 
637
        std     %o0,[%sp+0x48]
 
638
        ldd     [%sp+0x48],%f4
 
639
        std     %o2,[%sp+0x48]
 
640
        ldd     [%sp+0x48],%f10
 
641
        fxor    %f4,%f10,%f0
 
642
        .end
 
643
!
 
644
! float vis_fxors(float /*frs1*/, float /*frs2*/);
 
645
!
 
646
        .inline vis_fxors,8
 
647
        st      %o0,[%sp+0x48]
 
648
        ld      [%sp+0x48],%f4
 
649
        st      %o1,[%sp+0x48]
 
650
        ld      [%sp+0x48],%f10
 
651
        fxors   %f4,%f10,%f0
 
652
        .end
 
653
!
 
654
! double vis_fnand(double /*frs1*/, double /*frs2*/);
 
655
!
 
656
        .inline vis_fnand,16
 
657
        std     %o0,[%sp+0x48]
 
658
        ldd     [%sp+0x48],%f4
 
659
        std     %o2,[%sp+0x48]
 
660
        ldd     [%sp+0x48],%f10
 
661
        fnand   %f4,%f10,%f0
 
662
        .end
 
663
!
 
664
! float vis_fnands(float /*frs1*/, float /*frs2*/);
 
665
!
 
666
        .inline vis_fnands,8
 
667
        st      %o0,[%sp+0x48]
 
668
        ld      [%sp+0x48],%f4
 
669
        st      %o1,[%sp+0x48]
 
670
        ld      [%sp+0x48],%f10
 
671
        fnands  %f4,%f10,%f0
 
672
        .end
 
673
!
 
674
! double vis_fand(double /*frs1*/, double /*frs2*/);
 
675
!
 
676
        .inline vis_fand,16
 
677
        std     %o0,[%sp+0x48]
 
678
        ldd     [%sp+0x48],%f4
 
679
        std     %o2,[%sp+0x48]
 
680
        ldd     [%sp+0x48],%f10
 
681
        fand    %f4,%f10,%f0
 
682
        .end
 
683
!
 
684
! float vis_fands(float /*frs1*/, float /*frs2*/);
 
685
!
 
686
        .inline vis_fands,8
 
687
        st      %o0,[%sp+0x48]
 
688
        ld      [%sp+0x48],%f4
 
689
        st      %o1,[%sp+0x48]
 
690
        ld      [%sp+0x48],%f10
 
691
        fands   %f4,%f10,%f0
 
692
        .end
 
693
!
 
694
! double vis_fxnor(double /*frs1*/, double /*frs2*/);
 
695
!
 
696
        .inline vis_fxnor,16
 
697
        std     %o0,[%sp+0x48]
 
698
        ldd     [%sp+0x48],%f4
 
699
        std     %o2,[%sp+0x48]
 
700
        ldd     [%sp+0x48],%f10
 
701
        fxnor   %f4,%f10,%f0
 
702
        .end
 
703
!
 
704
! float vis_fxnors(float /*frs1*/, float /*frs2*/);
 
705
!
 
706
        .inline vis_fxnors,8
 
707
        st      %o0,[%sp+0x48]
 
708
        ld      [%sp+0x48],%f4
 
709
        st      %o1,[%sp+0x48]
 
710
        ld      [%sp+0x48],%f10
 
711
        fxnors  %f4,%f10,%f0
 
712
        .end
 
713
!
 
714
! double vis_fsrc(double /*frs1*/);
 
715
!
 
716
        .inline vis_fsrc,8
 
717
        std     %o0,[%sp+0x48]
 
718
        ldd     [%sp+0x48],%f4
 
719
        fsrc1   %f4,%f0
 
720
        .end
 
721
!
 
722
! float vis_fsrcs(float /*frs1*/);
 
723
!
 
724
        .inline vis_fsrcs,4
 
725
        st      %o0,[%sp+0x48]
 
726
        ld      [%sp+0x48],%f4
 
727
        fsrc1s  %f4,%f0
 
728
        .end
 
729
!
 
730
! double vis_fornot(double /*frs1*/, double /*frs2*/);
 
731
!
 
732
        .inline vis_fornot,16
 
733
        std     %o0,[%sp+0x48]
 
734
        ldd     [%sp+0x48],%f4
 
735
        std     %o2,[%sp+0x48]
 
736
        ldd     [%sp+0x48],%f10
 
737
        fornot1 %f4,%f10,%f0
 
738
        .end
 
739
!
 
740
! float vis_fornots(float /*frs1*/, float /*frs2*/);
 
741
!
 
742
        .inline vis_fornots,8
 
743
        st      %o0,[%sp+0x48]
 
744
        ld      [%sp+0x48],%f4
 
745
        st      %o1,[%sp+0x48]
 
746
        ld      [%sp+0x48],%f10
 
747
        fornot1s        %f4,%f10,%f0
 
748
        .end
 
749
!
 
750
! double vis_for(double /*frs1*/, double /*frs2*/);
 
751
!
 
752
        .inline vis_for,16
 
753
        std     %o0,[%sp+0x48]
 
754
        ldd     [%sp+0x48],%f4
 
755
        std     %o2,[%sp+0x48]
 
756
        ldd     [%sp+0x48],%f10
 
757
        for     %f4,%f10,%f0
 
758
        .end
 
759
!
 
760
! float vis_fors(float /*frs1*/, float /*frs2*/);
 
761
!
 
762
        .inline vis_fors,8
 
763
        st      %o0,[%sp+0x48]
 
764
        ld      [%sp+0x48],%f4
 
765
        st      %o1,[%sp+0x48]
 
766
        ld      [%sp+0x48],%f10
 
767
        fors    %f4,%f10,%f0
 
768
        .end
 
769
!
 
770
! double vis_fzero(/* void */)
 
771
!
 
772
        .inline vis_fzero,0
 
773
        fzero   %f0
 
774
        .end
 
775
!
 
776
! float vis_fzeros(/* void */)
 
777
!
 
778
        .inline vis_fzeros,0
 
779
        fzeros  %f0
 
780
        .end
 
781
!
 
782
! double vis_fone(/* void */)
 
783
!
 
784
        .inline vis_fone,0
 
785
        fone    %f0
 
786
        .end
 
787
!
 
788
! float vis_fones(/* void */)
 
789
!
 
790
        .inline vis_fones,0
 
791
        fones   %f0
 
792
        .end
 
793
 
 
794
!--------------------------------------------------------------------
 
795
! Partial store instructions
 
796
!
 
797
! vis_stdfa_ASI_PST8P(double frd, void *rs1, int rmask)
 
798
!
 
799
        .inline vis_stdfa_ASI_PST8P,16
 
800
        std     %o0,[%sp+0x48]
 
801
        ldd     [%sp+0x48],%f4
 
802
        stda    %f4,[%o2]%o3,0xc0       ! ASI_PST8_P
 
803
        .end
 
804
!
 
805
! vis_stdfa_ASI_PST8PL(double frd, void *rs1, int rmask)
 
806
!
 
807
        .inline vis_stdfa_ASI_PST8PL,16
 
808
        std     %o0,[%sp+0x48]
 
809
        ldd     [%sp+0x48],%f4
 
810
        stda    %f4,[%o2]%o3,0xc8       ! ASI_PST8_PL
 
811
        .end
 
812
!
 
813
! vis_stdfa_ASI_PST8P_int_pair(void *rs1, void *rs2, void *rs3, int rmask);
 
814
!
 
815
        .inline vis_stdfa_ASI_PST8P_int_pair,16
 
816
        ld      [%o0],%f4
 
817
        ld      [%o1],%f5
 
818
        stda    %f4,[%o2]%o3,0xc0       ! ASI_PST8_P
 
819
        .end
 
820
!
 
821
! vis_stdfa_ASI_PST8S(double frd, void *rs1, int rmask)
 
822
!
 
823
        .inline vis_stdfa_ASI_PST8S,16
 
824
        std     %o0,[%sp+0x48]
 
825
        ldd     [%sp+0x48],%f4
 
826
        stda    %f4,[%o2]%o3,0xc1       ! ASI_PST8_S
 
827
        .end
 
828
!
 
829
! vis_stdfa_ASI_PST16P(double frd, void *rs1, int rmask)
 
830
!
 
831
        .inline vis_stdfa_ASI_PST16P,16
 
832
        std     %o0,[%sp+0x48]
 
833
        ldd     [%sp+0x48],%f4
 
834
        stda    %f4,[%o2]%o3,0xc2       ! ASI_PST16_P
 
835
        .end
 
836
!
 
837
! vis_stdfa_ASI_PST16S(double frd, void *rs1, int rmask)
 
838
!
 
839
        .inline vis_stdfa_ASI_PST16S,16
 
840
        std     %o0,[%sp+0x48]
 
841
        ldd     [%sp+0x48],%f4
 
842
        stda    %f4,[%o2]%o3,0xc3       ! ASI_PST16_S
 
843
        .end
 
844
!
 
845
! vis_stdfa_ASI_PST32P(double frd, void *rs1, int rmask)
 
846
!
 
847
        .inline vis_stdfa_ASI_PST32P,16
 
848
        std     %o0,[%sp+0x48]
 
849
        ldd     [%sp+0x48],%f4
 
850
        stda    %f4,[%o2]%o3,0xc4       ! ASI_PST32_P
 
851
        .end
 
852
!
 
853
! vis_stdfa_ASI_PST32S(double frd, void *rs1, int rmask)
 
854
!
 
855
        .inline vis_stdfa_ASI_PST32S,16
 
856
        std     %o0,[%sp+0x48]
 
857
        ldd     [%sp+0x48],%f4
 
858
        stda    %f4,[%o2]%o3,0xc5       ! ASI_PST32_S
 
859
        .end
 
860
 
 
861
!--------------------------------------------------------------------
 
862
! Short store instructions
 
863
!
 
864
! vis_stdfa_ASI_FL8P(double frd, void *rs1)
 
865
!
 
866
        .inline vis_stdfa_ASI_FL8P,12
 
867
        std     %o0,[%sp+0x48]
 
868
        ldd     [%sp+0x48],%f4
 
869
        stda    %f4,[%o2]0xd0   ! ASI_FL8_P
 
870
        .end
 
871
!
 
872
! vis_stdfa_ASI_FL8P_index(double frd, void *rs1, long index)
 
873
!
 
874
        .inline vis_stdfa_ASI_FL8P_index,16
 
875
        std     %o0,[%sp+0x48]
 
876
        ldd     [%sp+0x48],%f4
 
877
        stda    %f4,[%o2+%o3]0xd0 ! ASI_FL8_P
 
878
        .end
 
879
!
 
880
! vis_stdfa_ASI_FL8S(double frd, void *rs1)
 
881
!
 
882
        .inline vis_stdfa_ASI_FL8S,12
 
883
        std     %o0,[%sp+0x48]
 
884
        ldd     [%sp+0x48],%f4
 
885
        stda    %f4,[%o2]0xd1   ! ASI_FL8_S
 
886
        .end
 
887
!
 
888
! vis_stdfa_ASI_FL16P(double frd, void *rs1)
 
889
!
 
890
        .inline vis_stdfa_ASI_FL16P,12
 
891
        std     %o0,[%sp+0x48]
 
892
        ldd     [%sp+0x48],%f4
 
893
        stda    %f4,[%o2]0xd2   ! ASI_FL16_P
 
894
        .end
 
895
!
 
896
! vis_stdfa_ASI_FL16P_index(double frd, void *rs1, long index)
 
897
!
 
898
        .inline vis_stdfa_ASI_FL16P_index,16
 
899
        std     %o0,[%sp+0x48]
 
900
        ldd     [%sp+0x48],%f4
 
901
        stda    %f4,[%o2+%o3]0xd2 ! ASI_FL16_P
 
902
        .end
 
903
!
 
904
! vis_stdfa_ASI_FL16S(double frd, void *rs1)
 
905
!
 
906
        .inline vis_stdfa_ASI_FL16S,12
 
907
        std     %o0,[%sp+0x48]
 
908
        ldd     [%sp+0x48],%f4
 
909
        stda    %f4,[%o2]0xd3   ! ASI_FL16_S
 
910
        .end
 
911
!
 
912
! vis_stdfa_ASI_FL8PL(double frd, void *rs1)
 
913
!
 
914
        .inline vis_stdfa_ASI_FL8PL,12
 
915
        std     %o0,[%sp+0x48]
 
916
        ldd     [%sp+0x48],%f4
 
917
        stda    %f4,[%o2]0xd8   ! ASI_FL8_PL
 
918
        .end
 
919
!
 
920
! vis_stdfa_ASI_FL8SL(double frd, void *rs1)
 
921
!
 
922
        .inline vis_stdfa_ASI_FL8SL,12
 
923
        std     %o0,[%sp+0x48]
 
924
        ldd     [%sp+0x48],%f4
 
925
        stda    %f4,[%o2]0xd9   ! ASI_FL8_SL
 
926
        .end
 
927
!
 
928
! vis_stdfa_ASI_FL16PL(double frd, void *rs1)
 
929
!
 
930
        .inline vis_stdfa_ASI_FL16PL,12
 
931
        std     %o0,[%sp+0x48]
 
932
        ldd     [%sp+0x48],%f4
 
933
        stda    %f4,[%o2]0xda   ! ASI_FL16_PL
 
934
        .end
 
935
!
 
936
! vis_stdfa_ASI_FL16SL(double frd, void *rs1)
 
937
!
 
938
        .inline vis_stdfa_ASI_FL16SL,12
 
939
        std     %o0,[%sp+0x48]
 
940
        ldd     [%sp+0x48],%f4
 
941
        stda    %f4,[%o2]0xdb   ! ASI_FL16_SL
 
942
        .end
 
943
 
 
944
!--------------------------------------------------------------------
 
945
! Short load instructions
 
946
!
 
947
! double vis_lddfa_ASI_FL8P(void *rs1)
 
948
!
 
949
        .inline vis_lddfa_ASI_FL8P,4
 
950
        ldda    [%o0]0xd0,%f4   ! ASI_FL8_P
 
951
        fmovd   %f4,%f0         ! Compiler can clean this up
 
952
        .end
 
953
!
 
954
! double vis_lddfa_ASI_FL8P_index(void *rs1, long index)
 
955
!
 
956
        .inline vis_lddfa_ASI_FL8P_index,8
 
957
        ldda    [%o0+%o1]0xd0,%f4
 
958
        fmovd   %f4,%f0
 
959
        .end
 
960
!
 
961
! double vis_lddfa_ASI_FL8P_hi(void *rs1, unsigned int index)
 
962
!
 
963
        .inline vis_lddfa_ASI_FL8P_hi,8
 
964
        sra     %o1,16,%o1
 
965
        ldda    [%o0+%o1]0xd0,%f4
 
966
        fmovd   %f4,%f0
 
967
        .end
 
968
!
 
969
! double vis_lddfa_ASI_FL8P_lo(void *rs1, unsigned int index)
 
970
!
 
971
        .inline vis_lddfa_ASI_FL8P_lo,8
 
972
        sll     %o1,16,%o1
 
973
        sra     %o1,16,%o1
 
974
        ldda    [%o0+%o1]0xd0,%f4
 
975
        fmovd   %f4,%f0
 
976
        .end
 
977
!
 
978
! double vis_lddfa_ASI_FL8S(void *rs1)
 
979
!
 
980
        .inline vis_lddfa_ASI_FL8S,4
 
981
        ldda    [%o0]0xd1,%f4   ! ASI_FL8_S
 
982
        fmovd   %f4,%f0
 
983
        .end
 
984
!
 
985
! double vis_lddfa_ASI_FL16P(void *rs1)
 
986
!
 
987
        .inline vis_lddfa_ASI_FL16P,4
 
988
        ldda    [%o0]0xd2,%f4   ! ASI_FL16_P
 
989
        fmovd   %f4,%f0
 
990
        .end
 
991
!
 
992
! double vis_lddfa_ASI_FL16P_index(void *rs1, long index)
 
993
!
 
994
        .inline vis_lddfa_ASI_FL16P_index,8
 
995
        ldda    [%o0+%o1]0xd2,%f4 ! ASI_FL16_P
 
996
        fmovd   %f4,%f0
 
997
        .end
 
998
!
 
999
! double vis_lddfa_ASI_FL16S(void *rs1)
 
1000
!
 
1001
        .inline vis_lddfa_ASI_FL16S,4
 
1002
        ldda    [%o0]0xd3,%f4   ! ASI_FL16_S
 
1003
        fmovd   %f4,%f0
 
1004
        .end
 
1005
!
 
1006
! double vis_lddfa_ASI_FL8PL(void *rs1)
 
1007
!
 
1008
        .inline vis_lddfa_ASI_FL8PL,4
 
1009
        ldda    [%o0]0xd8,%f4   ! ASI_FL8_PL
 
1010
        fmovd   %f4,%f0
 
1011
        .end
 
1012
!
 
1013
! double vis_lddfa_ASI_FL8PL_index(void *rs1, long index)
 
1014
!
 
1015
        .inline vis_lddfa_ASI_FL8PL_index,8
 
1016
        ldda    [%o0+%o1]0xd8,%f4       ! ASI_FL8_PL
 
1017
        fmovd   %f4,%f0
 
1018
        .end
 
1019
!
 
1020
! double vis_lddfa_ASI_FL8SL(void *rs1)
 
1021
!
 
1022
        .inline vis_lddfa_ASI_FL8SL,4
 
1023
        ldda    [%o0]0xd9,%f4   ! ASI_FL8_SL
 
1024
        fmovd   %f4,%f0
 
1025
        .end
 
1026
!
 
1027
! double vis_lddfa_ASI_FL16PL(void *rs1)
 
1028
!
 
1029
        .inline vis_lddfa_ASI_FL16PL,4
 
1030
        ldda    [%o0]0xda,%f4   ! ASI_FL16_PL
 
1031
        fmovd   %f4,%f0
 
1032
        .end
 
1033
!
 
1034
! double vis_lddfa_ASI_FL16PL_index(void *rs1, long index)
 
1035
!
 
1036
        .inline vis_lddfa_ASI_FL16PL_index,8
 
1037
        ldda    [%o0+%o1]0xda,%f4       ! ASI_FL16_PL
 
1038
        fmovd   %f4,%f0
 
1039
        .end
 
1040
!
 
1041
! double vis_lddfa_ASI_FL16SL(void *rs1)
 
1042
!
 
1043
        .inline vis_lddfa_ASI_FL16SL,4
 
1044
        ldda    [%o0]0xdb,%f4   ! ASI_FL16_SL
 
1045
        fmovd   %f4,%f0
 
1046
        .end
 
1047
 
 
1048
!--------------------------------------------------------------------
 
1049
! Graphics status register
 
1050
!
 
1051
! unsigned int vis_read_gsr(void)
 
1052
!
 
1053
        .inline vis_read_gsr,0
 
1054
        rd      %gsr,%o0
 
1055
        .end
 
1056
!
 
1057
! void vis_write_gsr(unsigned int /* GSR */)
 
1058
!
 
1059
        .inline vis_write_gsr,4
 
1060
        wr      %g0,%o0,%gsr
 
1061
        .end
 
1062
 
 
1063
!--------------------------------------------------------------------
 
1064
! Voxel texture mapping
 
1065
!
 
1066
! unsigned long vis_array8(unsigned long long /*rs1 */, int /*rs2*/)
 
1067
!
 
1068
        .inline vis_array8,12
 
1069
        sllx    %o0,32,%o0
 
1070
        srl     %o1,0,%o1       ! clear the most significant 32 bits of %o1
 
1071
        or      %o0,%o1,%o3     ! join %o0 and %o1 into %o3
 
1072
        array8  %o3,%o2,%o0
 
1073
        .end
 
1074
!
 
1075
! unsigned long vis_array16(unsigned long long /*rs1*/, int /*rs2*/)
 
1076
!
 
1077
        .inline vis_array16,12
 
1078
        sllx    %o0,32,%o0
 
1079
        srl     %o1,0,%o1       ! clear the most significant 32 bits of %o1
 
1080
        or      %o0,%o1,%o3     ! join %o0 and %o1 into %o3
 
1081
        array16 %o3,%o2,%o0
 
1082
        .end
 
1083
!
 
1084
! unsigned long vis_array32(unsigned long long /*rs1*/, int /*rs2*/)
 
1085
!
 
1086
        .inline vis_array32,12
 
1087
        sllx    %o0,32,%o0
 
1088
        srl     %o1,0,%o1       ! clear the most significant 32 bits of %o1
 
1089
        or      %o0,%o1,%o3     ! join %o0 and %o1 into %o3
 
1090
        array32 %o3,%o2,%o0
 
1091
        .end
 
1092
 
 
1093
!--------------------------------------------------------------------
 
1094
! Register aliasing and type casts
 
1095
!
 
1096
! float vis_read_hi(double /* frs1 */);
 
1097
!
 
1098
        .inline vis_read_hi,8
 
1099
        std     %o0,[%sp+0x48]  ! store double frs1
 
1100
        ldd     [%sp+0x48],%f0  ! %f0:%f1 = double frs1; return %f0;
 
1101
        .end
 
1102
!
 
1103
! float vis_read_lo(double /* frs1 */);
 
1104
!
 
1105
        .inline vis_read_lo,8
 
1106
        std     %o0,[%sp+0x48]  ! store double frs1
 
1107
        ldd     [%sp+0x48],%f0  ! %f0:%f1 = double frs1;
 
1108
        fmovs   %f1,%f0         ! %f0 = low word (frs1); return %f0;
 
1109
        .end
 
1110
!
 
1111
! double vis_write_hi(double /* frs1 */, float /* frs2 */);
 
1112
!
 
1113
        .inline vis_write_hi,12
 
1114
        std     %o0,[%sp+0x48]  ! store double frs1;
 
1115
        ldd     [%sp+0x48],%f0  ! %f0:%f1 = double frs1;
 
1116
        st      %o2,[%sp+0x44]  ! store float frs2;
 
1117
        ld      [%sp+0x44],%f2  ! %f2 = float frs2;
 
1118
        fmovs   %f2,%f0         ! %f0 = float frs2; return %f0:f1;
 
1119
        .end
 
1120
!
 
1121
! double vis_write_lo(double /* frs1 */, float /* frs2 */);
 
1122
!
 
1123
        .inline vis_write_lo,12
 
1124
        std     %o0,[%sp+0x48]  ! store double frs1;
 
1125
        ldd     [%sp+0x48],%f0  ! %f0:%f1 = double frs1;
 
1126
        st      %o2,[%sp+0x44]  ! store float frs2;
 
1127
        ld      [%sp+0x44],%f2  ! %f2 = float frs2;
 
1128
        fmovs   %f2,%f1         ! %f1 = float frs2; return %f0:f1;
 
1129
        .end
 
1130
!
 
1131
! double vis_freg_pair(float /* frs1 */, float /* frs2 */);
 
1132
!
 
1133
        .inline vis_freg_pair,8
 
1134
        st      %o0,[%sp+0x48]  ! store float frs1
 
1135
        ld      [%sp+0x48],%f0
 
1136
        st      %o1,[%sp+0x48]  ! store float frs2
 
1137
        ld      [%sp+0x48],%f1
 
1138
        .end
 
1139
!
 
1140
! float vis_to_float(unsigned int /*value*/);
 
1141
!
 
1142
        .inline vis_to_float,4
 
1143
        st      %o0,[%sp+0x48]
 
1144
        ld      [%sp+0x48],%f0
 
1145
        .end
 
1146
!
 
1147
! double vis_to_double(unsigned int /*value1*/, unsigned int /*value2*/);
 
1148
!
 
1149
        .inline vis_to_double,8
 
1150
        std     %o0,[%sp+0x48]
 
1151
        ldd     [%sp+0x48],%f0
 
1152
        .end
 
1153
!
 
1154
! double vis_to_double_dup(unsigned int /*value*/);
 
1155
!
 
1156
        .inline vis_to_double_dup,4
 
1157
        st      %o0,[%sp+0x48]
 
1158
        ld      [%sp+0x48],%f1
 
1159
        fmovs   %f1,%f0         ! duplicate value
 
1160
        .end
 
1161
!
 
1162
! double vis_ll_to_double(unsigned long long /*value*/);
 
1163
!
 
1164
        .inline vis_ll_to_double,8
 
1165
        std     %o0,[%sp+0x48]
 
1166
        ldd     [%sp+0x48],%f0
 
1167
        .end
 
1168
 
 
1169
!--------------------------------------------------------------------
 
1170
! Address space identifier (ASI) register
 
1171
!
 
1172
! unsigned int vis_read_asi(void)
 
1173
!
 
1174
        .inline vis_read_asi,0
 
1175
        rd      %asi,%o0
 
1176
        .end
 
1177
!
 
1178
! void vis_write_asi(unsigned int /* ASI */)
 
1179
!
 
1180
        .inline vis_write_asi,4
 
1181
        wr      %g0,%o0,%asi
 
1182
        .end
 
1183
 
 
1184
!--------------------------------------------------------------------
 
1185
! Load/store from/into alternate space
 
1186
!
 
1187
! float vis_ldfa_ASI_REG(void *rs1)
 
1188
!
 
1189
        .inline vis_ldfa_ASI_REG,4
 
1190
        lda     [%o0+0]%asi,%f4
 
1191
        fmovs   %f4,%f0         ! Compiler can clean this up
 
1192
        .end
 
1193
!
 
1194
! float vis_ldfa_ASI_P(void *rs1)
 
1195
!
 
1196
        .inline vis_ldfa_ASI_P,4
 
1197
        lda     [%o0]0x80,%f4   ! ASI_P
 
1198
        fmovs   %f4,%f0         ! Compiler can clean this up
 
1199
        .end
 
1200
!
 
1201
! float vis_ldfa_ASI_PL(void *rs1)
 
1202
!
 
1203
        .inline vis_ldfa_ASI_PL,4
 
1204
        lda     [%o0]0x88,%f4   ! ASI_PL
 
1205
        fmovs   %f4,%f0         ! Compiler can clean this up
 
1206
        .end
 
1207
!
 
1208
! double vis_lddfa_ASI_REG(void *rs1)
 
1209
!
 
1210
        .inline vis_lddfa_ASI_REG,4
 
1211
        ldda    [%o0+0]%asi,%f4
 
1212
        fmovd   %f4,%f0         ! Compiler can clean this up
 
1213
        .end
 
1214
!
 
1215
! double vis_lddfa_ASI_P(void *rs1)
 
1216
!
 
1217
        .inline vis_lddfa_ASI_P,4
 
1218
        ldda    [%o0]0x80,%f4   ! ASI_P
 
1219
        fmovd   %f4,%f0         ! Compiler can clean this up
 
1220
        .end
 
1221
!
 
1222
! double vis_lddfa_ASI_PL(void *rs1)
 
1223
!
 
1224
        .inline vis_lddfa_ASI_PL,4
 
1225
        ldda    [%o0]0x88,%f4   ! ASI_PL
 
1226
        fmovd   %f4,%f0         ! Compiler can clean this up
 
1227
        .end
 
1228
!
 
1229
! vis_stfa_ASI_REG(float frs, void *rs1)
 
1230
!
 
1231
        .inline vis_stfa_ASI_REG,8
 
1232
        st      %o0,[%sp+0x48]
 
1233
        ld      [%sp+0x48],%f4
 
1234
        sta     %f4,[%o1+0]%asi
 
1235
        .end
 
1236
!
 
1237
! vis_stfa_ASI_P(float frs, void *rs1)
 
1238
!
 
1239
        .inline vis_stfa_ASI_P,8
 
1240
        st      %o0,[%sp+0x48]
 
1241
        ld      [%sp+0x48],%f4
 
1242
        sta     %f4,[%o1]0x80   ! ASI_P
 
1243
        .end
 
1244
!
 
1245
! vis_stfa_ASI_PL(float frs, void *rs1)
 
1246
!
 
1247
        .inline vis_stfa_ASI_PL,8
 
1248
        st      %o0,[%sp+0x48]
 
1249
        ld      [%sp+0x48],%f4
 
1250
        sta     %f4,[%o1]0x88   ! ASI_PL
 
1251
        .end
 
1252
!
 
1253
! vis_stdfa_ASI_REG(double frd, void *rs1)
 
1254
!
 
1255
        .inline vis_stdfa_ASI_REG,12
 
1256
        std     %o0,[%sp+0x48]
 
1257
        ldd     [%sp+0x48],%f4
 
1258
        stda    %f4,[%o2+0]%asi
 
1259
        .end
 
1260
!
 
1261
! vis_stdfa_ASI_P(double frd, void *rs1)
 
1262
!
 
1263
        .inline vis_stdfa_ASI_P,12
 
1264
        std     %o0,[%sp+0x48]
 
1265
        ldd     [%sp+0x48],%f4
 
1266
        stda    %f4,[%o2]0x80   ! ASI_P
 
1267
        .end
 
1268
!
 
1269
! vis_stdfa_ASI_PL(double frd, void *rs1)
 
1270
!
 
1271
        .inline vis_stdfa_ASI_PL,12
 
1272
        std     %o0,[%sp+0x48]
 
1273
        ldd     [%sp+0x48],%f4
 
1274
        stda    %f4,[%o2]0x88   ! ASI_PL
 
1275
        .end
 
1276
!
 
1277
! unsigned short vis_lduha_ASI_REG(void *rs1)
 
1278
!
 
1279
        .inline vis_lduha_ASI_REG,4
 
1280
        lduha   [%o0+0]%asi,%o0
 
1281
        .end
 
1282
!
 
1283
! unsigned short vis_lduha_ASI_P(void *rs1)
 
1284
!
 
1285
        .inline vis_lduha_ASI_P,4
 
1286
        lduha   [%o0]0x80,%o0   ! ASI_P
 
1287
        .end
 
1288
!
 
1289
! unsigned short vis_lduha_ASI_PL(void *rs1)
 
1290
!
 
1291
        .inline vis_lduha_ASI_PL,4
 
1292
        lduha   [%o0]0x88,%o0   ! ASI_PL
 
1293
        .end
 
1294
!
 
1295
! unsigned short vis_lduha_ASI_P_index(void *rs1, long index)
 
1296
!
 
1297
        .inline vis_lduha_ASI_P_index,8
 
1298
        lduha   [%o0+%o1]0x80,%o0       ! ASI_P
 
1299
        .end
 
1300
!
 
1301
! unsigned short vis_lduha_ASI_PL_index(void *rs1, long index)
 
1302
!
 
1303
        .inline vis_lduha_ASI_PL_index,8
 
1304
        lduha   [%o0+%o1]0x88,%o0       ! ASI_PL
 
1305
        .end
 
1306
 
 
1307
!--------------------------------------------------------------------
 
1308
! Prefetch
 
1309
!
 
1310
! void vis_prefetch_read(void * /*address*/);
 
1311
!
 
1312
        .inline vis_prefetch_read,4
 
1313
        prefetch        [%o0+0],0
 
1314
        .end
 
1315
!
 
1316
! void vis_prefetch_write(void * /*address*/);
 
1317
!
 
1318
        .inline vis_prefetch_write,4
 
1319
        prefetch        [%o0+0],2
 
1320
        .end