Back to index

lightning-sunbird  0.9+nobinonly
vis_proto.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is prototypes for vis.il  (vis_proto.h 1.3).
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Sun Microsystems Inc.
00018  * Portions created by the Initial Developer are Copyright (C) 1995
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 /* $Id: vis_proto.h,v 1.3 2004/04/27 23:04:36 gerv%gerv.net Exp $ */
00037 
00038 /*
00039  * Prototypes for the inline templates in vis.il
00040  */
00041 
00042 #ifndef VIS_PROTO_H
00043 #define VIS_PROTO_H
00044 
00045 #pragma ident "@(#)vis_proto.h     1.3    97/03/30 SMI"
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif /* __cplusplus */
00050 
00051 /* Pure edge handling instructions */
00052 int vis_edge8(void * /*frs1*/, void * /*frs2*/);
00053 int vis_edge8l(void * /*frs1*/, void * /*frs2*/);
00054 int vis_edge16(void * /*frs1*/, void * /*frs2*/);
00055 int vis_edge16l(void * /*frs1*/, void * /*frs2*/);
00056 int vis_edge32(void * /*frs1*/, void * /*frs2*/);
00057 int vis_edge32l(void * /*frs1*/, void * /*frs2*/);
00058 
00059 /* Edge handling instructions with negative return values if cc set. */
00060 int vis_edge8cc(void * /*frs1*/, void * /*frs2*/);
00061 int vis_edge8lcc(void * /*frs1*/, void * /*frs2*/);
00062 int vis_edge16cc(void * /*frs1*/, void * /*frs2*/);
00063 int vis_edge16lcc(void * /*frs1*/, void * /*frs2*/);
00064 int vis_edge32cc(void * /*frs1*/, void * /*frs2*/);
00065 int vis_edge32lcc(void * /*frs1*/, void * /*frs2*/);
00066 
00067 /* Alignment instructions. */
00068 void *vis_alignaddr(void * /*rs1*/, int /*rs2*/);
00069 void *vis_alignaddrl(void * /*rs1*/, int /*rs2*/);
00070 double vis_faligndata(double /*frs1*/, double /*frs2*/);
00071 
00072 /* Partitioned comparison instructions. */
00073 int vis_fcmple16(double /*frs1*/, double /*frs2*/);
00074 int vis_fcmpne16(double /*frs1*/, double /*frs2*/);
00075 int vis_fcmple32(double /*frs1*/, double /*frs2*/);
00076 int vis_fcmpne32(double /*frs1*/, double /*frs2*/);
00077 int vis_fcmpgt16(double /*frs1*/, double /*frs2*/);
00078 int vis_fcmpeq16(double /*frs1*/, double /*frs2*/);
00079 int vis_fcmpgt32(double /*frs1*/, double /*frs2*/);
00080 int vis_fcmpeq32(double /*frs1*/, double /*frs2*/);
00081 
00082 /* Partitioned multiplication. */
00083 #if 0
00084 double vis_fmul8x16(float /*frs1*/, double /*frs2*/);
00085 #endif
00086 double vis_fmul8x16_dummy(float /*frs1*/, int /*dummy*/, double /*frs2*/);
00087 double vis_fmul8x16au(float /*frs1*/, float /*frs2*/);
00088 double vis_fmul8x16al(float /*frs1*/, float /*frs2*/);
00089 double vis_fmul8sux16(double /*frs1*/, double /*frs2*/);
00090 double vis_fmul8ulx16(double /*frs1*/, double /*frs2*/);
00091 double vis_fmuld8ulx16(float /*frs1*/, float /*frs2*/);
00092 double vis_fmuld8sux16(float /*frs1*/, float /*frs2*/);
00093 
00094 /* Partitioned addition & subtraction. */
00095 double vis_fpadd16(double /*frs1*/, double /*frs2*/);
00096 float vis_fpadd16s(float /*frs1*/, float /*frs2*/);
00097 double vis_fpadd32(double /*frs1*/, double /*frs2*/);
00098 float vis_fpadd32s(float /*frs1*/, float /*frs2*/);
00099 double vis_fpsub16(double /*frs1*/, double /*frs2*/);
00100 float vis_fpsub16s(float /*frs1*/, float /*frs2*/);
00101 double vis_fpsub32(double /*frs1*/, double /*frs2*/);
00102 float vis_fpsub32s(float /*frs1*/, float /*frs2*/);
00103 
00104 /* Pixel packing & clamping. */
00105 float vis_fpack16(double /*frs2*/);
00106 double vis_fpack32(double /*frs1*/, double /*frs2*/);
00107 float vis_fpackfix(double /*frs2*/);
00108 
00109 /* Combined pack ops. */
00110 double vis_fpack16_pair(double /*frs2*/, double /*frs2*/);
00111 double vis_fpackfix_pair(double /*frs2*/, double /*frs2*/);
00112 void vis_st2_fpack16(double, double, double *);
00113 void vis_std_fpack16(double, double, double *);
00114 void vis_st2_fpackfix(double, double, double *);
00115 
00116 double vis_fpack16_to_hi(double /*frs1*/, double /*frs2*/);
00117 double vis_fpack16_to_lo(double /*frs1*/, double /*frs2*/);
00118 
00119 /* Motion estimation. */
00120 double vis_pdist(double /*frs1*/, double /*frs2*/, double /*frd*/);
00121 
00122 /* Channel merging. */
00123 double vis_fpmerge(float /*frs1*/, float /*frs2*/);
00124 
00125 /* Pixel expansion. */
00126 double vis_fexpand(float /*frs2*/);
00127 double vis_fexpand_hi(double /*frs2*/);
00128 double vis_fexpand_lo(double /*frs2*/);
00129 
00130 /* Bitwise logical operators. */
00131 double vis_fnor(double /*frs1*/, double /*frs2*/);
00132 float vis_fnors(float /*frs1*/, float /*frs2*/);
00133 double vis_fandnot(double /*frs1*/, double /*frs2*/);
00134 float vis_fandnots(float /*frs1*/, float /*frs2*/);
00135 double vis_fnot(double /*frs1*/);
00136 float vis_fnots(float /*frs1*/);
00137 double vis_fxor(double /*frs1*/, double /*frs2*/);
00138 float vis_fxors(float /*frs1*/, float /*frs2*/);
00139 double vis_fnand(double /*frs1*/, double /*frs2*/);
00140 float vis_fnands(float /*frs1*/, float /*frs2*/);
00141 double vis_fand(double /*frs1*/, double /*frs2*/);
00142 float vis_fands(float /*frs1*/, float /*frs2*/);
00143 double vis_fxnor(double /*frs1*/, double /*frs2*/);
00144 float vis_fxnors(float /*frs1*/, float /*frs2*/);
00145 double vis_fsrc(double /*frs1*/);
00146 float vis_fsrcs(float /*frs1*/);
00147 double vis_fornot(double /*frs1*/, double /*frs2*/);
00148 float vis_fornots(float /*frs1*/, float /*frs2*/);
00149 double vis_for(double /*frs1*/, double /*frs2*/);
00150 float vis_fors(float /*frs1*/, float /*frs2*/);
00151 double vis_fzero(void);
00152 float vis_fzeros(void);
00153 double vis_fone(void);
00154 float vis_fones(void);
00155 
00156 /* Partial stores. */
00157 void vis_stdfa_ASI_PST8P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
00158 void vis_stdfa_ASI_PST8PL(double /*frd*/, void * /*rs1*/, int /*rmask*/);
00159 void vis_stdfa_ASI_PST8P_int_pair(void * /*rs1*/, void * /*rs2*/,
00160                                   void * /*rs3*/, int /*rmask*/);
00161 void vis_stdfa_ASI_PST8S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
00162 void vis_stdfa_ASI_PST16P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
00163 void vis_stdfa_ASI_PST16S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
00164 void vis_stdfa_ASI_PST32P(double /*frd*/, void * /*rs1*/, int /*rmask*/);
00165 void vis_stdfa_ASI_PST32S(double /*frd*/, void * /*rs1*/, int /*rmask*/);
00166 
00167 /* Byte & short stores. */
00168 void vis_stdfa_ASI_FL8P(double /*frd*/, void * /*rs1*/);
00169 void vis_stdfa_ASI_FL8P_index(double /*frd*/, void * /*rs1*/, long /*index*/);
00170 void vis_stdfa_ASI_FL8S(double /*frd*/, void * /*rs1*/);
00171 void vis_stdfa_ASI_FL16P(double /*frd*/, void * /*rs1*/);
00172 void vis_stdfa_ASI_FL16P_index(double /*frd*/, void * /*rs1*/, long /*index*/);
00173 void vis_stdfa_ASI_FL16S(double /*frd*/, void * /*rs1*/);
00174 void vis_stdfa_ASI_FL8PL(double /*frd*/, void * /*rs1*/);
00175 void vis_stdfa_ASI_FL8SL(double /*frd*/, void * /*rs1*/);
00176 void vis_stdfa_ASI_FL16PL(double /*frd*/, void * /*rs1*/);
00177 void vis_stdfa_ASI_FL16SL(double /*frd*/, void * /*rs1*/);
00178 
00179 /* Byte & short loads. */
00180 double vis_lddfa_ASI_FL8P(void * /*rs1*/);
00181 double vis_lddfa_ASI_FL8P_index(void * /*rs1*/, long /*index*/);
00182 double vis_lddfa_ASI_FL8P_hi(void * /*rs1*/, unsigned int /*index*/);
00183 double vis_lddfa_ASI_FL8P_lo(void * /*rs1*/, unsigned int /*index*/);
00184 double vis_lddfa_ASI_FL8S(void * /*rs1*/);
00185 double vis_lddfa_ASI_FL16P(void * /*rs1*/);
00186 double vis_lddfa_ASI_FL16P_index(void * /*rs1*/, long /*index*/);
00187 double vis_lddfa_ASI_FL16S(void * /*rs1*/);
00188 double vis_lddfa_ASI_FL8PL(void * /*rs1*/);
00189 double vis_lddfa_ASI_FL8SL(void * /*rs1*/);
00190 double vis_lddfa_ASI_FL16PL(void * /*rs1*/);
00191 double vis_lddfa_ASI_FL16SL(void * /*rs1*/);
00192 
00193 /* Direct write to GSR, read from GSR */
00194 void vis_write_gsr(unsigned int /*GSR*/);
00195 unsigned int vis_read_gsr(void);
00196 
00197 /* Voxel texture mapping. */
00198 #if !defined(_NO_LONGLONG)
00199 unsigned long vis_array8(unsigned long long /*rs1*/, int /*rs2*/);
00200 unsigned long vis_array16(unsigned long long /*rs1*/, int /*rs2*/);
00201 unsigned long vis_array32(unsigned long long /*rs1*/, int /*rs2*/);
00202 #endif /* !defined(_NO_LONGLONG) */
00203 
00204 /* Register aliasing and type casts. */
00205 float vis_read_hi(double /*frs1*/);
00206 float vis_read_lo(double /*frs1*/);
00207 double vis_write_hi(double /*frs1*/, float /*frs2*/);
00208 double vis_write_lo(double /*frs1*/, float /*frs2*/);
00209 double vis_freg_pair(float /*frs1*/, float /*frs2*/);
00210 float vis_to_float(unsigned int /*value*/);
00211 double vis_to_double(unsigned int /*value1*/, unsigned int /*value2*/);
00212 double vis_to_double_dup(unsigned int /*value*/);
00213 #if !defined(_NO_LONGLONG)
00214 double vis_ll_to_double(unsigned long long /*value*/);
00215 #endif /* !defined(_NO_LONGLONG) */
00216 
00217 /* Miscellany (no inlines) */
00218 void vis_error(char * /*fmt*/, int /*a0*/);
00219 void vis_sim_init(void);
00220 
00221 /* For better performance */
00222 #define vis_fmul8x16(farg,darg) vis_fmul8x16_dummy((farg),0,(darg))
00223 
00224 /* Nicknames for explicit ASI loads and stores. */
00225 #define vis_st_u8      vis_stdfa_ASI_FL8P
00226 #define vis_st_u8_i    vis_stdfa_ASI_FL8P_index
00227 #define vis_st_u8_le   vis_stdfa_ASI_FL8PL
00228 #define vis_st_u16     vis_stdfa_ASI_FL16P
00229 #define vis_st_u16_i   vis_stdfa_ASI_FL16P_index
00230 #define vis_st_u16_le  vis_stdfa_ASI_FL16PL
00231 
00232 #define vis_ld_u8      vis_lddfa_ASI_FL8P
00233 #define vis_ld_u8_i    vis_lddfa_ASI_FL8P_index
00234 #define vis_ld_u8_le   vis_lddfa_ASI_FL8PL
00235 #define vis_ld_u16     vis_lddfa_ASI_FL16P
00236 #define vis_ld_u16_i   vis_lddfa_ASI_FL16P_index
00237 #define vis_ld_u16_le  vis_lddfa_ASI_FL16PL
00238 
00239 #define vis_pst_8      vis_stdfa_ASI_PST8P
00240 #define vis_pst_16     vis_stdfa_ASI_PST16P
00241 #define vis_pst_32     vis_stdfa_ASI_PST32P
00242 
00243 #define vis_st_u8s     vis_stdfa_ASI_FL8S
00244 #define vis_st_u8s_le  vis_stdfa_ASI_FL8SL
00245 #define vis_st_u16s    vis_stdfa_ASI_FL16S
00246 #define vis_st_u16s_le vis_stdfa_ASI_FL16SL
00247 
00248 #define vis_ld_u8s     vis_lddfa_ASI_FL8S
00249 #define vis_ld_u8s_le  vis_lddfa_ASI_FL8SL
00250 #define vis_ld_u16s    vis_lddfa_ASI_FL16S
00251 #define vis_ld_u16s_le vis_lddfa_ASI_FL16SL
00252 
00253 #define vis_pst_8s     vis_stdfa_ASI_PST8S
00254 #define vis_pst_16s    vis_stdfa_ASI_PST16S
00255 #define vis_pst_32s    vis_stdfa_ASI_PST32S
00256 
00257 /* "<" and ">=" may be implemented in terms of ">" and "<=". */
00258 #define vis_fcmplt16(a,b) vis_fcmpgt16((b),(a))
00259 #define vis_fcmplt32(a,b) vis_fcmpgt32((b),(a))
00260 #define vis_fcmpge16(a,b) vis_fcmple16((b),(a))
00261 #define vis_fcmpge32(a,b) vis_fcmple32((b),(a))
00262 
00263 #ifdef __cplusplus
00264 } // End of extern "C"
00265 #endif /* __cplusplus */
00266 
00267 #endif /* VIS_PROTO_H */