2 # Copyright (c) 2018 Linaro Limited
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 # Generate a decoding tree from a specification file.
21 # The tree is built from instruction "patterns". A pattern may represent
22 # a single architectural instruction or a group of same, depending on what
23 # is convenient for further processing.
25 # Each pattern has "fixedbits" & "fixedmask", the combination of which
26 # describes the condition under which the pattern is matched:
28 # (insn & fixedmask) == fixedbits
30 # Each pattern may have "fields", which are extracted from the insn and
31 # passed along to the translator. Examples of such are registers,
32 # immediates, and sub-opcodes.
34 # In support of patterns, one may declare fields, argument sets, and
35 # formats, each of which may be re-used to simplify further definitions.
39 # field_def := '%' identifier ( unnamed_field )+ ( !function=identifier )?
40 # unnamed_field := number ':' ( 's' ) number
42 # For unnamed_field, the first number is the least-significant bit position of
43 # the field and the second number is the length of the field. If the 's' is
44 # present, the field is considered signed. If multiple unnamed_fields are
45 # present, they are concatenated. In this way one can define disjoint fields.
47 # If !function is specified, the concatenated result is passed through the
48 # named function, taking and returning an integral value.
50 # FIXME: the fields of the structure into which this result will be stored
51 # is restricted to "int". Which means that we cannot expand 64-bit items.
55 # %disp 0:s16 -- sextract(i, 0, 16)
56 # %imm9 16:6 10:3 -- extract(i, 16, 6) << 3 | extract(i, 10, 3)
57 # %disp12 0:s1 1:1 2:10 -- sextract(i, 0, 1) << 11
58 # | extract(i, 1, 1) << 10
60 # %shimm8 5:s8 13:1 !function=expand_shimm8
61 # -- expand_shimm8(sextract(i, 5, 8) << 1
62 # | extract(i, 13, 1))
64 # *** Argument set syntax:
66 # args_def := '&' identifier ( args_elt )+
67 # args_elt := identifier
69 # Each args_elt defines an argument within the argument set.
70 # Each argument set will be rendered as a C structure "arg_$name"
71 # with each of the fields being one of the member arguments.
73 # Argument set examples:
76 # &loadstore reg base offset
80 # fmt_def := '@' identifier ( fmt_elt )+
81 # fmt_elt := fixedbit_elt | field_elt | field_ref | args_ref
82 # fixedbit_elt := [01.-]+
83 # field_elt := identifier ':' 's'? number
84 # field_ref := '%' identifier | identifier '=' '%' identifier
85 # args_ref := '&' identifier
87 # Defining a format is a handy way to avoid replicating groups of fields
88 # across many instruction patterns.
90 # A fixedbit_elt describes a contiguous sequence of bits that must
91 # be 1, 0, [.-] for don't care. The difference between '.' and '-'
92 # is that '.' means that the bit will be covered with a field or a
93 # final [01] from the pattern, and '-' means that the bit is really
94 # ignored by the cpu and will not be specified.
96 # A field_elt describes a simple field only given a width; the position of
97 # the field is implied by its position with respect to other fixedbit_elt
100 # If any fixedbit_elt or field_elt appear then all bits must be defined.
101 # Padding with a fixedbit_elt of all '.' is an easy way to accomplish that.
103 # A field_ref incorporates a field by reference. This is the only way to
104 # add a complex field to a format. A field may be renamed in the process
105 # via assignment to another identifier. This is intended to allow the
106 # same argument set be used with disjoint named fields.
108 # A single args_ref may specify an argument set to use for the format.
109 # The set of fields in the format must be a subset of the arguments in
110 # the argument set. If an argument set is not specified, one will be
111 # inferred from the set of fields.
113 # It is recommended, but not required, that all field_ref and args_ref
114 # appear at the end of the line, not interleaving with fixedbit_elf or
119 # @opr ...... ra:5 rb:5 ... 0 ....... rc:5
120 # @opi ...... ra:5 lit:8 1 ....... rc:5
122 # *** Pattern syntax:
124 # pat_def := identifier ( pat_elt )+
125 # pat_elt := fixedbit_elt | field_elt | field_ref
126 # | args_ref | fmt_ref | const_elt
127 # fmt_ref := '@' identifier
128 # const_elt := identifier '=' number
130 # The fixedbit_elt and field_elt specifiers are unchanged from formats.
131 # A pattern that does not specify a named format will have one inferred
132 # from a referenced argument set (if present) and the set of fields.
134 # A const_elt allows a argument to be set to a constant value. This may
135 # come in handy when fields overlap between patterns and one has to
136 # include the values in the fixedbit_elt instead.
138 # The decoder will call a translator function for each pattern matched.
142 # addl_r 010000 ..... ..... .... 0000000 ..... @opr
143 # addl_i 010000 ..... ..... .... 0000000 ..... @opi
145 # which will, in part, invoke
147 # trans_addl_r(ctx, &arg_opr, insn)
149 # trans_addl_i(ctx, &arg_opi, insn)
160 insnmask
= 0xffffffff
166 translate_prefix
= 'trans'
167 translate_scope
= 'static '
171 insntype
= 'uint32_t'
173 re_ident
= '[a-zA-Z][a-zA-Z0-9_]*'
176 def error(lineno
, *args
):
177 """Print an error message from file:line and args and exit."""
182 r
= '{0}:{1}: error:'.format(input_file
, lineno
)
184 r
= '{0}: error:'.format(input_file
)
191 if output_file
and output_fd
:
193 os
.remove(output_file
)
203 if sys
.version_info
>= (3, 0):
204 re_fullmatch
= re
.fullmatch
206 def re_fullmatch(pat
, str):
207 return re
.match('^' + pat
+ '$', str)
210 def output_autogen():
211 output('/* This file is autogenerated by scripts/decodetree.py. */\n\n')
215 """Return a string with C spaces"""
219 def str_fields(fields
):
220 """Return a string uniquely identifing FIELDS"""
222 for n
in sorted(fields
.keys()):
227 def str_match_bits(bits
, mask
):
228 """Return a string pretty-printing BITS/MASK"""
231 i
= 1 << (insnwidth
- 1)
249 """Return true iff X is equal to a power of 2."""
250 return (x
& (x
- 1)) == 0
254 """Return the number of times 2 factors into X."""
256 while ((x
>> r
) & 1) == 0:
261 def is_contiguous(bits
):
263 if is_pow2((bits
>> shift
) + 1):
269 def eq_fields_for_args(flds_a
, flds_b
):
270 if len(flds_a
) != len(flds_b
):
272 for k
, a
in flds_a
.items():
278 def eq_fields_for_fmts(flds_a
, flds_b
):
279 if len(flds_a
) != len(flds_b
):
281 for k
, a
in flds_a
.items():
285 if a
.__class
__ != b
.__class
__ or a
!= b
:
291 """Class representing a simple instruction field"""
292 def __init__(self
, sign
, pos
, len):
296 self
.mask
= ((1 << len) - 1) << pos
303 return str(pos
) + ':' + s
+ str(len)
305 def str_extract(self
):
310 return '{0}(insn, {1}, {2})'.format(extr
, self
.pos
, self
.len)
312 def __eq__(self
, other
):
313 return self
.sign
== other
.sign
and self
.sign
== other
.sign
315 def __ne__(self
, other
):
316 return not self
.__eq
__(other
)
321 """Class representing a compound instruction field"""
322 def __init__(self
, subs
, mask
):
324 self
.sign
= subs
[0].sign
328 return str(self
.subs
)
330 def str_extract(self
):
333 for f
in reversed(self
.subs
):
335 ret
= f
.str_extract()
337 ret
= 'deposit32({0}, {1}, {2}, {3})' \
338 .format(ret
, pos
, 32 - pos
, f
.str_extract())
342 def __ne__(self
, other
):
343 if len(self
.subs
) != len(other
.subs
):
345 for a
, b
in zip(self
.subs
, other
.subs
):
346 if a
.__class
__ != b
.__class
__ or a
!= b
:
350 def __eq__(self
, other
):
351 return not self
.__ne
__(other
)
356 """Class representing an argument field with constant value"""
357 def __init__(self
, value
):
360 self
.sign
= value
< 0
363 return str(self
.value
)
365 def str_extract(self
):
366 return str(self
.value
)
368 def __cmp__(self
, other
):
369 return self
.value
- other
.value
374 """Class representing a field passed through an expander"""
375 def __init__(self
, func
, base
):
376 self
.mask
= base
.mask
377 self
.sign
= base
.sign
382 return self
.func
+ '(' + str(self
.base
) + ')'
384 def str_extract(self
):
385 return self
.func
+ '(' + self
.base
.str_extract() + ')'
387 def __eq__(self
, other
):
388 return self
.func
== other
.func
and self
.base
== other
.base
390 def __ne__(self
, other
):
391 return not self
.__eq
__(other
)
396 """Class representing the extracted fields of a format"""
397 def __init__(self
, nm
, flds
):
399 self
.fields
= sorted(flds
)
402 return self
.name
+ ' ' + str(self
.fields
)
404 def struct_name(self
):
405 return 'arg_' + self
.name
407 def output_def(self
):
408 output('typedef struct {\n')
409 for n
in self
.fields
:
410 output(' int ', n
, ';\n')
411 output('} ', self
.struct_name(), ';\n\n')
416 """Common code between instruction formats and instruction patterns"""
417 def __init__(self
, name
, lineno
, base
, fixb
, fixm
, udfm
, fldm
, flds
):
421 self
.fixedbits
= fixb
422 self
.fixedmask
= fixm
423 self
.undefmask
= udfm
424 self
.fieldmask
= fldm
430 r
= r
+ ' ' + self
.base
.name
432 r
= r
+ ' ' + str(self
.fields
)
433 r
= r
+ ' ' + str_match_bits(self
.fixedbits
, self
.fixedmask
)
437 return str_indent(i
) + self
.__str
__()
441 class Format(General
):
442 """Class representing an instruction format"""
444 def extract_name(self
):
445 return 'extract_' + self
.name
447 def output_extract(self
):
448 output('static void ', self
.extract_name(), '(',
449 self
.base
.struct_name(), ' *a, ', insntype
, ' insn)\n{\n')
450 for n
, f
in self
.fields
.items():
451 output(' a->', n
, ' = ', f
.str_extract(), ';\n')
456 class Pattern(General
):
457 """Class representing an instruction pattern"""
459 def output_decl(self
):
460 global translate_scope
461 global translate_prefix
462 output('typedef ', self
.base
.base
.struct_name(),
463 ' arg_', self
.name
, ';\n')
464 output(translate_scope
, 'void ', translate_prefix
, '_', self
.name
,
465 '(DisasContext *ctx, arg_', self
.name
,
466 ' *a, ', insntype
, ' insn);\n')
468 def output_code(self
, i
, extracted
, outerbits
, outermask
):
469 global translate_prefix
471 arg
= self
.base
.base
.name
472 output(ind
, '/* line ', str(self
.lineno
), ' */\n')
474 output(ind
, self
.base
.extract_name(), '(&u.f_', arg
, ', insn);\n')
475 for n
, f
in self
.fields
.items():
476 output(ind
, 'u.f_', arg
, '.', n
, ' = ', f
.str_extract(), ';\n')
477 output(ind
, translate_prefix
, '_', self
.name
,
478 '(ctx, &u.f_', arg
, ', insn);\n')
479 output(ind
, 'return true;\n')
483 def parse_field(lineno
, name
, toks
):
484 """Parse one instruction field from TOKS at LINENO"""
489 # A "simple" field will have only one entry;
490 # a "multifield" will have several.
495 if re_fullmatch('!function=' + re_ident
, t
):
497 error(lineno
, 'duplicate function')
502 if re_fullmatch('[0-9]+:s[0-9]+', t
):
503 # Signed field extract
504 subtoks
= t
.split(':s')
506 elif re_fullmatch('[0-9]+:[0-9]+', t
):
507 # Unsigned field extract
508 subtoks
= t
.split(':')
511 error(lineno
, 'invalid field token "{0}"'.format(t
))
514 if po
+ le
> insnwidth
:
515 error(lineno
, 'field {0} too large'.format(t
))
516 f
= Field(sign
, po
, le
)
520 if width
> insnwidth
:
521 error(lineno
, 'field too large')
528 error(lineno
, 'field components overlap')
530 f
= MultiField(subs
, mask
)
532 f
= FunctionField(func
, f
)
535 error(lineno
, 'duplicate field', name
)
540 def parse_arguments(lineno
, name
, toks
):
541 """Parse one argument set from TOKS at LINENO"""
547 if not re_fullmatch(re_ident
, t
):
548 error(lineno
, 'invalid argument set token "{0}"'.format(t
))
550 error(lineno
, 'duplicate argument "{0}"'.format(t
))
553 if name
in arguments
:
554 error(lineno
, 'duplicate argument set', name
)
555 arguments
[name
] = Arguments(name
, flds
)
556 # end parse_arguments
559 def lookup_field(lineno
, name
):
563 error(lineno
, 'undefined field', name
)
566 def add_field(lineno
, flds
, new_name
, f
):
568 error(lineno
, 'duplicate field', new_name
)
573 def add_field_byname(lineno
, flds
, new_name
, old_name
):
574 return add_field(lineno
, flds
, new_name
, lookup_field(lineno
, old_name
))
577 def infer_argument_set(flds
):
580 for arg
in arguments
.values():
581 if eq_fields_for_args(flds
, arg
.fields
):
584 name
= str(len(arguments
))
585 arg
= Arguments(name
, flds
.keys())
586 arguments
[name
] = arg
590 def infer_format(arg
, fieldmask
, flds
):
596 for n
, c
in flds
.items():
602 # Look for an existing format with the same argument set and fields
603 for fmt
in formats
.values():
604 if arg
and fmt
.base
!= arg
:
606 if fieldmask
!= fmt
.fieldmask
:
608 if not eq_fields_for_fmts(flds
, fmt
.fields
):
610 return (fmt
, const_flds
)
612 name
= 'Fmt_' + str(len(formats
))
614 arg
= infer_argument_set(flds
)
616 fmt
= Format(name
, 0, arg
, 0, 0, 0, fieldmask
, var_flds
)
619 return (fmt
, const_flds
)
623 def parse_generic(lineno
, is_format
, name
, toks
):
624 """Parse one instruction format from TOKS at LINENO"""
641 # '&Foo' gives a format an explcit argument set.
645 error(lineno
, 'multiple argument sets')
649 error(lineno
, 'undefined argument set', t
)
652 # '@Foo' gives a pattern an explicit format.
656 error(lineno
, 'multiple formats')
660 error(lineno
, 'undefined format', t
)
663 # '%Foo' imports a field.
666 flds
= add_field_byname(lineno
, flds
, tt
, tt
)
669 # 'Foo=%Bar' imports a field with a different name.
670 if re_fullmatch(re_ident
+ '=%' + re_ident
, t
):
671 (fname
, iname
) = t
.split('=%')
672 flds
= add_field_byname(lineno
, flds
, fname
, iname
)
675 # 'Foo=number' sets an argument field to a constant value
676 if re_fullmatch(re_ident
+ '=[0-9]+', t
):
677 (fname
, value
) = t
.split('=')
679 flds
= add_field(lineno
, flds
, fname
, ConstField(value
))
682 # Pattern of 0s, 1s, dots and dashes indicate required zeros,
683 # required ones, or dont-cares.
684 if re_fullmatch('[01.-]+', t
):
686 fms
= t
.replace('0', '1')
687 fms
= fms
.replace('.', '0')
688 fms
= fms
.replace('-', '0')
689 fbs
= t
.replace('.', '0')
690 fbs
= fbs
.replace('-', '0')
691 ubm
= t
.replace('1', '0')
692 ubm
= ubm
.replace('.', '0')
693 ubm
= ubm
.replace('-', '1')
697 fixedbits
= (fixedbits
<< shift
) | fbs
698 fixedmask
= (fixedmask
<< shift
) | fms
699 undefmask
= (undefmask
<< shift
) | ubm
700 # Otherwise, fieldname:fieldwidth
701 elif re_fullmatch(re_ident
+ ':s?[0-9]+', t
):
702 (fname
, flen
) = t
.split(':')
707 shift
= int(flen
, 10)
708 f
= Field(sign
, insnwidth
- width
- shift
, shift
)
709 flds
= add_field(lineno
, flds
, fname
, f
)
714 error(lineno
, 'invalid token "{0}"'.format(t
))
717 # We should have filled in all of the bits of the instruction.
718 if not (is_format
and width
== 0) and width
!= insnwidth
:
719 error(lineno
, 'definition has {0} bits'.format(width
))
721 # Do not check for fields overlaping fields; one valid usage
722 # is to be able to duplicate fields via import.
724 for f
in flds
.values():
727 # Fix up what we've parsed to match either a format or a pattern.
729 # Formats cannot reference formats.
731 error(lineno
, 'format referencing format')
732 # If an argument set is given, then there should be no fields
733 # without a place to store it.
735 for f
in flds
.keys():
736 if f
not in arg
.fields
:
737 error(lineno
, 'field {0} not in argument set {1}'
738 .format(f
, arg
.name
))
740 arg
= infer_argument_set(flds
)
742 error(lineno
, 'duplicate format name', name
)
743 fmt
= Format(name
, lineno
, arg
, fixedbits
, fixedmask
,
744 undefmask
, fieldmask
, flds
)
747 # Patterns can reference a format ...
749 # ... but not an argument simultaneously
751 error(lineno
, 'pattern specifies both format and argument set')
752 if fixedmask
& fmt
.fixedmask
:
753 error(lineno
, 'pattern fixed bits overlap format fixed bits')
754 fieldmask |
= fmt
.fieldmask
755 fixedbits |
= fmt
.fixedbits
756 fixedmask |
= fmt
.fixedmask
757 undefmask |
= fmt
.undefmask
759 (fmt
, flds
) = infer_format(arg
, fieldmask
, flds
)
761 for f
in flds
.keys():
762 if f
not in arg
.fields
:
763 error(lineno
, 'field {0} not in argument set {1}'
764 .format(f
, arg
.name
))
765 if f
in fmt
.fields
.keys():
766 error(lineno
, 'field {0} set by format and pattern'.format(f
))
768 if f
not in flds
.keys() and f
not in fmt
.fields
.keys():
769 error(lineno
, 'field {0} not initialized'.format(f
))
770 pat
= Pattern(name
, lineno
, fmt
, fixedbits
, fixedmask
,
771 undefmask
, fieldmask
, flds
)
774 # Validate the masks that we have assembled.
775 if fieldmask
& fixedmask
:
776 error(lineno
, 'fieldmask overlaps fixedmask (0x{0:08x} & 0x{1:08x})'
777 .format(fieldmask
, fixedmask
))
778 if fieldmask
& undefmask
:
779 error(lineno
, 'fieldmask overlaps undefmask (0x{0:08x} & 0x{1:08x})'
780 .format(fieldmask
, undefmask
))
781 if fixedmask
& undefmask
:
782 error(lineno
, 'fixedmask overlaps undefmask (0x{0:08x} & 0x{1:08x})'
783 .format(fixedmask
, undefmask
))
785 allbits
= fieldmask | fixedmask | undefmask
786 if allbits
!= insnmask
:
787 error(lineno
, 'bits left unspecified (0x{0:08x})'
788 .format(allbits ^ insnmask
))
793 """Parse all of the patterns within a file"""
795 # Read all of the lines of the file. Concatenate lines
796 # ending in backslash; discard empty lines and comments.
809 # Next line after continuation
823 error(lineno
, 'short line')
828 # Determine the type of object needing to be parsed.
830 parse_field(lineno
, name
[1:], toks
)
832 parse_arguments(lineno
, name
[1:], toks
)
834 parse_generic(lineno
, True, name
[1:], toks
)
836 parse_generic(lineno
, False, name
, toks
)
842 """Class representing a node in a decode tree"""
844 def __init__(self
, fm
, tm
):
852 r
= '{0}{1:08x}'.format(ind
, self
.fixedmask
)
854 r
+= ' ' + self
.format
.name
856 for (b
, s
) in self
.subs
:
857 r
+= '{0} {1:08x}:\n'.format(ind
, b
)
858 r
+= s
.str1(i
+ 4) + '\n'
865 def output_code(self
, i
, extracted
, outerbits
, outermask
):
868 # If we identified all nodes below have the same format,
869 # extract the fields now.
870 if not extracted
and self
.base
:
871 output(ind
, self
.base
.extract_name(),
872 '(&u.f_', self
.base
.base
.name
, ', insn);\n')
875 # Attempt to aid the compiler in producing compact switch statements.
876 # If the bits in the mask are contiguous, extract them.
877 sh
= is_contiguous(self
.thismask
)
879 # Propagate SH down into the local functions.
880 def str_switch(b
, sh
=sh
):
881 return '(insn >> {0}) & 0x{1:x}'.format(sh
, b
>> sh
)
883 def str_case(b
, sh
=sh
):
884 return '0x{0:x}'.format(b
>> sh
)
887 return 'insn & 0x{0:08x}'.format(b
)
890 return '0x{0:08x}'.format(b
)
892 output(ind
, 'switch (', str_switch(self
.thismask
), ') {\n')
893 for b
, s
in sorted(self
.subs
):
894 assert (self
.thismask
& ~s
.fixedmask
) == 0
895 innermask
= outermask | self
.thismask
896 innerbits
= outerbits | b
897 output(ind
, 'case ', str_case(b
), ':\n')
899 str_match_bits(innerbits
, innermask
), ' */\n')
900 s
.output_code(i
+ 4, extracted
, innerbits
, innermask
)
902 output(ind
, 'return false;\n')
906 def build_tree(pats
, outerbits
, outermask
):
907 # Find the intersection of all remaining fixedmask.
908 innermask
= ~outermask
910 innermask
&= i
.fixedmask
915 pnames
.append(p
.name
+ ':' + str(p
.lineno
))
916 error(pats
[0].lineno
, 'overlapping patterns:', pnames
)
918 fullmask
= outermask | innermask
920 # Sort each element of pats into the bin selected by the mask.
923 fb
= i
.fixedbits
& innermask
929 # We must recurse if any bin has more than one element or if
930 # the single element in the bin has not been fully matched.
931 t
= Tree(fullmask
, innermask
)
933 for b
, l
in bins
.items():
935 if len(l
) > 1 or s
.fixedmask
& ~fullmask
!= 0:
936 s
= build_tree(l
, b | outerbits
, fullmask
)
937 t
.subs
.append((b
, s
))
943 def prop_format(tree
):
944 """Propagate Format objects into the decode tree"""
946 # Depth first search.
947 for (b
, s
) in tree
.subs
:
948 if isinstance(s
, Tree
):
951 # If all entries in SUBS have the same format, then
952 # propagate that into the tree.
954 for (b
, s
) in tree
.subs
:
969 global translate_scope
970 global translate_prefix
977 decode_function
= 'decode'
978 decode_scope
= 'static '
980 long_opts
= ['decode=', 'translate=', 'output=', 'insnwidth=']
982 (opts
, args
) = getopt
.getopt(sys
.argv
[1:], 'o:w:', long_opts
)
983 except getopt
.GetoptError
as err
:
986 if o
in ('-o', '--output'):
988 elif o
== '--decode':
991 elif o
== '--translate':
994 elif o
in ('-w', '--insnwidth'):
997 insntype
= 'uint16_t'
999 elif insnwidth
!= 32:
1000 error(0, 'cannot handle insns of width', insnwidth
)
1002 assert False, 'unhandled option'
1005 error(0, 'missing input file')
1006 input_file
= args
[0]
1007 f
= open(input_file
, 'r')
1011 t
= build_tree(patterns
, 0, 0)
1015 output_fd
= open(output_file
, 'w')
1017 output_fd
= sys
.stdout
1020 for n
in sorted(arguments
.keys()):
1024 # A single translate function can be invoked for different patterns.
1025 # Make sure that the argument sets are the same, and declare the
1026 # function only once.
1029 if i
.name
in out_pats
:
1030 p
= out_pats
[i
.name
]
1031 if i
.base
.base
!= p
.base
.base
:
1032 error(0, i
.name
, ' has conflicting argument sets')
1035 out_pats
[i
.name
] = i
1038 for n
in sorted(formats
.keys()):
1042 output(decode_scope
, 'bool ', decode_function
,
1043 '(DisasContext *ctx, ', insntype
, ' insn)\n{\n')
1046 output(i4
, 'union {\n')
1047 for n
in sorted(arguments
.keys()):
1049 output(i4
, i4
, f
.struct_name(), ' f_', f
.name
, ';\n')
1050 output(i4
, '} u;\n\n')
1052 t
.output_code(4, False, 0, 0)
1061 if __name__
== '__main__':