PageRenderTime 32ms CodeModel.GetById 9ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 0ms

/security/nss/lib/freebl/mpi/vis_proto.h

http://github.com/zpao/v8monkey
C Header | 267 lines | 172 code | 34 blank | 61 comment | 0 complexity | 4f9b444adc92881880cae37d3127ffd5 MD5 | raw file
  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
 48extern "C" {
 49#endif /* __cplusplus */
 50
 51/* Pure edge handling instructions */
 52int vis_edge8(void * /*frs1*/, void * /*frs2*/);
 53int vis_edge8l(void * /*frs1*/, void * /*frs2*/);
 54int vis_edge16(void * /*frs1*/, void * /*frs2*/);
 55int vis_edge16l(void * /*frs1*/, void * /*frs2*/);
 56int vis_edge32(void * /*frs1*/, void * /*frs2*/);
 57int vis_edge32l(void * /*frs1*/, void * /*frs2*/);
 58
 59/* Edge handling instructions with negative return values if cc set. */
 60int vis_edge8cc(void * /*frs1*/, void * /*frs2*/);
 61int vis_edge8lcc(void * /*frs1*/, void * /*frs2*/);
 62int vis_edge16cc(void * /*frs1*/, void * /*frs2*/);
 63int vis_edge16lcc(void * /*frs1*/, void * /*frs2*/);
 64int vis_edge32cc(void * /*frs1*/, void * /*frs2*/);
 65int vis_edge32lcc(void * /*frs1*/, void * /*frs2*/);
 66
 67/* Alignment instructions. */
 68void *vis_alignaddr(void * /*rs1*/, int /*rs2*/);
 69void *vis_alignaddrl(void * /*rs1*/, int /*rs2*/);
 70double vis_faligndata(double /*frs1*/, double /*frs2*/);
 71
 72/* Partitioned comparison instructions. */
 73int vis_fcmple16(double /*frs1*/, double /*frs2*/);
 74int vis_fcmpne16(double /*frs1*/, double /*frs2*/);
 75int vis_fcmple32(double /*frs1*/, double /*frs2*/);
 76int vis_fcmpne32(double /*frs1*/, double /*frs2*/);
 77int vis_fcmpgt16(double /*frs1*/, double /*frs2*/);
 78int vis_fcmpeq16(double /*frs1*/, double /*frs2*/);
 79int vis_fcmpgt32(double /*frs1*/, double /*frs2*/);
 80int vis_fcmpeq32(double /*frs1*/, double /*frs2*/);
 81
 82/* Partitioned multiplication. */
 83#if 0
 84double vis_fmul8x16(float /*frs1*/, double /*frs2*/);
 85#endif
 86double vis_fmul8x16_dummy(float /*frs1*/, int /*dummy*/, double /*frs2*/);
 87double vis_fmul8x16au(float /*frs1*/, float /*frs2*/);
 88double vis_fmul8x16al(float /*frs1*/, float /*frs2*/);
 89double vis_fmul8sux16(double /*frs1*/, double /*frs2*/);
 90double vis_fmul8ulx16(double /*frs1*/, double /*frs2*/);
 91double vis_fmuld8ulx16(float /*frs1*/, float /*frs2*/);
 92double vis_fmuld8sux16(float /*frs1*/, float /*frs2*/);
 93
 94/* Partitioned addition & subtraction. */
 95double vis_fpadd16(double /*frs1*/, double /*frs2*/);
 96float vis_fpadd16s(float /*frs1*/, float /*frs2*/);
 97double vis_fpadd32(double /*frs1*/, double /*frs2*/);
 98float vis_fpadd32s(float /*frs1*/, float /*frs2*/);
 99double vis_fpsub16(double /*frs1*/, double /*frs2*/);
100float vis_fpsub16s(float /*frs1*/, float /*frs2*/);
101double vis_fpsub32(double /*frs1*/, double /*frs2*/);
102float vis_fpsub32s(float /*frs1*/, float /*frs2*/);
103
104/* Pixel packing & clamping. */
105float vis_fpack16(double /*frs2*/);
106double vis_fpack32(double /*frs1*/, double /*frs2*/);
107float vis_fpackfix(double /*frs2*/);
108
109/* Combined pack ops. */
110double vis_fpack16_pair(double /*frs2*/, double /*frs2*/);
111double vis_fpackfix_pair(double /*frs2*/, double /*frs2*/);
112void vis_st2_fpack16(double, double, double *);
113void vis_std_fpack16(double, double, double *);
114void vis_st2_fpackfix(double, double, double *);
115
116double vis_fpack16_to_hi(double /*frs1*/, double /*frs2*/);
117double vis_fpack16_to_lo(double /*frs1*/, double /*frs2*/);
118
119/* Motion estimation. */
120double vis_pdist(double /*frs1*/, double /*frs2*/, double /*frd*/);
121
122/* Channel merging. */
123double vis_fpmerge(float /*frs1*/, float /*frs2*/);
124
125/* Pixel expansion. */
126double vis_fexpand(float /*frs2*/);
127double vis_fexpand_hi(double /*frs2*/);
128double vis_fexpand_lo(double /*frs2*/);
129
130/* Bitwise logical operators. */
131double vis_fnor(double /*frs1*/, double /*frs2*/);
132float vis_fnors(float /*frs1*/, float /*frs2*/);
133double vis_fandnot(double /*frs1*/, double /*frs2*/);
134float vis_fandnots(float /*frs1*/, float /*frs2*/);
135double vis_fnot(double /*frs1*/);
136float vis_fnots(float /*frs1*/);
137double vis_fxor(double /*frs1*/, double /*frs2*/);
138float vis_fxors(float /*frs1*/, float /*frs2*/);
139double vis_fnand(double /*frs1*/, double /*frs2*/);
140float vis_fnands(float /*frs1*/, float /*frs2*/);
141double vis_fand(double /*frs1*/, double /*frs2*/);
142float vis_fands(float /*frs1*/, float /*frs2*/);
143double vis_fxnor(double /*frs1*/, double /*frs2*/);
144float vis_fxnors(float /*frs1*/, float /*frs2*/);
145double vis_fsrc(double /*frs1*/);
146float vis_fsrcs(float /*frs1*/);
147double vis_fornot(double /*frs1*/, double /*frs2*/);
148float vis_fornots(float /*frs1*/, float /*frs2*/);
149double vis_for(double /*frs1*/, double /*frs2*/);
150float vis_fors(float /*frs1*/, float /*frs2*/);
151double vis_fzero(void);
152float vis_fzeros(void);
153double vis_fone(void);
154float vis_fones(void);
155
156/* Partial stores. */
157void vis_stdfa_ASI_PST8P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
158void vis_stdfa_ASI_PST8PL(double /*frd*/, void * /*rs1*/, int /*rmask*/);
159void vis_stdfa_ASI_PST8P_int_pair(void * /*rs1*/, void * /*rs2*/,
160                                  void * /*rs3*/, int /*rmask*/);
161void vis_stdfa_ASI_PST8S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
162void vis_stdfa_ASI_PST16P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
163void vis_stdfa_ASI_PST16S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
164void vis_stdfa_ASI_PST32P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
165void vis_stdfa_ASI_PST32S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
166
167/* Byte & short stores. */
168void vis_stdfa_ASI_FL8P(double /*frd*/, void * /*rs1*/);
169void vis_stdfa_ASI_FL8P_index(double /*frd*/, void * /*rs1*/, long /*index*/);
170void vis_stdfa_ASI_FL8S(double /*frd*/, void * /*rs1*/);
171void vis_stdfa_ASI_FL16P(double /*frd*/, void * /*rs1*/);
172void vis_stdfa_ASI_FL16P_index(double /*frd*/, void * /*rs1*/, long /*index*/);
173void vis_stdfa_ASI_FL16S(double /*frd*/, void * /*rs1*/);
174void vis_stdfa_ASI_FL8PL(double /*frd*/, void * /*rs1*/);
175void vis_stdfa_ASI_FL8SL(double /*frd*/, void * /*rs1*/);
176void vis_stdfa_ASI_FL16PL(double /*frd*/, void * /*rs1*/);
177void vis_stdfa_ASI_FL16SL(double /*frd*/, void * /*rs1*/);
178
179/* Byte & short loads. */
180double vis_lddfa_ASI_FL8P(void * /*rs1*/);
181double vis_lddfa_ASI_FL8P_index(void * /*rs1*/, long /*index*/);
182double vis_lddfa_ASI_FL8P_hi(void * /*rs1*/, unsigned int /*index*/);
183double vis_lddfa_ASI_FL8P_lo(void * /*rs1*/, unsigned int /*index*/);
184double vis_lddfa_ASI_FL8S(void * /*rs1*/);
185double vis_lddfa_ASI_FL16P(void * /*rs1*/);
186double vis_lddfa_ASI_FL16P_index(void * /*rs1*/, long /*index*/);
187double vis_lddfa_ASI_FL16S(void * /*rs1*/);
188double vis_lddfa_ASI_FL8PL(void * /*rs1*/);
189double vis_lddfa_ASI_FL8SL(void * /*rs1*/);
190double vis_lddfa_ASI_FL16PL(void * /*rs1*/);
191double vis_lddfa_ASI_FL16SL(void * /*rs1*/);
192
193/* Direct write to GSR, read from GSR */
194void vis_write_gsr(unsigned int /*GSR*/);
195unsigned int vis_read_gsr(void);
196
197/* Voxel texture mapping. */
198#if !defined(_NO_LONGLONG)
199unsigned long vis_array8(unsigned long long /*rs1*/, int /*rs2*/);
200unsigned long vis_array16(unsigned long long /*rs1*/, int /*rs2*/);
201unsigned long vis_array32(unsigned long long /*rs1*/, int /*rs2*/);
202#endif /* !defined(_NO_LONGLONG) */
203
204/* Register aliasing and type casts. */
205float vis_read_hi(double /*frs1*/);
206float vis_read_lo(double /*frs1*/);
207double vis_write_hi(double /*frs1*/, float /*frs2*/);
208double vis_write_lo(double /*frs1*/, float /*frs2*/);
209double vis_freg_pair(float /*frs1*/, float /*frs2*/);
210float vis_to_float(unsigned int /*value*/);
211double vis_to_double(unsigned int /*value1*/, unsigned int /*value2*/);
212double vis_to_double_dup(unsigned int /*value*/);
213#if !defined(_NO_LONGLONG)
214double vis_ll_to_double(unsigned long long /*value*/);
215#endif /* !defined(_NO_LONGLONG) */
216
217/* Miscellany (no inlines) */
218void vis_error(char * /*fmt*/, int /*a0*/);
219void 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 */