xref: /openbsd-src/gnu/usr.bin/binutils/opcodes/s390-opc.c (revision cf2f2c5620d6d9a4fd01930983c4b9a1f76d7aa3)
1d2201f2fSdrahn /* s390-opc.c -- S390 opcode list
2d2201f2fSdrahn    Copyright 2000, 2001 Free Software Foundation, Inc.
3d2201f2fSdrahn    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
4d2201f2fSdrahn 
5d2201f2fSdrahn    This file is part of GDB, GAS, and the GNU binutils.
6d2201f2fSdrahn 
7d2201f2fSdrahn    This program is free software; you can redistribute it and/or modify
8d2201f2fSdrahn    it under the terms of the GNU General Public License as published by
9d2201f2fSdrahn    the Free Software Foundation; either version 2 of the License, or
10d2201f2fSdrahn    (at your option) any later version.
11d2201f2fSdrahn 
12d2201f2fSdrahn    This program is distributed in the hope that it will be useful,
13d2201f2fSdrahn    but WITHOUT ANY WARRANTY; without even the implied warranty of
14d2201f2fSdrahn    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15d2201f2fSdrahn    GNU General Public License for more details.
16d2201f2fSdrahn 
17d2201f2fSdrahn    You should have received a copy of the GNU General Public License
18d2201f2fSdrahn    along with this program; if not, write to the Free Software
19d2201f2fSdrahn    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20d2201f2fSdrahn    02111-1307, USA.  */
21d2201f2fSdrahn 
22d2201f2fSdrahn #include <stdio.h>
23d2201f2fSdrahn #include "ansidecl.h"
24d2201f2fSdrahn #include "opcode/s390.h"
25d2201f2fSdrahn 
26d2201f2fSdrahn /* This file holds the S390 opcode table.  The opcode table
27d2201f2fSdrahn    includes almost all of the extended instruction mnemonics.  This
28d2201f2fSdrahn    permits the disassembler to use them, and simplifies the assembler
29d2201f2fSdrahn    logic, at the cost of increasing the table size.  The table is
30d2201f2fSdrahn    strictly constant data, so the compiler should be able to put it in
31d2201f2fSdrahn    the .text section.
32d2201f2fSdrahn 
33d2201f2fSdrahn    This file also holds the operand table.  All knowledge about
34d2201f2fSdrahn    inserting operands into instructions and vice-versa is kept in this
35d2201f2fSdrahn    file.  */
36d2201f2fSdrahn 
37d2201f2fSdrahn /* The operands table.
38d2201f2fSdrahn    The fields are bits, shift, insert, extract, flags.  */
39d2201f2fSdrahn 
40d2201f2fSdrahn const struct s390_operand s390_operands[] =
41d2201f2fSdrahn {
42d2201f2fSdrahn #define UNUSED 0
43d2201f2fSdrahn   { 0, 0, 0 },                    /* Indicates the end of the operand list */
44d2201f2fSdrahn 
45d2201f2fSdrahn #define R_8    1                  /* GPR starting at position 8 */
46d2201f2fSdrahn   { 4, 8, S390_OPERAND_GPR },
47d2201f2fSdrahn #define R_12   2                  /* GPR starting at position 12 */
48d2201f2fSdrahn   { 4, 12, S390_OPERAND_GPR },
49d2201f2fSdrahn #define R_16   3                  /* GPR starting at position 16 */
50d2201f2fSdrahn   { 4, 16, S390_OPERAND_GPR },
51d2201f2fSdrahn #define R_20   4                  /* GPR starting at position 20 */
52d2201f2fSdrahn   { 4, 20, S390_OPERAND_GPR },
53d2201f2fSdrahn #define R_24   5                  /* GPR starting at position 24 */
54d2201f2fSdrahn   { 4, 24, S390_OPERAND_GPR },
55d2201f2fSdrahn #define R_28   6                  /* GPR starting at position 28 */
56d2201f2fSdrahn   { 4, 28, S390_OPERAND_GPR },
57d2201f2fSdrahn #define R_32   7                  /* GPR starting at position 32 */
58d2201f2fSdrahn   { 4, 32, S390_OPERAND_GPR },
59d2201f2fSdrahn 
60d2201f2fSdrahn #define F_8    8                  /* FPR starting at position 8 */
61d2201f2fSdrahn   { 4, 8, S390_OPERAND_FPR },
62d2201f2fSdrahn #define F_12   9                  /* FPR starting at position 12 */
63d2201f2fSdrahn   { 4, 12, S390_OPERAND_FPR },
64d2201f2fSdrahn #define F_16   10                 /* FPR starting at position 16 */
65d2201f2fSdrahn   { 4, 16, S390_OPERAND_FPR },
66d2201f2fSdrahn #define F_20   11                 /* FPR starting at position 16 */
67d2201f2fSdrahn   { 4, 16, S390_OPERAND_FPR },
68d2201f2fSdrahn #define F_24   12                 /* FPR starting at position 24 */
69d2201f2fSdrahn   { 4, 24, S390_OPERAND_FPR },
70d2201f2fSdrahn #define F_28   13                 /* FPR starting at position 28 */
71d2201f2fSdrahn   { 4, 28, S390_OPERAND_FPR },
72d2201f2fSdrahn #define F_32   14                 /* FPR starting at position 32 */
73d2201f2fSdrahn   { 4, 32, S390_OPERAND_FPR },
74d2201f2fSdrahn 
75d2201f2fSdrahn #define A_8    15                 /* Access reg. starting at position 8 */
76d2201f2fSdrahn   { 4, 8, S390_OPERAND_AR },
77d2201f2fSdrahn #define A_12   16                 /* Access reg. starting at position 12 */
78d2201f2fSdrahn   { 4, 12, S390_OPERAND_AR },
79d2201f2fSdrahn #define A_24   17                 /* Access reg. starting at position 24 */
80d2201f2fSdrahn   { 4, 24, S390_OPERAND_AR },
81d2201f2fSdrahn #define A_28   18                 /* Access reg. starting at position 28 */
82d2201f2fSdrahn   { 4, 28, S390_OPERAND_AR },
83d2201f2fSdrahn 
84d2201f2fSdrahn #define C_8    19                 /* Control reg. starting at position 8 */
85d2201f2fSdrahn   { 4, 8, S390_OPERAND_CR },
86d2201f2fSdrahn #define C_12   20                 /* Control reg. starting at position 12 */
87d2201f2fSdrahn   { 4, 12, S390_OPERAND_CR },
88d2201f2fSdrahn 
89d2201f2fSdrahn #define B_16   21                 /* Base register starting at position 16 */
90d2201f2fSdrahn   { 4, 16, S390_OPERAND_BASE|S390_OPERAND_GPR },
91d2201f2fSdrahn #define B_32   22                 /* Base register starting at position 32 */
92d2201f2fSdrahn   { 4, 32, S390_OPERAND_BASE|S390_OPERAND_GPR },
93d2201f2fSdrahn 
94d2201f2fSdrahn #define X_12   23                 /* Index register starting at position 12 */
95d2201f2fSdrahn   { 4, 12, S390_OPERAND_INDEX|S390_OPERAND_GPR },
96d2201f2fSdrahn 
97d2201f2fSdrahn #define D_20   24                 /* Displacement starting at position 20 */
98d2201f2fSdrahn   { 12, 20, S390_OPERAND_DISP },
99d2201f2fSdrahn #define D_36   25                 /* Displacement starting at position 36 */
100d2201f2fSdrahn   { 12, 36, S390_OPERAND_DISP },
101*cf2f2c56Smiod #define D20_20 26		  /* 20 bit displacement starting at 20 */
102*cf2f2c56Smiod   { 20, 20, S390_OPERAND_DISP|S390_OPERAND_SIGNED },
103d2201f2fSdrahn 
104*cf2f2c56Smiod #define L4_8   27                 /* 4 bit length starting at position 8 */
105d2201f2fSdrahn   { 4, 8, S390_OPERAND_LENGTH },
106*cf2f2c56Smiod #define L4_12  28                 /* 4 bit length starting at position 12 */
107d2201f2fSdrahn   { 4, 12, S390_OPERAND_LENGTH },
108*cf2f2c56Smiod #define L8_8   29                 /* 8 bit length starting at position 8 */
109d2201f2fSdrahn   { 8, 8, S390_OPERAND_LENGTH },
110d2201f2fSdrahn 
111*cf2f2c56Smiod #define U4_8   30                 /* 4 bit unsigned value starting at 8 */
112d2201f2fSdrahn   { 4, 8, 0 },
113*cf2f2c56Smiod #define U4_12  31                 /* 4 bit unsigned value starting at 12 */
114d2201f2fSdrahn   { 4, 12, 0 },
115*cf2f2c56Smiod #define U4_16  32                 /* 4 bit unsigned value starting at 16 */
116d2201f2fSdrahn   { 4, 16, 0 },
117*cf2f2c56Smiod #define U4_20  33                 /* 4 bit unsigned value starting at 20 */
118d2201f2fSdrahn   { 4, 20, 0 },
119*cf2f2c56Smiod #define U8_8   34                 /* 8 bit unsigned value starting at 8 */
120d2201f2fSdrahn   { 8, 8, 0 },
121*cf2f2c56Smiod #define U8_16  35                 /* 8 bit unsigned value starting at 16 */
122d2201f2fSdrahn   { 8, 16, 0 },
123*cf2f2c56Smiod #define I16_16 36                 /* 16 bit signed value starting at 16 */
124d2201f2fSdrahn   { 16, 16, S390_OPERAND_SIGNED },
125*cf2f2c56Smiod #define U16_16 37                 /* 16 bit unsigned value starting at 16 */
126d2201f2fSdrahn   { 16, 16, 0 },
127*cf2f2c56Smiod #define J16_16 38                 /* PC relative jump offset at 16 */
128d2201f2fSdrahn   { 16, 16, S390_OPERAND_PCREL },
129*cf2f2c56Smiod #define J32_16 39                 /* PC relative long offset at 16 */
130d2201f2fSdrahn   { 32, 16, S390_OPERAND_PCREL }
131d2201f2fSdrahn };
132d2201f2fSdrahn 
133d2201f2fSdrahn 
134d2201f2fSdrahn /* Macros used to form opcodes.  */
135d2201f2fSdrahn 
136d2201f2fSdrahn /* 8/16/48 bit opcodes.  */
137d2201f2fSdrahn #define OP8(x) { x, 0x00, 0x00, 0x00, 0x00, 0x00 }
138d2201f2fSdrahn #define OP16(x) { x >> 8, x & 255, 0x00, 0x00, 0x00, 0x00 }
139d2201f2fSdrahn #define OP48(x) { x >> 40, (x >> 32) & 255, (x >> 24) & 255, \
140d2201f2fSdrahn                   (x >> 16) & 255, (x >> 8) & 255, x & 255}
141d2201f2fSdrahn 
142d2201f2fSdrahn /* The new format of the INSTR_x_y and MASK_x_y defines is based
143d2201f2fSdrahn    on the following rules:
144d2201f2fSdrahn    1) the middle part of the definition (x in INSTR_x_y) is the official
145d2201f2fSdrahn       names of the instruction format that you can find in the principals
146d2201f2fSdrahn       of operation.
147d2201f2fSdrahn    2) the last part of the definition (y in INSTR_x_y) gives you an idea
148d2201f2fSdrahn       which operands the binary represenation of the instruction has.
149d2201f2fSdrahn       The meanings of the letters in y are:
150d2201f2fSdrahn       a - access register
151d2201f2fSdrahn       c - control register
152d2201f2fSdrahn       d - displacement, 12 bit
153d2201f2fSdrahn       f - floating pointer register
154d2201f2fSdrahn       i - signed integer, 4 or 8 bit
155d2201f2fSdrahn       l - length, 4 or 8 bit
156d2201f2fSdrahn       p - pc relative
157d2201f2fSdrahn       r - general purpose register
158d2201f2fSdrahn       u - unsigned integer, 4 or 8 bit
159d2201f2fSdrahn       0 - operand skipped.
160d2201f2fSdrahn       The order of the letters reflects the layout of the format in
161d2201f2fSdrahn       storage and not the order of the paramaters of the instructions.
162d2201f2fSdrahn       The use of the letters is not a 100% match with the PoP but it is
163d2201f2fSdrahn       quite close.
164d2201f2fSdrahn 
165d2201f2fSdrahn       For example the instruction "mvo" is defined in the PoP as follows:
166d2201f2fSdrahn 
167d2201f2fSdrahn       MVO  D1(L1,B1),D2(L2,B2)   [SS]
168d2201f2fSdrahn 
169d2201f2fSdrahn       --------------------------------------
170d2201f2fSdrahn       | 'F1' | L1 | L2 | B1 | D1 | B2 | D2 |
171d2201f2fSdrahn       --------------------------------------
172d2201f2fSdrahn        0      8    12   16   20   32   36
173d2201f2fSdrahn 
174d2201f2fSdrahn       The instruction format is: INSTR_SS_LLRDRD / MASK_SS_LLRDRD.  */
175d2201f2fSdrahn 
176d2201f2fSdrahn #define INSTR_E          2, { 0,0,0,0,0,0 }                    /* e.g. pr    */
177d2201f2fSdrahn #define INSTR_RIE_RRP    6, { R_8,R_12,J16_16,0,0,0 }          /* e.g. brxhg */
178d2201f2fSdrahn #define INSTR_RIL_0P     6, { J32_16,0,0,0,0 }                 /* e.g. jg    */
179d2201f2fSdrahn #define INSTR_RIL_RP     6, { R_8,J32_16,0,0,0,0 }             /* e.g. brasl */
180d2201f2fSdrahn #define INSTR_RIL_UP     6, { U4_8,J32_16,0,0,0,0 }            /* e.g. brcl  */
181d2201f2fSdrahn #define INSTR_RI_0P      4, { J16_16,0,0,0,0,0 }               /* e.g. j     */
182d2201f2fSdrahn #define INSTR_RI_RI      4, { R_8,I16_16,0,0,0,0 }             /* e.g. ahi   */
183d2201f2fSdrahn #define INSTR_RI_RP      4, { R_8,J16_16,0,0,0,0 }             /* e.g. brct  */
184d2201f2fSdrahn #define INSTR_RI_RU      4, { R_8,U16_16,0,0,0,0 }             /* e.g. tml   */
185d2201f2fSdrahn #define INSTR_RI_UP      4, { U4_8,J16_16,0,0,0,0 }            /* e.g. brc   */
186d2201f2fSdrahn #define INSTR_RRE_00     4, { 0,0,0,0,0,0 }                    /* e.g. palb  */
187d2201f2fSdrahn #define INSTR_RRE_0R     4, { R_28,0,0,0,0,0 }                 /* e.g. tb    */
188d2201f2fSdrahn #define INSTR_RRE_AA     4, { A_24,A_28,0,0,0,0 }              /* e.g. cpya  */
189d2201f2fSdrahn #define INSTR_RRE_AR     4, { A_24,R_28,0,0,0,0 }              /* e.g. sar   */
190d2201f2fSdrahn #define INSTR_RRE_F0     4, { F_24,0,0,0,0,0 }                 /* e.g. sqer  */
191d2201f2fSdrahn #define INSTR_RRE_FF     4, { F_24,F_28,0,0,0,0 }              /* e.g. debr  */
192d2201f2fSdrahn #define INSTR_RRE_R0     4, { R_24,0,0,0,0,0 }                 /* e.g. ipm   */
193d2201f2fSdrahn #define INSTR_RRE_RA     4, { R_24,A_28,0,0,0,0 }              /* e.g. ear   */
194d2201f2fSdrahn #define INSTR_RRE_RF     4, { R_24,F_28,0,0,0,0 }              /* e.g. cefbr */
195d2201f2fSdrahn #define INSTR_RRE_RR     4, { R_24,R_28,0,0,0,0 }              /* e.g. lura  */
196d2201f2fSdrahn #define INSTR_RRF_F0FF   4, { F_16,F_24,F_28,0,0,0 }           /* e.g. madbr */
197d2201f2fSdrahn #define INSTR_RRF_FUFF   4, { F_24,F_16,F_28,U4_20,0,0 }       /* e.g. didbr */
198d2201f2fSdrahn #define INSTR_RRF_RURR   4, { R_24,R_28,R_16,U4_20,0,0 }       /* e.g. .insn */
199*cf2f2c56Smiod #define INSTR_RRF_R0RR   4, { R_24,R_28,R_16,0,0,0 }           /* e.g. idte  */
200d2201f2fSdrahn #define INSTR_RRF_U0FF   4, { F_24,U4_16,F_28,0,0,0 }          /* e.g. cfxbr */
201d2201f2fSdrahn #define INSTR_RRF_U0FR   4, { F_24,U4_16,R_28,0,0,0 }          /* e.g. cfebr */
202d2201f2fSdrahn #define INSTR_RRF_U0FR   4, { F_24,U4_16,R_28,0,0,0 }          /* e.g. cfxbr */
203d2201f2fSdrahn #define INSTR_RR_0R      2, { R_12, 0,0,0,0,0 }                /* e.g. br    */
204d2201f2fSdrahn #define INSTR_RR_FF      2, { F_8,F_12,0,0,0,0 }               /* e.g. adr   */
205d2201f2fSdrahn #define INSTR_RR_R0      2, { R_8, 0,0,0,0,0 }                 /* e.g. spm   */
206d2201f2fSdrahn #define INSTR_RR_RR      2, { R_8,R_12,0,0,0,0 }               /* e.g. lr    */
207d2201f2fSdrahn #define INSTR_RR_U0      2, { U8_8, 0,0,0,0,0 }                /* e.g. svc   */
208d2201f2fSdrahn #define INSTR_RR_UR      2, { U4_8,R_12,0,0,0,0 }              /* e.g. bcr   */
209d2201f2fSdrahn #define INSTR_RSE_RRRD   6, { R_8,R_12,D_20,B_16,0,0 }         /* e.g. lmh   */
210d2201f2fSdrahn #define INSTR_RSE_RURD   6, { R_8,U4_12,D_20,B_16,0,0 }        /* e.g. icmh  */
211*cf2f2c56Smiod #define INSTR_RSL_R0RD   6, { R_8,D_20,B_16,0,0,0 }            /* e.g. tp    */
212d2201f2fSdrahn #define INSTR_RSI_RRP    4, { R_8,R_12,J16_16,0,0,0 }          /* e.g. brxh  */
213*cf2f2c56Smiod #define INSTR_RSY_RRRD   6, { R_8,R_12,D20_20,B_16,0,0 }       /* e.g. stmy  */
214*cf2f2c56Smiod #define INSTR_RSY_RURD   6, { R_8,U4_12,D20_20,B_16,0,0 }      /* e.g. icmh  */
215*cf2f2c56Smiod #define INSTR_RSY_AARD   6, { A_8,A_12,D20_20,B_16,0,0 }       /* e.g. lamy  */
216d2201f2fSdrahn #define INSTR_RS_AARD    4, { A_8,A_12,D_20,B_16,0,0 }         /* e.g. lam   */
217d2201f2fSdrahn #define INSTR_RS_CCRD    4, { C_8,C_12,D_20,B_16,0,0 }         /* e.g. lctl  */
218d2201f2fSdrahn #define INSTR_RS_R0RD    4, { R_8,D_20,B_16,0,0,0 }            /* e.g. sll   */
219d2201f2fSdrahn #define INSTR_RS_RRRD    4, { R_8,R_12,D_20,B_16,0,0 }         /* e.g. cs    */
220d2201f2fSdrahn #define INSTR_RS_RURD    4, { R_8,U4_12,D_20,B_16,0,0 }        /* e.g. icm   */
221d2201f2fSdrahn #define INSTR_RXE_FRRD   6, { F_8,D_20,X_12,B_16,0,0 }         /* e.g. axbr  */
222d2201f2fSdrahn #define INSTR_RXE_RRRD   6, { R_8,D_20,X_12,B_16,0,0 }         /* e.g. lg    */
223d2201f2fSdrahn #define INSTR_RXF_FRRDF  6, { F_32,F_8,D_20,X_12,B_16,0 }      /* e.g. madb  */
224d2201f2fSdrahn #define INSTR_RXF_RRRDR  6, { R_32,R_8,D_20,X_12,B_16,0 }      /* e.g. .insn */
225*cf2f2c56Smiod #define INSTR_RXY_RRRD   6, { R_8,D20_20,X_12,B_16,0,0 }       /* e.g. ly    */
226*cf2f2c56Smiod #define INSTR_RXY_FRRD   6, { F_8,D20_20,X_12,B_16,0,0 }       /* e.g. ley   */
227d2201f2fSdrahn #define INSTR_RX_0RRD    4, { D_20,X_12,B_16,0,0,0 }           /* e.g. be    */
228d2201f2fSdrahn #define INSTR_RX_FRRD    4, { F_8,D_20,X_12,B_16,0,0 }         /* e.g. ae    */
229d2201f2fSdrahn #define INSTR_RX_RRRD    4, { R_8,D_20,X_12,B_16,0,0 }         /* e.g. l     */
230d2201f2fSdrahn #define INSTR_RX_URRD    4, { U4_8,D_20,X_12,B_16,0,0 }        /* e.g. bc    */
231d2201f2fSdrahn #define INSTR_SI_URD     4, { D_20,B_16,U8_8,0,0,0 }           /* e.g. cli   */
232*cf2f2c56Smiod #define INSTR_SIY_URD    6, { D20_20,B_16,U8_8,0,0,0 }         /* e.g. tmy   */
233d2201f2fSdrahn #define INSTR_SSE_RDRD   6, { D_20,B_16,D_36,B_32,0,0 }        /* e.g. mvsdk */
234d2201f2fSdrahn #define INSTR_SS_L0RDRD  6, { D_20,L8_8,B_16,D_36,B_32,0     } /* e.g. mvc   */
235d2201f2fSdrahn #define INSTR_SS_LIRDRD  6, { D_20,L4_8,B_16,D_36,B_32,U4_12 } /* e.g. srp   */
236d2201f2fSdrahn #define INSTR_SS_LLRDRD  6, { D_20,L4_8,B_16,D_36,L4_12,B_32 } /* e.g. pack  */
237d2201f2fSdrahn #define INSTR_SS_RRRDRD  6, { D_20,R_8,B_16,D_36,B_32,R_12 }   /* e.g. mvck  */
238d2201f2fSdrahn #define INSTR_SS_RRRDRD2 6, { R_8,D_20,B_16,R_12,D_36,B_32 }   /* e.g. plo   */
239d2201f2fSdrahn #define INSTR_SS_RRRDRD3 6, { R_8,R_12,D_20,B_16,D_36,B_32 }   /* e.g. lmd   */
240d2201f2fSdrahn #define INSTR_S_00       4, { 0,0,0,0,0,0 }                    /* e.g. hsch  */
241d2201f2fSdrahn #define INSTR_S_RD       4, { D_20,B_16,0,0,0,0 }              /* e.g. lpsw  */
242d2201f2fSdrahn 
243d2201f2fSdrahn #define MASK_E           { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
244d2201f2fSdrahn #define MASK_RIE_RRP     { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
245d2201f2fSdrahn #define MASK_RIL_0P      { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
246d2201f2fSdrahn #define MASK_RIL_RP      { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
247d2201f2fSdrahn #define MASK_RIL_UP      { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
248d2201f2fSdrahn #define MASK_RI_0P       { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
249d2201f2fSdrahn #define MASK_RI_RI       { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
250d2201f2fSdrahn #define MASK_RI_RP       { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
251d2201f2fSdrahn #define MASK_RI_RU       { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
252d2201f2fSdrahn #define MASK_RI_UP       { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
253d2201f2fSdrahn #define MASK_RRE_00      { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 }
254d2201f2fSdrahn #define MASK_RRE_0R      { 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00 }
255d2201f2fSdrahn #define MASK_RRE_AA      { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 }
256d2201f2fSdrahn #define MASK_RRE_AR      { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 }
257d2201f2fSdrahn #define MASK_RRE_F0      { 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00 }
258d2201f2fSdrahn #define MASK_RRE_FF      { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 }
259d2201f2fSdrahn #define MASK_RRE_R0      { 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00 }
260d2201f2fSdrahn #define MASK_RRE_RA      { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 }
261d2201f2fSdrahn #define MASK_RRE_RF      { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 }
262d2201f2fSdrahn #define MASK_RRE_RR      { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 }
263d2201f2fSdrahn #define MASK_RRF_F0FF    { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
264d2201f2fSdrahn #define MASK_RRF_FUFF    { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
265d2201f2fSdrahn #define MASK_RRF_RURR    { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
266*cf2f2c56Smiod #define MASK_RRF_R0RR    { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
267d2201f2fSdrahn #define MASK_RRF_U0FF    { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
268d2201f2fSdrahn #define MASK_RRF_U0FR    { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
269d2201f2fSdrahn #define MASK_RRF_U0FR    { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
270d2201f2fSdrahn #define MASK_RR_0R       { 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00 }
271d2201f2fSdrahn #define MASK_RR_FF       { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
272d2201f2fSdrahn #define MASK_RR_R0       { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
273d2201f2fSdrahn #define MASK_RR_RR       { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
274d2201f2fSdrahn #define MASK_RR_U0       { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
275d2201f2fSdrahn #define MASK_RR_UR       { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
276d2201f2fSdrahn #define MASK_RSE_RRRD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
277d2201f2fSdrahn #define MASK_RSE_RURD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
278*cf2f2c56Smiod #define MASK_RSL_R0RD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
279d2201f2fSdrahn #define MASK_RSI_RRP     { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
280d2201f2fSdrahn #define MASK_RS_AARD     { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
281d2201f2fSdrahn #define MASK_RS_CCRD     { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
282d2201f2fSdrahn #define MASK_RS_R0RD     { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
283d2201f2fSdrahn #define MASK_RS_RRRD     { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
284d2201f2fSdrahn #define MASK_RS_RURD     { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
285*cf2f2c56Smiod #define MASK_RSY_RRRD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
286*cf2f2c56Smiod #define MASK_RSY_RURD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
287*cf2f2c56Smiod #define MASK_RSY_AARD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
288d2201f2fSdrahn #define MASK_RXE_FRRD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
289d2201f2fSdrahn #define MASK_RXE_RRRD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
290d2201f2fSdrahn #define MASK_RXF_FRRDF   { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
291d2201f2fSdrahn #define MASK_RXF_RRRDR   { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
292*cf2f2c56Smiod #define MASK_RXY_RRRD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
293*cf2f2c56Smiod #define MASK_RXY_FRRD    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
294d2201f2fSdrahn #define MASK_RX_0RRD     { 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00 }
295d2201f2fSdrahn #define MASK_RX_FRRD     { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
296d2201f2fSdrahn #define MASK_RX_RRRD     { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
297d2201f2fSdrahn #define MASK_RX_URRD     { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
298d2201f2fSdrahn #define MASK_SI_URD      { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
299*cf2f2c56Smiod #define MASK_SIY_URD     { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
300d2201f2fSdrahn #define MASK_SSE_RDRD    { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
301d2201f2fSdrahn #define MASK_SS_L0RDRD   { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
302d2201f2fSdrahn #define MASK_SS_LIRDRD   { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
303d2201f2fSdrahn #define MASK_SS_LLRDRD   { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
304d2201f2fSdrahn #define MASK_SS_RRRDRD   { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
305d2201f2fSdrahn #define MASK_SS_RRRDRD2  { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
306d2201f2fSdrahn #define MASK_SS_RRRDRD3  { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
307d2201f2fSdrahn #define MASK_S_00        { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 }
308d2201f2fSdrahn #define MASK_S_RD        { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
309d2201f2fSdrahn 
310d2201f2fSdrahn /* The opcode formats table (blueprints for .insn pseudo mnemonic).  */
311d2201f2fSdrahn 
312d2201f2fSdrahn const struct s390_opcode s390_opformats[] =
313d2201f2fSdrahn   {
314d2201f2fSdrahn   { "e",	OP8(0x00LL),	MASK_E,		INSTR_E,	3, 0 },
315d2201f2fSdrahn   { "ri",	OP8(0x00LL),	MASK_RI_RI,	INSTR_RI_RI,	3, 0 },
316d2201f2fSdrahn   { "rie",	OP8(0x00LL),	MASK_RIE_RRP,	INSTR_RIE_RRP,	3, 0 },
317d2201f2fSdrahn   { "ril",	OP8(0x00LL),	MASK_RIL_RP,	INSTR_RIL_RP,	3, 0 },
318d2201f2fSdrahn   { "rr",	OP8(0x00LL),	MASK_RR_RR,	INSTR_RR_RR,	3, 0 },
319d2201f2fSdrahn   { "rre",	OP8(0x00LL),	MASK_RRE_RR,	INSTR_RRE_RR,	3, 0 },
320d2201f2fSdrahn   { "rrf",	OP8(0x00LL),	MASK_RRF_RURR,	INSTR_RRF_RURR,	3, 0 },
321d2201f2fSdrahn   { "rs",	OP8(0x00LL),	MASK_RS_RRRD,	INSTR_RS_RRRD,	3, 0 },
322d2201f2fSdrahn   { "rse",	OP8(0x00LL),	MASK_RSE_RRRD,	INSTR_RSE_RRRD,	3, 0 },
323d2201f2fSdrahn   { "rsi",	OP8(0x00LL),	MASK_RSI_RRP,	INSTR_RSI_RRP,	3, 0 },
324*cf2f2c56Smiod   { "rsy",	OP8(0x00LL),	MASK_RSY_RRRD,	INSTR_RSY_RRRD,	3, 3 },
325d2201f2fSdrahn   { "rx",	OP8(0x00LL),	MASK_RX_RRRD,	INSTR_RX_RRRD,	3, 0 },
326d2201f2fSdrahn   { "rxe",	OP8(0x00LL),	MASK_RXE_RRRD,	INSTR_RXE_RRRD,	3, 0 },
327d2201f2fSdrahn   { "rxf",	OP8(0x00LL),	MASK_RXF_RRRDR,	INSTR_RXF_RRRDR,3, 0 },
328*cf2f2c56Smiod   { "rxy",	OP8(0x00LL),	MASK_RXY_RRRD,	INSTR_RXY_RRRD,	3, 3 },
329d2201f2fSdrahn   { "s",	OP8(0x00LL),	MASK_S_RD,	INSTR_S_RD,	3, 0 },
330d2201f2fSdrahn   { "si",	OP8(0x00LL),	MASK_SI_URD,	INSTR_SI_URD,	3, 0 },
331*cf2f2c56Smiod   { "siy",	OP8(0x00LL),	MASK_SIY_URD,	INSTR_SIY_URD,	3, 3 },
332d2201f2fSdrahn   { "ss",	OP8(0x00LL),	MASK_SS_RRRDRD,	INSTR_SS_RRRDRD,3, 0 },
333d2201f2fSdrahn   { "sse",	OP8(0x00LL),	MASK_SSE_RDRD,	INSTR_SSE_RDRD,	3, 0 },
334d2201f2fSdrahn };
335d2201f2fSdrahn 
336d2201f2fSdrahn const int s390_num_opformats =
337d2201f2fSdrahn   sizeof (s390_opformats) / sizeof (s390_opformats[0]);
338d2201f2fSdrahn 
339d2201f2fSdrahn #include "s390-opc.tab"
340