01712f1f6dbdd7af444f7438ea3de775f728a06a
[imager.git] / lib / Imager / Regops.pm
1 # AUTOMATICALLY GENERATED BY regops.perl
2 package Imager::Regops;
3 use strict;
4 require Exporter;
5 use vars qw(@ISA @EXPORT @EXPORT_OK %Attr $MaxOperands $PackCode);
6 @ISA = qw(Exporter);
7 @EXPORT_OK = qw(%Attr $MaxOperands $PackCode);
8
9 use constant RBC_ADD => 0;
10 use constant RBC_SUBTRACT => 1;
11 use constant RBC_MULT => 2;
12 use constant RBC_DIV => 3;
13 use constant RBC_MOD => 4;
14 use constant RBC_POW => 5;
15 use constant RBC_UMINUS => 6;
16 use constant RBC_MULTP => 7;
17 use constant RBC_ADDP => 8;
18 use constant RBC_SUBTRACTP => 9;
19 use constant RBC_SIN => 10;
20 use constant RBC_COS => 11;
21 use constant RBC_ATAN2 => 12;
22 use constant RBC_SQRT => 13;
23 use constant RBC_DISTANCE => 14;
24 use constant RBC_GETP1 => 15;
25 use constant RBC_GETP2 => 16;
26 use constant RBC_GETP3 => 17;
27 use constant RBC_VALUE => 18;
28 use constant RBC_HUE => 19;
29 use constant RBC_SAT => 20;
30 use constant RBC_HSV => 21;
31 use constant RBC_RED => 22;
32 use constant RBC_GREEN => 23;
33 use constant RBC_BLUE => 24;
34 use constant RBC_RGB => 25;
35 use constant RBC_INT => 26;
36 use constant RBC_IF => 27;
37 use constant RBC_IFP => 28;
38 use constant RBC_LE => 29;
39 use constant RBC_LT => 30;
40 use constant RBC_GE => 31;
41 use constant RBC_GT => 32;
42 use constant RBC_EQ => 33;
43 use constant RBC_NE => 34;
44 use constant RBC_AND => 35;
45 use constant RBC_OR => 36;
46 use constant RBC_NOT => 37;
47 use constant RBC_ABS => 38;
48 use constant RBC_RET => 39;
49 use constant RBC_JUMP => 40;
50 use constant RBC_JUMPZ => 41;
51 use constant RBC_JUMPNZ => 42;
52 use constant RBC_SET => 43;
53 use constant RBC_SETP => 44;
54 use constant RBC_PRINT => 45;
55 use constant RBC_OP_COUNT => 46;
56
57 @EXPORT = qw(RBC_ADD RBC_SUBTRACT RBC_MULT RBC_DIV RBC_MOD RBC_POW RBC_UMINUS RBC_MULTP RBC_ADDP RBC_SUBTRACTP RBC_SIN RBC_COS RBC_ATAN2 RBC_SQRT RBC_DISTANCE RBC_GETP1 RBC_GETP2 RBC_GETP3 RBC_VALUE RBC_HUE RBC_SAT RBC_HSV RBC_RED RBC_GREEN RBC_BLUE RBC_RGB RBC_INT RBC_IF RBC_IFP RBC_LE RBC_LT RBC_GE RBC_GT RBC_EQ RBC_NE RBC_AND RBC_OR RBC_NOT RBC_ABS RBC_RET RBC_JUMP RBC_JUMPZ RBC_JUMPNZ RBC_SET RBC_SETP RBC_PRINT RBC_OP_COUNT);
58
59 %Attr = (
60           'or' => {
61                     'opcode' => 36,
62                     'parms' => 2,
63                     'func' => '0',
64                     'types' => 'rr',
65                     'result' => 'r'
66                   },
67           'getp1' => {
68                        'opcode' => 15,
69                        'parms' => 2,
70                        'func' => 1,
71                        'types' => 'rr',
72                        'result' => 'p'
73                      },
74           'uminus' => {
75                         'opcode' => 6,
76                         'parms' => 1,
77                         'func' => '0',
78                         'types' => 'r',
79                         'result' => 'r'
80                       },
81           'getp2' => {
82                        'opcode' => 16,
83                        'parms' => 2,
84                        'func' => 1,
85                        'types' => 'rr',
86                        'result' => 'p'
87                      },
88           'getp3' => {
89                        'opcode' => 17,
90                        'parms' => 2,
91                        'func' => 1,
92                        'types' => 'rr',
93                        'result' => 'p'
94                      },
95           'jumpnz' => {
96                         'opcode' => 42,
97                         'parms' => 1,
98                         'func' => '0',
99                         'types' => 'r',
100                         'result' => undef
101                       },
102           'op_count' => {
103                           'opcode' => 46,
104                           'parms' => '0',
105                           'func' => '0',
106                           'types' => '',
107                           'result' => undef
108                         },
109           'blue' => {
110                       'opcode' => 24,
111                       'parms' => 1,
112                       'func' => 1,
113                       'types' => 'p',
114                       'result' => 'r'
115                     },
116           'int' => {
117                      'opcode' => 26,
118                      'parms' => 1,
119                      'func' => 1,
120                      'types' => 'r',
121                      'result' => 'r'
122                    },
123           'le' => {
124                     'opcode' => 29,
125                     'parms' => 2,
126                     'func' => '0',
127                     'types' => 'rr',
128                     'result' => 'r'
129                   },
130           'multp' => {
131                        'opcode' => 7,
132                        'parms' => 2,
133                        'func' => '0',
134                        'types' => 'pr',
135                        'result' => 'p'
136                      },
137           'ne' => {
138                     'opcode' => 34,
139                     'parms' => 2,
140                     'func' => '0',
141                     'types' => 'rr',
142                     'result' => 'r'
143                   },
144           'jumpz' => {
145                        'opcode' => 41,
146                        'parms' => 1,
147                        'func' => '0',
148                        'types' => 'r',
149                        'result' => undef
150                      },
151           'atan2' => {
152                        'opcode' => 12,
153                        'parms' => 2,
154                        'func' => 1,
155                        'types' => 'rr',
156                        'result' => 'r'
157                      },
158           'subtractp' => {
159                            'opcode' => 9,
160                            'parms' => 2,
161                            'func' => '0',
162                            'types' => 'pp',
163                            'result' => 'p'
164                          },
165           'rgb' => {
166                      'opcode' => 25,
167                      'parms' => 3,
168                      'func' => 1,
169                      'types' => 'rrr',
170                      'result' => 'p'
171                    },
172           'red' => {
173                      'opcode' => 22,
174                      'parms' => 1,
175                      'func' => 1,
176                      'types' => 'p',
177                      'result' => 'r'
178                    },
179           'setp' => {
180                       'opcode' => 44,
181                       'parms' => 1,
182                       'func' => '0',
183                       'types' => 'p',
184                       'result' => 'p'
185                     },
186           'jump' => {
187                       'opcode' => 40,
188                       'parms' => '0',
189                       'func' => '0',
190                       'types' => '',
191                       'result' => undef
192                     },
193           'value' => {
194                        'opcode' => 18,
195                        'parms' => 1,
196                        'func' => 1,
197                        'types' => 'p',
198                        'result' => 'r'
199                      },
200           'mod' => {
201                      'opcode' => 4,
202                      'parms' => 2,
203                      'func' => '0',
204                      'types' => 'rr',
205                      'result' => 'r'
206                    },
207           'lt' => {
208                     'opcode' => 30,
209                     'parms' => 2,
210                     'func' => '0',
211                     'types' => 'rr',
212                     'result' => 'r'
213                   },
214           'mult' => {
215                       'opcode' => 2,
216                       'parms' => 2,
217                       'func' => '0',
218                       'types' => 'rr',
219                       'result' => 'r'
220                     },
221           'hue' => {
222                      'opcode' => 19,
223                      'parms' => 1,
224                      'func' => 1,
225                      'types' => 'p',
226                      'result' => 'r'
227                    },
228           'div' => {
229                      'opcode' => 3,
230                      'parms' => 2,
231                      'func' => '0',
232                      'types' => 'rr',
233                      'result' => 'r'
234                    },
235           'cos' => {
236                      'opcode' => 11,
237                      'parms' => 1,
238                      'func' => 1,
239                      'types' => 'r',
240                      'result' => 'r'
241                    },
242           'subtract' => {
243                           'opcode' => 1,
244                           'parms' => 2,
245                           'func' => '0',
246                           'types' => 'rr',
247                           'result' => 'r'
248                         },
249           'sat' => {
250                      'opcode' => 20,
251                      'parms' => 1,
252                      'func' => 1,
253                      'types' => 'p',
254                      'result' => 'r'
255                    },
256           'add' => {
257                      'opcode' => '0',
258                      'parms' => 2,
259                      'func' => '0',
260                      'types' => 'rr',
261                      'result' => 'r'
262                    },
263           'sin' => {
264                      'opcode' => 10,
265                      'parms' => 1,
266                      'func' => 1,
267                      'types' => 'r',
268                      'result' => 'r'
269                    },
270           'sqrt' => {
271                       'opcode' => 13,
272                       'parms' => 1,
273                       'func' => 1,
274                       'types' => 'r',
275                       'result' => 'r'
276                     },
277           'ret' => {
278                      'opcode' => 39,
279                      'parms' => 1,
280                      'func' => '0',
281                      'types' => 'p',
282                      'result' => undef
283                    },
284           'distance' => {
285                           'opcode' => 14,
286                           'parms' => 4,
287                           'func' => 1,
288                           'types' => 'rrrr',
289                           'result' => 'r'
290                         },
291           'set' => {
292                      'opcode' => 43,
293                      'parms' => 1,
294                      'func' => '0',
295                      'types' => 'r',
296                      'result' => 'r'
297                    },
298           'ge' => {
299                     'opcode' => 31,
300                     'parms' => 2,
301                     'func' => '0',
302                     'types' => 'rr',
303                     'result' => 'r'
304                   },
305           'print' => {
306                        'opcode' => 45,
307                        'parms' => 1,
308                        'func' => '0',
309                        'types' => 'r',
310                        'result' => undef
311                      },
312           'if' => {
313                     'opcode' => 27,
314                     'parms' => 3,
315                     'func' => 1,
316                     'types' => 'rrr',
317                     'result' => 'r'
318                   },
319           'not' => {
320                      'opcode' => 37,
321                      'parms' => 1,
322                      'func' => '0',
323                      'types' => 'r',
324                      'result' => 'r'
325                    },
326           'hsv' => {
327                      'opcode' => 21,
328                      'parms' => 3,
329                      'func' => 1,
330                      'types' => 'rrr',
331                      'result' => 'p'
332                    },
333           'green' => {
334                        'opcode' => 23,
335                        'parms' => 1,
336                        'func' => 1,
337                        'types' => 'p',
338                        'result' => 'r'
339                      },
340           'and' => {
341                      'opcode' => 35,
342                      'parms' => 2,
343                      'func' => '0',
344                      'types' => 'rr',
345                      'result' => 'r'
346                    },
347           'abs' => {
348                      'opcode' => 38,
349                      'parms' => 1,
350                      'func' => 1,
351                      'types' => 'r',
352                      'result' => 'r'
353                    },
354           'eq' => {
355                     'opcode' => 33,
356                     'parms' => 2,
357                     'func' => '0',
358                     'types' => 'rr',
359                     'result' => 'r'
360                   },
361           'pow' => {
362                      'opcode' => 5,
363                      'parms' => 2,
364                      'func' => '0',
365                      'types' => 'rr',
366                      'result' => 'r'
367                    },
368           'addp' => {
369                       'opcode' => 8,
370                       'parms' => 2,
371                       'func' => '0',
372                       'types' => 'pp',
373                       'result' => 'p'
374                     },
375           'gt' => {
376                     'opcode' => 32,
377                     'parms' => 2,
378                     'func' => '0',
379                     'types' => 'rr',
380                     'result' => 'r'
381                   },
382           'ifp' => {
383                      'opcode' => 28,
384                      'parms' => 3,
385                      'func' => 1,
386                      'types' => 'rpp',
387                      'result' => 'p'
388                    }
389         );
390 $MaxOperands = 4;
391 $PackCode = "i";
392 1;
393
394 __END__
395
396 =head1 NAME
397
398 Imager::Regops - generated information about the register based VM
399
400 =head1 SYNOPSIS
401
402   use Imager::Regops;
403   $Imager::Regops::Attr{$opname}->{opcode} # opcode for given operator
404   $Imager::Regops::Attr{$opname}->{parms} # number of parameters
405   $Imager::Regops::Attr{$opname}->{types} # types of parameters
406   $Imager::Regops::Attr{$opname}->{func} # operator is a function
407   $Imager::Regops::Attr{$opname}->{result} # r for numeric, p for pixel result
408   $Imager::Regops::MaxOperands; # maximum number of operands
409
410 =head1 DESCRIPTION
411
412 This module is generated automatically from regmach.h so we don't need to 
413 maintain the same information in at least one extra place.
414
415 At least that's the idea.
416
417 =head1 AUTHOR
418
419 Tony Cook, tony@develop-help.com
420
421 =head1 SEE ALSO
422
423 perl(1), Imager(3), http://www.eecs.umich.edu/~addi/perl/Imager/
424
425 =cut
426