/[mojave]/metaprl/theories/mc/mp_mc_fir_exp.ml
ViewVC logotype

Diff of /metaprl/theories/mc/mp_mc_fir_exp.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3591 by emre, Sat Apr 27 19:52:38 2002 UTC revision 3592 by emre, Mon Apr 29 23:15:57 2002 UTC
# Line 59  Line 59 
59   * @thysubsection{Unary operations}   * @thysubsection{Unary operations}
60   *   *
61   * These are the unary operations in the FIR.  They are used in   * These are the unary operations in the FIR.  They are used in
62   * @hrefterm[letUnop] as the @tt{unop} subterm.  Each of the operators   * @hrefterm[letUnop] as the @tt{unop} subterm.  Each of these
63   * here can only be applied to values of a given type.  In instances   * operators encodes enough information about the type
64   * where the type has precision and / or signing subterms   * of its operand, and in some case, the type of the resulting value.
65   * (such as @hrefterm[tyRawInt]), the qualifiers in the operator   * (For some operators, this type information is implicit and does not
66   * must also match those of the type in order for the @hrefterm[letUnop]   * require any subterms.)  In most cases, the type of an operator's
67   * term to be well-formed.   * operand is the same as the type of its resulting value.
68     * The notable exceptions are the conversion operators.
69   *   *
70   * @tt{idOp} is a polymorphic identity operator.   * @tt{idOp} is a polymorphic identity operator.  It leaves
71     * its operand unchanged.
72   * @end[doc]   * @end[doc]
73   *)   *)
74    
# Line 86  Line 88 
88  (*!  (*!
89   * @begin[doc]   * @begin[doc]
90   *   *
91   * Bit fields.   * Bit fields. (Documentation incomplete.)
92   * @end[doc]   * @end[doc]
93   *)   *)
94    
# Line 104  Line 106 
106  declare uminusRawIntOp{ 'int_precision; 'int_signed }  declare uminusRawIntOp{ 'int_precision; 'int_signed }
107  declare notRawIntOp{ 'int_precision; 'int_signed }  declare notRawIntOp{ 'int_precision; 'int_signed }
108    
109  (* Floats. *)  (*!
110     * @begin[doc]
111     *
112     * The next five terms are basic unary operations on values of type
113     * @hrefterm[tyFloat].  They represent unary negation, absolute value,
114     * sine, cosine, and square root.
115     * @end[doc]
116     *)
117    
118  declare uminusFloatOp{ 'float_precision }  declare uminusFloatOp{ 'float_precision }
119  declare absFloatOp{ 'float_precision }  declare absFloatOp{ 'float_precision }
# Line 112  Line 121 
121  declare cosOp{ 'float_precision }  declare cosOp{ 'float_precision }
122  declare sqrtOp{ 'float_precision }  declare sqrtOp{ 'float_precision }
123    
124  (* Coerce to int. *)  (*!
125     * @begin[doc]
126     *
127     * @tt{intOfFloatOp} specifies the conversion of a value of type
128     * @hrefterm[tyFloat] to a value of type @hrefterm[tyInt]. Note
129     * that the precision of the resulting float value needs to be specified.
130     * @end[doc]
131     *)
132    
133  declare intOfFloatOp{ 'float_precision }  declare intOfFloatOp{ 'float_precision }
134    
135  (* Coerce to float. *)  (*!
136     * @begin[doc]
137     *
138     * The next three terms convert values of type
139     * @hrefterm[tyInt], @hrefterm[tyFloat], and @hrefterm[tyRawInt], respectively,
140     * to values of type @hrefterm[tyFloat].  The precision of the resulting
141     * float value is the first subterm.  Additional subterms, when present,
142     * specify information about the source type.
143     * @end[doc]
144     *)
145    
146  declare floatOfIntOp{ 'float_precision }  declare floatOfIntOp{ 'float_precision }
147  declare floatOfFloatOp{ 'float_precision1; 'float_precision2 }  declare floatOfFloatOp{ 'float_precision_dest; 'float_precision_src }
148  declare floatOfRawIntOp{ 'float_precision; 'int_precision; 'int_signed }  declare floatOfRawIntOp{ 'float_precision; 'int_precision; 'int_signed }
149    
150  (* Coerce to rawint. *)  (*!
151     * @begin[doc]
152     *
153     * The next four terms convert values of type @hrefterm[tyInt],
154     * @hrefterm[tyEnum], @hrefterm[tyFloat], and @hrefterm[tyRawInt],
155     * respectively, to values of type @hrefterm[tyRawInt].  The precision
156     * and signing of the resulting integer value is encoded in the first
157     * two subterms. Additional subterms, when present, specify information
158     * about the source type.
159     * @end[doc]
160     *)
161    
162  declare rawIntOfIntOp{ 'int_precision; 'int_signed }  declare rawIntOfIntOp{ 'int_precision; 'int_signed }
163  declare rawIntOfEnumOp{ 'int_precision; 'int_signed; 'int }  declare rawIntOfEnumOp{ 'int_precision; 'int_signed; 'int }
# Line 130  Line 165 
165  declare rawIntOfRawIntOp{ 'dest_int_precision; 'dest_int_signed;  declare rawIntOfRawIntOp{ 'dest_int_precision; 'dest_int_signed;
166                            'src_int_precision;  'src_int_signed }                            'src_int_precision;  'src_int_signed }
167    
168    (*!
169     * @begin[doc]
170     *
171     * (Documentation incomplete.)
172     * @end[doc]
173     *)
174  (* Integer/pointer coercions. *)  (* Integer/pointer coercions. *)
175    
176  declare rawIntOfPointerOp{ 'int_precision; 'int_signed }  declare rawIntOfPointerOp{ 'int_precision; 'int_signed }
# Line 144  Line 185 
185   * @thysubsection{Binary operations}   * @thysubsection{Binary operations}
186   *   *
187   * These are the binary operations in the FIR.  They are used in   * These are the binary operations in the FIR.  They are used in
188   * @hrefterm[letBinop] as the @tt{binop} subterm.  Each of the operators   * @hrefterm[letBinop] as the @tt{binop} subterm.  Each of these
189   * here can only be applied to values of a given type.  In instances   * operators encodes enough information about the type
190   * where the type has precision and / or signing subterms   * of its operands, and in some case, the type of the resulting value.
191   * (such as @hrefterm[tyRawInt]), the qualifiers in the operator   * (For some operators, this type information is implicit and does not
192   * must also match those of the type in order for the @hrefterm[letBinop]   * require any subterms.)  In most cases, the type of an operator's
193   * term to be well-formed.   * operands is the same as the type of its resulting value.
194   *   *
195     * (Documentation incomplete.)
196   * @end[doc]   * @end[doc]
197   *)   *)
198    
 (* Enums. *)  
   
