xref: /illumos-gate/usr/src/tools/smatch/src/opcode.c (revision c85f09cc)
1*c85f09ccSJohn Levon /*
2*c85f09ccSJohn Levon  * Copyright (C) 2017 Luc Van Oostenryck
3*c85f09ccSJohn Levon  *
4*c85f09ccSJohn Levon  * Permission is hereby granted, free of charge, to any person obtaining a copy
5*c85f09ccSJohn Levon  * of this software and associated documentation files (the "Software"), to deal
6*c85f09ccSJohn Levon  * in the Software without restriction, including without limitation the rights
7*c85f09ccSJohn Levon  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8*c85f09ccSJohn Levon  * copies of the Software, and to permit persons to whom the Software is
9*c85f09ccSJohn Levon  * furnished to do so, subject to the following conditions:
10*c85f09ccSJohn Levon  *
11*c85f09ccSJohn Levon  * The above copyright notice and this permission notice shall be included in
12*c85f09ccSJohn Levon  * all copies or substantial portions of the Software.
13*c85f09ccSJohn Levon  *
14*c85f09ccSJohn Levon  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*c85f09ccSJohn Levon  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*c85f09ccSJohn Levon  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17*c85f09ccSJohn Levon  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18*c85f09ccSJohn Levon  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19*c85f09ccSJohn Levon  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20*c85f09ccSJohn Levon  * THE SOFTWARE.
21*c85f09ccSJohn Levon  */
22*c85f09ccSJohn Levon 
23*c85f09ccSJohn Levon #include "opcode.h"
24*c85f09ccSJohn Levon 
25*c85f09ccSJohn Levon const struct opcode_table opcode_table[OP_LAST] = {
26*c85f09ccSJohn Levon #define OPCODE(OP,NG,SW,TF,N,FL)	\
27*c85f09ccSJohn Levon 	[OP_##OP] = {			\
28*c85f09ccSJohn Levon 		.negate   = OP_##NG,	\
29*c85f09ccSJohn Levon 		.swap     = OP_##SW,	\
30*c85f09ccSJohn Levon 		.to_float = OP_##TF,	\
31*c85f09ccSJohn Levon 		.arity    = N,		\
32*c85f09ccSJohn Levon 		.flags    = FL,		\
33*c85f09ccSJohn Levon 	},
34*c85f09ccSJohn Levon #define OPCODE_RANGE(OP,S,E)
35*c85f09ccSJohn Levon #include "opcode.def"
36*c85f09ccSJohn Levon #undef OPCODE
37*c85f09ccSJohn Levon #undef OPCODE_RANGE
38*c85f09ccSJohn Levon };
39