Lines Matching +full:ext +full:- +full:gen

1 #!/bin/awk -f
2 # SPDX-License-Identifier: GPL-2.0
3 # gen-insn-attr-x86.awk: Instruction attribute table generator
6 # Usage: awk -f gen-insn-attr-x86.awk x86-opcode-map.txt > inat-tables.c
11 return "Your awk has a printf-format problem."
21 eid = -1 # escape id
22 gid = -1 # group id
23 aid = -1 # AVX id
24 xopid = -1 # XOP id
38 print "/* x86 opcode map generated from x86-opcode-map.txt */"
49 opnd_expr = "^[A-Za-z/]"
52 group_expr = "^Grp[0-9A-Za-z]+"
54 imm_expr = "^[IJAOL][a-z]"
69 modrm_expr = "^([CDEGMNPQRSUVW/][a-z]+|NTA|T[012])"
84 # All opcodes starting with lower-case 'v', 'k' or with (v1) superscript
98 prefix_num["Operand-Size"] = "INAT_PFX_OPNDSZ"
110 prefix_num["Address-Size"] = "INAT_PFX_ADDRSZ"
157 xopid = -1
163 if (aid == -1 && eid == -1) # primary opcode table
171 aid = -1
177 if (xopid == -1 && eid == -1) # primary opcode table
201 if (gid != -1) {
291 /^[0-9a-f]+:/ {
295 idx = "0x" substr($1, 1, index($1,":") - 1)
320 ext = null
330 ext = $(i++)
345 if (match(ext, force64_expr))
348 # check invalid in 64-bit (and no only64)
349 if (match(ext, invalid64_expr) &&
354 if (match(ext, no_rex2_expr))
366 if (match(ext, evexonly_expr))
368 else if (match(ext, evex_scalable_expr))
370 else if (match(ext, vexonly_expr))
372 else if (match(ext, vexok_expr) || match(opcode, vexok_opcode_expr))
374 else if (match(ext, xopok_expr) || xopid >= 0)
378 if (match(ext, prefix_expr)) {
386 if (match(ext, lprefix1_expr)) {
390 if (match(ext, lprefix2_expr)) {
394 if (match(ext, lprefix3_expr)) {
398 if (match(ext, rex2_expr))
400 if (!match(ext, lprefix_expr)){
443 print "const insn_attr_t * const inat_xop_tables[X86_XOP_M_MAX - X86_XOP_M_MIN + 1]" \
468 print "static const insn_attr_t *inat_xop_tables[X86_XOP_M_MAX - X86_XOP_M_MIN + 1];"