Imported Upstream version 3.13.6
[platform/upstream/nss.git] / mozilla / security / nss / lib / freebl / mpi / vis_proto.h
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 prototypes for vis.il  (vis_proto.h 1.3).
15  *
16  * The Initial Developer of the Original Code is
17  * Sun Microsystems Inc.
18  * Portions created by the Initial Developer are Copyright (C) 1995
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s):
22  *
23  * Alternatively, the contents of this file may be used under the terms of
24  * either the GNU General Public License Version 2 or later (the "GPL"), or
25  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26  * in which case the provisions of the GPL or the LGPL are applicable instead
27  * of those above. If you wish to allow use of your version of this file only
28  * under the terms of either the GPL or the LGPL, and not to allow others to
29  * use your version of this file under the terms of the MPL, indicate your
30  * decision by deleting the provisions above and replace them with the notice
31  * and other provisions required by the GPL or the LGPL. If you do not delete
32  * the provisions above, a recipient may use your version of this file under
33  * the terms of any one of the MPL, the GPL or the LGPL.
34  *
35  * ***** END LICENSE BLOCK ***** */
36 /* $Id: vis_proto.h,v 1.3 2004/04/27 23:04:36 gerv%gerv.net Exp $ */
37
38 /*
39  * Prototypes for the inline templates in vis.il
40  */
41
42 #ifndef VIS_PROTO_H
43 #define VIS_PROTO_H
44
45 #pragma ident   "@(#)vis_proto.h        1.3     97/03/30 SMI"
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif /* __cplusplus */
50
51 /* Pure edge handling instructions */
52 int vis_edge8(void * /*frs1*/, void * /*frs2*/);
53 int vis_edge8l(void * /*frs1*/, void * /*frs2*/);
54 int vis_edge16(void * /*frs1*/, void * /*frs2*/);
55 int vis_edge16l(void * /*frs1*/, void * /*frs2*/);
56 int vis_edge32(void * /*frs1*/, void * /*frs2*/);
57 int vis_edge32l(void * /*frs1*/, void * /*frs2*/);
58
59 /* Edge handling instructions with negative return values if cc set. */
60 int vis_edge8cc(void * /*frs1*/, void * /*frs2*/);
61 int vis_edge8lcc(void * /*frs1*/, void * /*frs2*/);
62 int vis_edge16cc(void * /*frs1*/, void * /*frs2*/);
63 int vis_edge16lcc(void * /*frs1*/, void * /*frs2*/);
64 int vis_edge32cc(void * /*frs1*/, void * /*frs2*/);
65 int vis_edge32lcc(void * /*frs1*/, void * /*frs2*/);
66
67 /* Alignment instructions. */
68 void *vis_alignaddr(void * /*rs1*/, int /*rs2*/);
69 void *vis_alignaddrl(void * /*rs1*/, int /*rs2*/);
70 double vis_faligndata(double /*frs1*/, double /*frs2*/);
71
72 /* Partitioned comparison instructions. */
73 int vis_fcmple16(double /*frs1*/, double /*frs2*/);
74 int vis_fcmpne16(double /*frs1*/, double /*frs2*/);
75 int vis_fcmple32(double /*frs1*/, double /*frs2*/);
76 int vis_fcmpne32(double /*frs1*/, double /*frs2*/);
77 int vis_fcmpgt16(double /*frs1*/, double /*frs2*/);
78 int vis_fcmpeq16(double /*frs1*/, double /*frs2*/);
79 int vis_fcmpgt32(double /*frs1*/, double /*frs2*/);
80 int vis_fcmpeq32(double /*frs1*/, double /*frs2*/);
81
82 /* Partitioned multiplication. */
83 #if 0
84 double vis_fmul8x16(float /*frs1*/, double /*frs2*/);
85 #endif
86 double vis_fmul8x16_dummy(float /*frs1*/, int /*dummy*/, double /*frs2*/);
87 double vis_fmul8x16au(float /*frs1*/, float /*frs2*/);
88 double vis_fmul8x16al(float /*frs1*/, float /*frs2*/);
89 double vis_fmul8sux16(double /*frs1*/, double /*frs2*/);
90 double vis_fmul8ulx16(double /*frs1*/, double /*frs2*/);
91 double vis_fmuld8ulx16(float /*frs1*/, float /*frs2*/);
92 double vis_fmuld8sux16(float /*frs1*/, float /*frs2*/);
93
94 /* Partitioned addition & subtraction. */
95 double vis_fpadd16(double /*frs1*/, double /*frs2*/);
96 float vis_fpadd16s(float /*frs1*/, float /*frs2*/);
97 double vis_fpadd32(double /*frs1*/, double /*frs2*/);
98 float vis_fpadd32s(float /*frs1*/, float /*frs2*/);
99 double vis_fpsub16(double /*frs1*/, double /*frs2*/);
100 float vis_fpsub16s(float /*frs1*/, float /*frs2*/);
101 double vis_fpsub32(double /*frs1*/, double /*frs2*/);
102 float vis_fpsub32s(float /*frs1*/, float /*frs2*/);
103
104 /* Pixel packing & clamping. */
105 float vis_fpack16(double /*frs2*/);
106 double vis_fpack32(double /*frs1*/, double /*frs2*/);
107 float vis_fpackfix(double /*frs2*/);
108
109 /* Combined pack ops. */
110 double vis_fpack16_pair(double /*frs2*/, double /*frs2*/);
111 double vis_fpackfix_pair(double /*frs2*/, double /*frs2*/);
112 void vis_st2_fpack16(double, double, double *);
113 void vis_std_fpack16(double, double, double *);
114 void vis_st2_fpackfix(double, double, double *);
115
116 double vis_fpack16_to_hi(double /*frs1*/, double /*frs2*/);
117 double vis_fpack16_to_lo(double /*frs1*/, double /*frs2*/);
118
119 /* Motion estimation. */
120 double vis_pdist(double /*frs1*/, double /*frs2*/, double /*frd*/);
121
122 /* Channel merging. */
123 double vis_fpmerge(float /*frs1*/, float /*frs2*/);
124
125 /* Pixel expansion. */
126 double vis_fexpand(float /*frs2*/);
127 double vis_fexpand_hi(double /*frs2*/);
128 double vis_fexpand_lo(double /*frs2*/);
129
130 /* Bitwise logical operators. */
131 double vis_fnor(double /*frs1*/, double /*frs2*/);
132 float vis_fnors(float /*frs1*/, float /*frs2*/);
133 double vis_fandnot(double /*frs1*/, double /*frs2*/);
134 float vis_fandnots(float /*frs1*/, float /*frs2*/);
135 double vis_fnot(double /*frs1*/);
136 float vis_fnots(float /*frs1*/);
137 double vis_fxor(double /*frs1*/, double /*frs2*/);
138 float vis_fxors(float /*frs1*/, float /*frs2*/);
139 double vis_fnand(double /*frs1*/, double /*frs2*/);
140 float vis_fnands(float /*frs1*/, float /*frs2*/);
141 double vis_fand(double /*frs1*/, double /*frs2*/);
142 float vis_fands(float /*frs1*/, float /*frs2*/);
143 double vis_fxnor(double /*frs1*/, double /*frs2*/);
144 float vis_fxnors(float /*frs1*/, float /*frs2*/);
145 double vis_fsrc(double /*frs1*/);
146 float vis_fsrcs(float /*frs1*/);
147 double vis_fornot(double /*frs1*/, double /*frs2*/);
148 float vis_fornots(float /*frs1*/, float /*frs2*/);
149 double vis_for(double /*frs1*/, double /*frs2*/);
150 float vis_fors(float /*frs1*/, float /*frs2*/);
151 double vis_fzero(void);
152 float vis_fzeros(void);
153 double vis_fone(void);
154 float vis_fones(void);
155
156 /* Partial stores. */
157 void vis_stdfa_ASI_PST8P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
158 void vis_stdfa_ASI_PST8PL(double /*frd*/, void * /*rs1*/, int /*rmask*/);
159 void vis_stdfa_ASI_PST8P_int_pair(void * /*rs1*/, void * /*rs2*/,
160                                   void * /*rs3*/, int /*rmask*/);
161 void vis_stdfa_ASI_PST8S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
162 void vis_stdfa_ASI_PST16P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
163 void vis_stdfa_ASI_PST16S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
164 void vis_stdfa_ASI_PST32P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
165 void vis_stdfa_ASI_PST32S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
166
167 /* Byte & short stores. */
168 void vis_stdfa_ASI_FL8P(double /*frd*/, void * /*rs1*/);
169 void vis_stdfa_ASI_FL8P_index(double /*frd*/, void * /*rs1*/, long /*index*/);
170 void vis_stdfa_ASI_FL8S(double /*frd*/, void * /*rs1*/);
171 void vis_stdfa_ASI_FL16P(double /*frd*/, void * /*rs1*/);
172 void vis_stdfa_ASI_FL16P_index(double /*frd*/, void * /*rs1*/, long /*index*/);
173 void vis_stdfa_ASI_FL16S(double /*frd*/, void * /*rs1*/);
174 void vis_stdfa_ASI_FL8PL(double /*frd*/, void * /*rs1*/);
175 void vis_stdfa_ASI_FL8SL(double /*frd*/, void * /*rs1*/);
176 void vis_stdfa_ASI_FL16PL(double /*frd*/, void * /*rs1*/);
177 void vis_stdfa_ASI_FL16SL(double /*frd*/, void * /*rs1*/);
178
179 /* Byte & short loads. */
180 double vis_lddfa_ASI_FL8P(void * /*rs1*/);
181 double vis_lddfa_ASI_FL8P_index(void * /*rs1*/, long /*index*/);
182 double vis_lddfa_ASI_FL8P_hi(void * /*rs1*/, unsigned int /*index*/);
183 double vis_lddfa_ASI_FL8P_lo(void * /*rs1*/, unsigned int /*index*/);
184 double vis_lddfa_ASI_FL8S(void * /*rs1*/);
185 double vis_lddfa_ASI_FL16P(void * /*rs1*/);
186 double vis_lddfa_ASI_FL16P_index(void * /*rs1*/, long /*index*/);
187 double vis_lddfa_ASI_FL16S(void * /*rs1*/);
188 double vis_lddfa_ASI_FL8PL(void * /*rs1*/);
189 double vis_lddfa_ASI_FL8SL(void * /*rs1*/);
190 double vis_lddfa_ASI_FL16PL(void * /*rs1*/);
191 double vis_lddfa_ASI_FL16SL(void * /*rs1*/);
192
193 /* Direct write to GSR, read from GSR */
194 void vis_write_gsr(unsigned int /*GSR*/);
195 unsigned int vis_read_gsr(void);
196
197 /* Voxel texture mapping. */
198 #if !defined(_NO_LONGLONG)
199 unsigned long vis_array8(unsigned long long /*rs1*/, int /*rs2*/);
200 unsigned long vis_array16(unsigned long long /*rs1*/, int /*rs2*/);
201 unsigned long vis_array32(unsigned long long /*rs1*/, int /*rs2*/);
202 #endif /* !defined(_NO_LONGLONG) */
203
204 /* Register aliasing and type casts. */
205 float vis_read_hi(double /*frs1*/);
206 float vis_read_lo(double /*frs1*/);
207 double vis_write_hi(double /*frs1*/, float /*frs2*/);
208 double vis_write_lo(double /*frs1*/, float /*frs2*/);
209 double vis_freg_pair(float /*frs1*/, float /*frs2*/);
210 float vis_to_float(unsigned int /*value*/);
211 double vis_to_double(unsigned int /*value1*/, unsigned int /*value2*/);
212 double vis_to_double_dup(unsigned int /*value*/);
213 #if !defined(_NO_LONGLONG)
214 double vis_ll_to_double(unsigned long long /*value*/);
215 #endif /* !defined(_NO_LONGLONG) */
216
217 /* Miscellany (no inlines) */
218 void vis_error(char * /*fmt*/, int /*a0*/);
219 void vis_sim_init(void);
220
221 /* For better performance */
222 #define vis_fmul8x16(farg,darg) vis_fmul8x16_dummy((farg),0,(darg))
223
224 /* Nicknames for explicit ASI loads and stores. */
225 #define vis_st_u8      vis_stdfa_ASI_FL8P
226 #define vis_st_u8_i    vis_stdfa_ASI_FL8P_index
227 #define vis_st_u8_le   vis_stdfa_ASI_FL8PL
228 #define vis_st_u16     vis_stdfa_ASI_FL16P
229 #define vis_st_u16_i   vis_stdfa_ASI_FL16P_index
230 #define vis_st_u16_le  vis_stdfa_ASI_FL16PL
231
232 #define vis_ld_u8      vis_lddfa_ASI_FL8P
233 #define vis_ld_u8_i    vis_lddfa_ASI_FL8P_index
234 #define vis_ld_u8_le   vis_lddfa_ASI_FL8PL
235 #define vis_ld_u16     vis_lddfa_ASI_FL16P
236 #define vis_ld_u16_i   vis_lddfa_ASI_FL16P_index
237 #define vis_ld_u16_le  vis_lddfa_ASI_FL16PL
238
239 #define vis_pst_8      vis_stdfa_ASI_PST8P
240 #define vis_pst_16     vis_stdfa_ASI_PST16P
241 #define vis_pst_32     vis_stdfa_ASI_PST32P
242
243 #define vis_st_u8s     vis_stdfa_ASI_FL8S
244 #define vis_st_u8s_le  vis_stdfa_ASI_FL8SL
245 #define vis_st_u16s    vis_stdfa_ASI_FL16S
246 #define vis_st_u16s_le vis_stdfa_ASI_FL16SL
247
248 #define vis_ld_u8s     vis_lddfa_ASI_FL8S
249 #define vis_ld_u8s_le  vis_lddfa_ASI_FL8SL
250 #define vis_ld_u16s    vis_lddfa_ASI_FL16S
251 #define vis_ld_u16s_le vis_lddfa_ASI_FL16SL
252
253 #define vis_pst_8s     vis_stdfa_ASI_PST8S
254 #define vis_pst_16s    vis_stdfa_ASI_PST16S
255 #define vis_pst_32s    vis_stdfa_ASI_PST32S
256
257 /* "<" and ">=" may be implemented in terms of ">" and "<=". */
258 #define vis_fcmplt16(a,b) vis_fcmpgt16((b),(a))
259 #define vis_fcmplt32(a,b) vis_fcmpgt32((b),(a))
260 #define vis_fcmpge16(a,b) vis_fcmple16((b),(a))
261 #define vis_fcmpge32(a,b) vis_fcmple32((b),(a))
262
263 #ifdef __cplusplus
264 } // End of extern "C"
265 #endif /* __cplusplus */
266
267 #endif /* VIS_PROTO_H */