199  declare andEnumOp{ 'int }  declare andEnumOp{ 'int }
200  declare orEnumOp{ 'int }  declare orEnumOp{ 'int }
201  declare xorEnumOp{ 'int }  declare xorEnumOp{ 'int }
202    
203  (* Naml ints. *)  (*!
204     * @begin[doc]
205     *
206     * The following set of @tt{IntOp}s operate on values of type
207     * @hrefterm[tyInt].  They encode basic arithmetic and boolean
208     * comparison operations.  In order, the arithmetic operations are:
209     * addition, subtraction, multiplication, division, remainder (mod),
210     * logical shift left, logical shift right, arithmetic shift right,
211     * bitwise and, bitwise or, bitwise xor, max (returns the greater
212     * of its operands), min (returns the lesser of its operands).
213     * (Documentation incomplete.)
214     * @end[doc]
215     *)
216    
217  declare plusIntOp  declare plusIntOp
218  declare minusIntOp  declare minusIntOp
# Line 184  Line 236 
236  declare geIntOp  declare geIntOp
237  declare cmpIntOp  declare cmpIntOp
238    
239  (* Native ints. *)  (*!
240     * @begin[doc]
241     *
242     * The following set of @tt{RawIntOp}s operate on values of type
243     * @hrefterm[tyRawInt]. They encode basic arithmetic and boolean
244     * comparison operations.
245     * (Documentation incomplete.)
246     * @end[doc]
247     *)
248  declare plusRawIntOp{ 'int_precision; 'int_signed }  declare plusRawIntOp{ 'int_precision; 'int_signed }
249  declare minusRawIntOp{ 'int_precision; 'int_signed }  declare minusRawIntOp{ 'int_precision; 'int_signed }
250  declare mulRawIntOp{ 'int_precision; 'int_signed }  declare mulRawIntOp{ 'int_precision; 'int_signed }
# Line 209  Line 268 
268  declare geRawIntOp{ 'int_precision; 'int_signed }  declare geRawIntOp{ 'int_precision; 'int_signed }
269  declare cmpRawIntOp{ 'int_precision; 'int_signed }  declare cmpRawIntOp{ 'int_precision; 'int_signed }
270    
271  (* Floats. *)  (*!
272     * @begin[doc]
273     *
274     * The following set of @tt{FloatOp}s operate on values of type
275     * @hrefterm[tyFloat]. They encode basic arithmetic and boolean
276     * comparison operations.
277     * (Documentation incomplete.)
278     * @end[doc]
279     *)
280    
281  declare plusFloatOp{ 'float_precision }  declare plusFloatOp{ 'float_precision }
282  declare minusFloatOp{ 'float_precision }  declare minusFloatOp{ 'float_precision }
# Line 242  Line 309 
309   * @begin[doc]   * @begin[doc]
310   * @thysubsection{Fields (frame labels)}   * @thysubsection{Fields (frame labels)}
311   *   *
312     * (Documentation incomplete.)
313   * @end[doc]   * @end[doc]
314   *)   *)
315    
# Line 251  Line 319 
319   * @begin[doc]   * @begin[doc]
320   * @thysubsection{Normal values}   * @thysubsection{Normal values}
321   *   *
322     * Atoms represent values in the FIR. (Documentation incomplete.)
323   * @end[doc]   * @end[doc]
324   *)   *)
325    
# Line 268  Line 337 
337   * @begin[doc]   * @begin[doc]
338   * @thysubsection{Allocation operators}   * @thysubsection{Allocation operators}
339   *   *
340     * (Documentation incomplete.)
341   * @end[doc]   * @end[doc]
342   *)   *)
343    
# Line 282  Line 352 
352   * @begin[doc]   * @begin[doc]
353   * @thysubsection{Tail calls / operations}   * @thysubsection{Tail calls / operations}
354   *   *
355     * These operators are used in the @hrefterm[specialCall] expression.
356     * They specify the actions that need to occur before control
357     * is passed to another local function.
358     * (Documentation incomplete.)
359   * @end[doc]   * @end[doc]
360   *)   *)
361    
# Line 296  Line 370 
370   *   *
371   * These terms encode the safety checks that an FIR program must   * These terms encode the safety checks that an FIR program must
372   * perform in order to ensure that programs execute safely.   * perform in order to ensure that programs execute safely.
373     * (Documentation incomplete.)
374   * @end[doc]   * @end[doc]
375   *)   *)
376    
# Line 309  Line 384 
384   * @thysubsection{Debugging info}   * @thysubsection{Debugging info}
385   *   *
386   * These terms are used to encode debugging information.   * These terms are used to encode debugging information.
387     * (Documentation incomplete.)
388   * @end[doc]   * @end[doc]
389   *)   *)
390    
# Line 322  Line 398 
398   * @begin[doc]   * @begin[doc]
399   * @thysubsection{Expressions}   * @thysubsection{Expressions}
400   *   *
401     * (Documentation incomplete.)
402   * @end[doc]   * @end[doc]
403   *)   *)
404    
# Line 366  Line 443 
443   * @begin[doc]   * @begin[doc]
444   * @thysubsection{Function definition}   * @thysubsection{Function definition}
445   *   *
446     * (Documentation incomplete.)
447   * @end[doc]   * @end[doc]
448   *)   *)
449    
# Line 442  Line 520 
520     floatOfIntOp{ 'float_precision } =     floatOfIntOp{ 'float_precision } =
521     `"FloatOfIntOp(" slot{'float_precision} `")"     `"FloatOfIntOp(" slot{'float_precision} `")"
522  dform floatOfFLoatOp_df : except_mode[src] ::  dform floatOfFLoatOp_df : except_mode[src] ::
523     floatOfFloatOp{ 'float_precision1; 'float_precision2 } =     floatOfFloatOp{ 'float_precision_dest; 'float_precision_src } =
524     `"FloatOfFloatOp(" slot{'float_precision1} `"," slot{'float_precision2} `")"     `"FloatOfFloatOp(" slot{'float_precision_dest} `","
525       slot{'float_precision_src} `")"
526  dform floatOfRawIntOp_df : except_mode[src] ::  dform floatOfRawIntOp_df : except_mode[src] ::
527     floatOfRawIntOp{ 'float_precision; 'int_precision; 'int_signed } =     floatOfRawIntOp{ 'float_precision; 'int_precision; 'int_signed } =
528     `"FloatOfRawIntOp(" slot{'float_precision} `"," slot{'int_precision}     `"FloatOfRawIntOp(" slot{'float_precision} `"," slot{'int_precision}
# Line 999  Line 1078 
1078    
1079  (* Coerce to float. *)  (* Coerce to float. *)
1080    
1081  let floatOfIntOp_term = << floatOfIntOp{ 'precision } >>  let floatOfIntOp_term = << floatOfIntOp{ 'float_precision } >>
1082  let floatOfIntOp_opname = opname_of_term floatOfIntOp_term  let floatOfIntOp_opname = opname_of_term floatOfIntOp_term
1083  let is_floatOfIntOp_term = is_dep0_term floatOfIntOp_opname  let is_floatOfIntOp_term = is_dep0_term floatOfIntOp_opname
1084  let mk_floatOfIntOp_term = mk_dep0_term floatOfIntOp_opname  let mk_floatOfIntOp_term = mk_dep0_term floatOfIntOp_opname
1085  let dest_floatOfIntOp_term = dest_dep0_term floatOfIntOp_opname  let dest_floatOfIntOp_term = dest_dep0_term floatOfIntOp_opname
1086    
1087  let floatOfFloatOp_term = << floatOfFloatOp{ 'prec1; 'prec2 } >>  let floatOfFloatOp_term =
1088       << floatOfFloatOp{ 'float_precision_dest; 'float_precision_src} >>
1089  let floatOfFloatOp_opname = opname_of_term floatOfFloatOp_term  let floatOfFloatOp_opname = opname_of_term floatOfFloatOp_term
1090  let is_floatOfFloatOp_term = is_dep0_dep0_term floatOfFloatOp_opname  let is_floatOfFloatOp_term = is_dep0_dep0_term floatOfFloatOp_opname
1091  let mk_floatOfFloatOp_term = mk_dep0_dep0_term floatOfFloatOp_opname  let mk_floatOfFloatOp_term = mk_dep0_dep0_term floatOfFloatOp_opname
1092  let dest_floatOfFloatOp_term = dest_dep0_dep0_term floatOfFloatOp_opname  let dest_floatOfFloatOp_term = dest_dep0_dep0_term floatOfFloatOp_opname
1093    
1094  let floatOfRawIntOp_term =  let floatOfRawIntOp_term =
1095     << floatOfRawIntOp{ 'float_prec; 'int_prec; 'int_sign } >>     << floatOfRawIntOp{ 'float_precision; 'int_precision; 'int_signed } >>
1096  let floatOfRawIntOp_opname = opname_of_term floatOfRawIntOp_term  let floatOfRawIntOp_opname = opname_of_term floatOfRawIntOp_term
1097  let is_floatOfRawIntOp_term = is_dep0_dep0_dep0_term floatOfRawIntOp_opname  let is_floatOfRawIntOp_term = is_dep0_dep0_dep0_term floatOfRawIntOp_opname
1098  let mk_floatOfRawIntOp_term = mk_dep0_dep0_dep0_term floatOfRawIntOp_opname  let mk_floatOfRawIntOp_term = mk_dep0_dep0_dep0_term floatOfRawIntOp_opname

Legend:
Removed from v.3591  
changed lines
  Added in v.3592

  ViewVC Help
Powered by ViewVC 1.1.26