2 ! ***** BEGIN LICENSE BLOCK *****
3 ! Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 ! The contents of this file are subject to the Mozilla Public License Version
6 ! 1.1 (the "License"); you may not use this file except in compliance with
7 ! the License. You may obtain a copy of the License at
8 ! http://www.mozilla.org/MPL/
10 ! Software distributed under the License is distributed on an "AS IS" basis,
11 ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 ! for the specific language governing rights and limitations under the
15 ! The Original Code is vis inline macros (64 bit). (vis_64.il 3.4).
17 ! The Initial Developer of the Original Code is
18 ! Sun Microsystems Inc.
19 ! Portions created by the Initial Developer are Copyright (C) 1998-2000
20 ! the Initial Developer. All Rights Reserved.
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.
36 ! ***** END LICENSE BLOCK *****
37 ! $Id: vis_64.il,v 1.3 2004/04/27 23:04:36 gerv%gerv.net Exp $
39 ! This file is to be used in place of vis.il in 64-bit builds.
41 !--------------------------------------------------------------------
42 ! Pure edge handling instructions
44 ! int vis_edge8(void */*frs1*/, void */*frs2*/);
50 ! int vis_edge8l(void */*frs1*/, void */*frs2*/);
56 ! int vis_edge16(void */*frs1*/, void */*frs2*/);
62 ! int vis_edge16l(void */*frs1*/, void */*frs2*/);
64 .inline vis_edge16l,16
68 ! int vis_edge32(void */*frs1*/, void */*frs2*/);
74 ! int vis_edge32l(void */*frs1*/, void */*frs2*/);
76 .inline vis_edge32l,16
80 !--------------------------------------------------------------------
81 ! Edge handling instructions with negative return values if cc set
83 ! int vis_edge8cc(void */*frs1*/, void */*frs2*/);
85 .inline vis_edge8cc,16
92 ! int vis_edge8lcc(void */*frs1*/, void */*frs2*/);
94 .inline vis_edge8lcc,16
101 ! int vis_edge16cc(void */*frs1*/, void */*frs2*/);
103 .inline vis_edge16cc,16
110 ! int vis_edge16lcc(void */*frs1*/, void */*frs2*/);
112 .inline vis_edge16lcc,16
119 ! int vis_edge32cc(void */*frs1*/, void */*frs2*/);
121 .inline vis_edge32cc,16
128 ! int vis_edge32lcc(void */*frs1*/, void */*frs2*/);
130 .inline vis_edge32lcc,16
137 !--------------------------------------------------------------------
138 ! Alignment instructions
140 ! void *vis_alignaddr(void */*rs1*/, int /*rs2*/);
142 .inline vis_alignaddr,12
143 alignaddr %o0,%o1,%o0
146 ! void *vis_alignaddrl(void */*rs1*/, int /*rs2*/);
148 .inline vis_alignaddrl,12
149 alignaddrl %o0,%o1,%o0
152 ! double vis_faligndata(double /*frs1*/, double /*frs2*/);
154 .inline vis_faligndata,16
155 faligndata %f0,%f2,%f0
158 !--------------------------------------------------------------------
159 ! Partitioned comparison instructions
161 ! int vis_fcmple16(double /*frs1*/, double /*frs2*/);
163 .inline vis_fcmple16,16
167 ! int vis_fcmpne16(double /*frs1*/, double /*frs2*/);
169 .inline vis_fcmpne16,16
173 ! int vis_fcmple32(double /*frs1*/, double /*frs2*/);
175 .inline vis_fcmple32,16
179 ! int vis_fcmpne32(double /*frs1*/, double /*frs2*/);
181 .inline vis_fcmpne32,16
185 ! int vis_fcmpgt16(double /*frs1*/, double /*frs2*/);
187 .inline vis_fcmpgt16,16
191 ! int vis_fcmpeq16(double /*frs1*/, double /*frs2*/);
193 .inline vis_fcmpeq16,16
197 ! int vis_fcmpgt32(double /*frs1*/, double /*frs2*/);
199 .inline vis_fcmpgt32,16
203 ! int vis_fcmpeq32(double /*frs1*/, double /*frs2*/);
205 .inline vis_fcmpeq32,16
209 !--------------------------------------------------------------------
210 ! Partitioned arithmetic
212 ! double vis_fmul8x16(float /*frs1*/, double /*frs2*/);
214 .inline vis_fmul8x16,12
218 ! double vis_fmul8x16_dummy(float /*frs1*/, int /*dummy*/, double /*frs2*/);
220 .inline vis_fmul8x16_dummy,16
224 ! double vis_fmul8x16au(float /*frs1*/, float /*frs2*/);
226 .inline vis_fmul8x16au,8
227 fmul8x16au %f1,%f3,%f0
230 ! double vis_fmul8x16al(float /*frs1*/, float /*frs2*/);
232 .inline vis_fmul8x16al,8
233 fmul8x16al %f1,%f3,%f0
236 ! double vis_fmul8sux16(double /*frs1*/, double /*frs2*/);
238 .inline vis_fmul8sux16,16
239 fmul8sux16 %f0,%f2,%f0
242 ! double vis_fmul8ulx16(double /*frs1*/, double /*frs2*/);
244 .inline vis_fmul8ulx16,16
245 fmul8ulx16 %f0,%f2,%f0
248 ! double vis_fmuld8sux16(float /*frs1*/, float /*frs2*/);
250 .inline vis_fmuld8sux16,8
251 fmuld8sux16 %f1,%f3,%f0
254 ! double vis_fmuld8ulx16(float /*frs1*/, float /*frs2*/);
256 .inline vis_fmuld8ulx16,8
257 fmuld8ulx16 %f1,%f3,%f0
260 ! double vis_fpadd16(double /*frs1*/, double /*frs2*/);
262 .inline vis_fpadd16,16
266 ! float vis_fpadd16s(float /*frs1*/, float /*frs2*/);
268 .inline vis_fpadd16s,8
272 ! double vis_fpadd32(double /*frs1*/, double /*frs2*/);
274 .inline vis_fpadd32,16
278 ! float vis_fpadd32s(float /*frs1*/, float /*frs2*/);
280 .inline vis_fpadd32s,8
284 ! double vis_fpsub16(double /*frs1*/, double /*frs2*/);
286 .inline vis_fpsub16,16
290 ! float vis_fpsub16s(float /*frs1*/, float /*frs2*/);
292 .inline vis_fpsub16s,8
296 ! double vis_fpsub32(double /*frs1*/, double /*frs2*/);
298 .inline vis_fpsub32,16
302 ! float vis_fpsub32s(float /*frs1*/, float /*frs2*/);
304 .inline vis_fpsub32s,8
308 !--------------------------------------------------------------------
311 ! float vis_fpack16(double /*frs2*/);
313 .inline vis_fpack16,8
317 ! double vis_fpack16_pair(double /*frs2*/, double /*frs2*/);
319 .inline vis_fpack16_pair,16
324 ! void vis_st2_fpack16(double, double, double *)
326 .inline vis_st2_fpack16,24
333 ! void vis_std_fpack16(double, double, double *)
335 .inline vis_std_fpack16,24
341 ! void vis_st2_fpackfix(double, double, double *)
343 .inline vis_st2_fpackfix,24
350 ! double vis_fpack16_to_hi(double /*frs1*/, double /*frs2*/);
352 .inline vis_fpack16_to_hi,16
356 ! double vis_fpack16_to_lo(double /*frs1*/, double /*frs2*/);
358 .inline vis_fpack16_to_lo,16
360 fmovs %f3,%f1 /* without this, optimizer goes wrong */
364 ! double vis_fpack32(double /*frs1*/, double /*frs2*/);
366 .inline vis_fpack32,16
370 ! float vis_fpackfix(double /*frs2*/);
372 .inline vis_fpackfix,8
376 ! double vis_fpackfix_pair(double /*frs2*/, double /*frs2*/);
378 .inline vis_fpackfix_pair,16
383 !--------------------------------------------------------------------
386 ! double vis_pxldist64(double accum /*frd*/, double pxls1 /*frs1*/,
387 ! double pxls2 /*frs2*/);
389 .inline vis_pxldist64,24
393 !--------------------------------------------------------------------
396 ! double vis_fpmerge(float /*frs1*/, float /*frs2*/);
398 .inline vis_fpmerge,8
402 !--------------------------------------------------------------------
405 ! double vis_fexpand(float /*frs2*/);
407 .inline vis_fexpand,4
411 ! double vis_fexpand_hi(double /*frs2*/);
413 .inline vis_fexpand_hi,8
417 ! double vis_fexpand_lo(double /*frs2*/);
419 .inline vis_fexpand_lo,8
423 !--------------------------------------------------------------------
424 ! Bitwise logical operations
426 ! double vis_fnor(double /*frs1*/, double /*frs2*/);
432 ! float vis_fnors(float /*frs1*/, float /*frs2*/);
438 ! double vis_fandnot(double /*frs1*/, double /*frs2*/);
440 .inline vis_fandnot,16
444 ! float vis_fandnots(float /*frs1*/, float /*frs2*/);
446 .inline vis_fandnots,8
447 fandnot1s %f1,%f3,%f0
450 ! double vis_fnot(double /*frs1*/);
456 ! float vis_fnots(float /*frs1*/);
462 ! double vis_fxor(double /*frs1*/, double /*frs2*/);
468 ! float vis_fxors(float /*frs1*/, float /*frs2*/);
474 ! double vis_fnand(double /*frs1*/, double /*frs2*/);
480 ! float vis_fnands(float /*frs1*/, float /*frs2*/);
486 ! double vis_fand(double /*frs1*/, double /*frs2*/);
492 ! float vis_fands(float /*frs1*/, float /*frs2*/);
498 ! double vis_fxnor(double /*frs1*/, double /*frs2*/);
504 ! float vis_fxnors(float /*frs1*/, float /*frs2*/);
510 ! double vis_fsrc(double /*frs1*/);
516 ! float vis_fsrcs(float /*frs1*/);
522 ! double vis_fornot(double /*frs1*/, double /*frs2*/);
524 .inline vis_fornot,16
528 ! float vis_fornots(float /*frs1*/, float /*frs2*/);
530 .inline vis_fornots,8
534 ! double vis_for(double /*frs1*/, double /*frs2*/);
540 ! float vis_fors(float /*frs1*/, float /*frs2*/);
546 ! double vis_fzero(/* void */)
552 ! float vis_fzeros(/* void */)
558 ! double vis_fone(/* void */)
564 ! float vis_fones(/* void */)
570 !--------------------------------------------------------------------
571 ! Partial store instructions
573 ! vis_stdfa_ASI_PST8P(double frd, void *rs1, int rmask)
575 .inline vis_stdfa_ASI_PST8P,20
576 stda %f0,[%o1]%o2,0xc0 ! ASI_PST8_P
579 ! vis_stdfa_ASI_PST8PL(double frd, void *rs1, int rmask)
581 .inline vis_stdfa_ASI_PST8PL,20
582 stda %f0,[%o1]%o2,0xc8 ! ASI_PST8_PL
585 ! vis_stdfa_ASI_PST8P_int_pair(void *rs1, void *rs2, void *rs3, int rmask);
587 .inline vis_stdfa_ASI_PST8P_int_pair,28
590 stda %f4,[%o2]%o3,0xc0 ! ASI_PST8_P
593 ! vis_stdfa_ASI_PST8S(double frd, void *rs1, int rmask)
595 .inline vis_stdfa_ASI_PST8S,20
596 stda %f0,[%o1]%o2,0xc1 ! ASI_PST8_S
599 ! vis_stdfa_ASI_PST16P(double frd, void *rs1, int rmask)
601 .inline vis_stdfa_ASI_PST16P,20
602 stda %f0,[%o1]%o2,0xc2 ! ASI_PST16_P
605 ! vis_stdfa_ASI_PST16S(double frd, void *rs1, int rmask)
607 .inline vis_stdfa_ASI_PST16S,20
608 stda %f0,[%o1]%o2,0xc3 ! ASI_PST16_S
611 ! vis_stdfa_ASI_PST32P(double frd, void *rs1, int rmask)
613 .inline vis_stdfa_ASI_PST32P,20
614 stda %f0,[%o1]%o2,0xc4 ! ASI_PST32_P
617 ! vis_stdfa_ASI_PST32S(double frd, void *rs1, int rmask)
619 .inline vis_stdfa_ASI_PST32S,20
620 stda %f0,[%o1]%o2,0xc5 ! ASI_PST32_S
623 !--------------------------------------------------------------------
624 ! Short store instructions
626 ! vis_stdfa_ASI_FL8P(double frd, void *rs1)
628 .inline vis_stdfa_ASI_FL8P,16
629 stda %f0,[%o1]0xd0 ! ASI_FL8_P
632 ! vis_stdfa_ASI_FL8P_index(double frd, void *rs1, long index)
634 .inline vis_stdfa_ASI_FL8P_index,24
635 stda %f0,[%o1+%o2]0xd0 ! ASI_FL8_P
638 ! vis_stdfa_ASI_FL8S(double frd, void *rs1)
640 .inline vis_stdfa_ASI_FL8S,16
641 stda %f0,[%o1]0xd1 ! ASI_FL8_S
644 ! vis_stdfa_ASI_FL16P(double frd, void *rs1)
646 .inline vis_stdfa_ASI_FL16P,16
647 stda %f0,[%o1]0xd2 ! ASI_FL16_P
650 ! vis_stdfa_ASI_FL16P_index(double frd, void *rs1, long index)
652 .inline vis_stdfa_ASI_FL16P_index,24
653 stda %f0,[%o1+%o2]0xd2 ! ASI_FL16_P
656 ! vis_stdfa_ASI_FL16S(double frd, void *rs1)
658 .inline vis_stdfa_ASI_FL16S,16
659 stda %f0,[%o1]0xd3 ! ASI_FL16_S
662 ! vis_stdfa_ASI_FL8PL(double frd, void *rs1)
664 .inline vis_stdfa_ASI_FL8PL,16
665 stda %f0,[%o1]0xd8 ! ASI_FL8_PL
668 ! vis_stdfa_ASI_FL8SL(double frd, void *rs1)
670 .inline vis_stdfa_ASI_FL8SL,16
671 stda %f0,[%o1]0xd9 ! ASI_FL8_SL
674 ! vis_stdfa_ASI_FL16PL(double frd, void *rs1)
676 .inline vis_stdfa_ASI_FL16PL,16
677 stda %f0,[%o1]0xda ! ASI_FL16_PL
680 ! vis_stdfa_ASI_FL16SL(double frd, void *rs1)
682 .inline vis_stdfa_ASI_FL16SL,16
683 stda %f0,[%o1]0xdb ! ASI_FL16_SL
686 !--------------------------------------------------------------------
687 ! Short load instructions
689 ! double vis_lddfa_ASI_FL8P(void *rs1)
691 .inline vis_lddfa_ASI_FL8P,8
692 ldda [%o0]0xd0,%f4 ! ASI_FL8_P
693 fmovd %f4,%f0 ! Compiler can clean this up
696 ! double vis_lddfa_ASI_FL8P_index(void *rs1, long index)
698 .inline vis_lddfa_ASI_FL8P_index,16
699 ldda [%o0+%o1]0xd0,%f4
703 ! double vis_lddfa_ASI_FL8P_hi(void *rs1, unsigned int index)
705 .inline vis_lddfa_ASI_FL8P_hi,12
707 ldda [%o0+%o1]0xd0,%f4
711 ! double vis_lddfa_ASI_FL8P_lo(void *rs1, unsigned int index)
713 .inline vis_lddfa_ASI_FL8P_lo,12
716 ldda [%o0+%o1]0xd0,%f4
720 ! double vis_lddfa_ASI_FL8S(void *rs1)
722 .inline vis_lddfa_ASI_FL8S,8
723 ldda [%o0]0xd1,%f4 ! ASI_FL8_S
727 ! double vis_lddfa_ASI_FL16P(void *rs1)
729 .inline vis_lddfa_ASI_FL16P,8
730 ldda [%o0]0xd2,%f4 ! ASI_FL16_P
734 ! double vis_lddfa_ASI_FL16P_index(void *rs1, long index)
736 .inline vis_lddfa_ASI_FL16P_index,16
737 ldda [%o0+%o1]0xd2,%f4 ! ASI_FL16_P
741 ! double vis_lddfa_ASI_FL16S(void *rs1)
743 .inline vis_lddfa_ASI_FL16S,8
744 ldda [%o0]0xd3,%f4 ! ASI_FL16_S
748 ! double vis_lddfa_ASI_FL8PL(void *rs1)
750 .inline vis_lddfa_ASI_FL8PL,8
751 ldda [%o0]0xd8,%f4 ! ASI_FL8_PL
755 ! double vis_lddfa_ASI_FL8PL_index(void *rs1, long index)
757 .inline vis_lddfa_ASI_FL8PL_index,16
758 ldda [%o0+%o1]0xd8,%f4 ! ASI_FL8_PL
762 ! double vis_lddfa_ASI_FL8SL(void *rs1)
764 .inline vis_lddfa_ASI_FL8SL,8
765 ldda [%o0]0xd9,%f4 ! ASI_FL8_SL
769 ! double vis_lddfa_ASI_FL16PL(void *rs1)
771 .inline vis_lddfa_ASI_FL16PL,8
772 ldda [%o0]0xda,%f4 ! ASI_FL16_PL
776 ! double vis_lddfa_ASI_FL16PL_index(void *rs1, long index)
778 .inline vis_lddfa_ASI_FL16PL_index,16
779 ldda [%o0+%o1]0xda,%f4 ! ASI_FL16_PL
783 ! double vis_lddfa_ASI_FL16SL(void *rs1)
785 .inline vis_lddfa_ASI_FL16SL,8
786 ldda [%o0]0xdb,%f4 ! ASI_FL16_SL
790 !--------------------------------------------------------------------
791 ! Graphics status register
793 ! unsigned int vis_read_gsr(void)
795 .inline vis_read_gsr,0
799 ! void vis_write_gsr(unsigned int /* GSR */)
801 .inline vis_write_gsr,4
805 !--------------------------------------------------------------------
806 ! Voxel texture mapping
808 ! unsigned long vis_array8(unsigned long long /*rs1 */, int /*rs2*/)
810 .inline vis_array8,12
814 ! unsigned long vis_array16(unsigned long long /*rs1*/, int /*rs2*/)
816 .inline vis_array16,12
820 ! unsigned long vis_array32(unsigned long long /*rs1*/, int /*rs2*/)
822 .inline vis_array32,12
826 !--------------------------------------------------------------------
827 ! Register aliasing and type casts
829 ! float vis_read_hi(double /* frs1 */);
831 .inline vis_read_hi,8
835 ! float vis_read_lo(double /* frs1 */);
837 .inline vis_read_lo,8
838 fmovs %f1,%f0 ! %f0 = low word (frs1); return %f0;
841 ! double vis_write_hi(double /* frs1 */, float /* frs2 */);
843 .inline vis_write_hi,12
844 fmovs %f3,%f0 ! %f3 = float frs2; return %f0:f1;
847 ! double vis_write_lo(double /* frs1 */, float /* frs2 */);
849 .inline vis_write_lo,12
850 fmovs %f3,%f1 ! %f3 = float frs2; return %f0:f1;
853 ! double vis_freg_pair(float /* frs1 */, float /* frs2 */);
855 .inline vis_freg_pair,8
856 fmovs %f1,%f0 ! %f1 = float frs1; put in hi;
857 fmovs %f3,%f1 ! %f3 = float frs2; put in lo; return %f0:f1;
860 ! float vis_to_float(unsigned int /*value*/);
862 .inline vis_to_float,4
867 ! double vis_to_double(unsigned int /*value1*/, unsigned int /*value2*/);
869 .inline vis_to_double,8
876 ! double vis_to_double_dup(unsigned int /*value*/);
878 .inline vis_to_double_dup,4
881 fmovs %f1,%f0 ! duplicate value
884 ! double vis_ll_to_double(unsigned long long /*value*/);
886 .inline vis_ll_to_double,8
891 !--------------------------------------------------------------------
892 ! Address space identifier (ASI) register
894 ! unsigned int vis_read_asi(void)
896 .inline vis_read_asi,0
900 ! void vis_write_asi(unsigned int /* ASI */)
902 .inline vis_write_asi,4
906 !--------------------------------------------------------------------
907 ! Load/store from/into alternate space
909 ! float vis_ldfa_ASI_REG(void *rs1)
911 .inline vis_ldfa_ASI_REG,8
913 fmovs %f4,%f0 ! Compiler can clean this up
916 ! float vis_ldfa_ASI_P(void *rs1)
918 .inline vis_ldfa_ASI_P,8
919 lda [%o0]0x80,%f4 ! ASI_P
920 fmovs %f4,%f0 ! Compiler can clean this up
923 ! float vis_ldfa_ASI_PL(void *rs1)
925 .inline vis_ldfa_ASI_PL,8
926 lda [%o0]0x88,%f4 ! ASI_PL
927 fmovs %f4,%f0 ! Compiler can clean this up
930 ! double vis_lddfa_ASI_REG(void *rs1)
932 .inline vis_lddfa_ASI_REG,8
934 fmovd %f4,%f0 ! Compiler can clean this up
937 ! double vis_lddfa_ASI_P(void *rs1)
939 .inline vis_lddfa_ASI_P,8
940 ldda [%o0]0x80,%f4 ! ASI_P
941 fmovd %f4,%f0 ! Compiler can clean this up
944 ! double vis_lddfa_ASI_PL(void *rs1)
946 .inline vis_lddfa_ASI_PL,8
947 ldda [%o0]0x88,%f4 ! ASI_PL
948 fmovd %f4,%f0 ! Compiler can clean this up
951 ! vis_stfa_ASI_REG(float frs, void *rs1)
953 .inline vis_stfa_ASI_REG,12
957 ! vis_stfa_ASI_P(float frs, void *rs1)
959 .inline vis_stfa_ASI_P,12
960 sta %f1,[%o1]0x80 ! ASI_P
963 ! vis_stfa_ASI_PL(float frs, void *rs1)
965 .inline vis_stfa_ASI_PL,12
966 sta %f1,[%o1]0x88 ! ASI_PL
969 ! vis_stdfa_ASI_REG(double frd, void *rs1)
971 .inline vis_stdfa_ASI_REG,16
975 ! vis_stdfa_ASI_P(double frd, void *rs1)
977 .inline vis_stdfa_ASI_P,16
978 stda %f0,[%o1]0x80 ! ASI_P
981 ! vis_stdfa_ASI_PL(double frd, void *rs1)
983 .inline vis_stdfa_ASI_PL,16
984 stda %f0,[%o1]0x88 ! ASI_PL
987 ! unsigned short vis_lduha_ASI_REG(void *rs1)
989 .inline vis_lduha_ASI_REG,8
990 lduha [%o0+0]%asi,%o0
993 ! unsigned short vis_lduha_ASI_P(void *rs1)
995 .inline vis_lduha_ASI_P,8
996 lduha [%o0]0x80,%o0 ! ASI_P
999 ! unsigned short vis_lduha_ASI_PL(void *rs1)
1001 .inline vis_lduha_ASI_PL,8
1002 lduha [%o0]0x88,%o0 ! ASI_PL
1005 ! unsigned short vis_lduha_ASI_P_index(void *rs1, long index)
1007 .inline vis_lduha_ASI_P_index,16
1008 lduha [%o0+%o1]0x80,%o0 ! ASI_P
1011 ! unsigned short vis_lduha_ASI_PL_index(void *rs1, long index)
1013 .inline vis_lduha_ASI_PL_index,16
1014 lduha [%o0+%o1]0x88,%o0 ! ASI_PL
1017 !--------------------------------------------------------------------
1020 ! void vis_prefetch_read(void * /*address*/);
1022 .inline vis_prefetch_read,8
1026 ! void vis_prefetch_write(void * /*address*/);
1028 .inline vis_prefetch_write,8