e_clone.name = e.name
entrypoints[e.name] = e_clone
- return [e for e in entrypoints.itervalues() if e.enabled]
+ return [e for e in entrypoints.values() if e.enabled]
def get_entrypoints_defines(doc):
#endif
-% for (opcode, xform_list) in xform_dict.iteritems():
+% for (opcode, xform_list) in xform_dict.items():
% for xform in xform_list:
${xform.search.render()}
${xform.replace.render()}
return ', '.join('src' + str(i) if i < num_srcs else 'NULL' for i in range(4))
%>
-% for name, opcode in sorted(opcodes.iteritems()):
+% for name, opcode in sorted(opcodes.items()):
static inline nir_ssa_def *
nir_${name}(nir_builder *build, ${src_decl_list(opcode.num_inputs)})
{
return &load->dest.ssa;
}
-% for name, opcode in filter(lambda v: v[1].sysval, sorted(INTR_OPCODES.iteritems())):
+% for name, opcode in filter(lambda v: v[1].sysval, sorted(INTR_OPCODES.items())):
static inline nir_ssa_def *
nir_${name}(nir_builder *build)
{
% endif
</%def>
-% for name, op in sorted(opcodes.iteritems()):
+% for name, op in sorted(opcodes.items()):
static nir_const_value
evaluate_${name}(MAYBE_UNUSED unsigned num_components,
${"UNUSED" if op_bit_sizes(op) is None else ""} unsigned bit_size,
unsigned bit_width, nir_const_value *src)
{
switch (op) {
-% for name in sorted(opcodes.iterkeys()):
+% for name in sorted(opcodes.keys()):
case nir_op_${name}:
return evaluate_${name}(num_components, bit_width, src);
% endfor
#include "nir.h"
const nir_intrinsic_info nir_intrinsic_infos[nir_num_intrinsics] = {
-% for name, opcode in sorted(INTR_OPCODES.iteritems()):
+% for name, opcode in sorted(INTR_OPCODES.items()):
{
.name = "${name}",
.num_srcs = ${opcode.num_srcs},
}
const nir_op_info nir_op_infos[nir_num_opcodes] = {
-% for name, opcode in sorted(opcodes.iteritems()):
+% for name, opcode in sorted(opcodes.items()):
{
.name = "${name}",
.num_inputs = ${opcode.num_inputs},
#ifndef _NIR_OPCODES_
#define _NIR_OPCODES_
-<% opcode_names = sorted(opcodes.iterkeys()) %>
+<% opcode_names = sorted(opcodes.keys()) %>
typedef enum {
% for name in opcode_names:
#ifdef __cplusplus
extern "C" {
#endif
-% for _, container in sorted(containers.iteritems(), key=itemgetter(0)):
+% for _, container in sorted(containers.items(), key=itemgetter(0)):
/* ${container.name} */
${emit_per_gen_prop_func(container, 'length')}
-% for _, field in sorted(container.fields.iteritems(), key=itemgetter(0)):
+% for _, field in sorted(container.fields.items(), key=itemgetter(0)):
/* ${container.name}::${field.name} */
def iter_prop(self, prop):
if prop == 'length':
- return self.length_by_gen.iteritems()
+ return self.length_by_gen.items()
else:
raise ValueError('Invalid property: "{0}"'.format(prop))
def iter_prop(self, prop):
if prop == 'bits':
- return self.bits_by_gen.iteritems()
+ return self.bits_by_gen.items()
elif prop == 'start':
- return self.start_by_gen.iteritems()
+ return self.start_by_gen.items()
else:
raise ValueError('Invalid property: "{0}"'.format(prop))
assert e.core_version is None
e.extensions.append(ext)
- return [e for e in entrypoints.itervalues() if e.enabled]
+ return [e for e in entrypoints.values() if e.enabled]
def get_entrypoints_defines(doc):
versions.
"""
result = []
- for entry_point, api_to_ver in self.entry_point_api_map.iteritems():
+ for entry_point, api_to_ver in self.entry_point_api_map.items():
if api not in api_to_ver:
continue
if version is not None and version < api_to_ver[api]:
def filter_functions(self, entry_point_list):
"""Filter out entry points not in entry_point_list."""
functions_by_name = {}
- for func in self.functions_by_name.itervalues():
+ for func in self.functions_by_name.values():
entry_points = [ent for ent in func.entry_points if ent in entry_point_list]
if entry_points:
func.filter_entry_points(entry_points)
optionally, not in the given version of the given API).
"""
functions_by_name = {}
- for func in self.functions_by_name.itervalues():
+ for func in self.functions_by_name.values():
entry_points = func.entry_points_for_api_version(api, version)
if entry_points:
func.filter_entry_points(entry_points)
def functionIterateByOffset(self):
max_offset = -1
- for func in self.functions_by_name.itervalues():
+ for func in self.functions_by_name.values():
if func.offset > max_offset:
max_offset = func.offset
temp = [None for i in range(0, max_offset + 1)]
- for func in self.functions_by_name.itervalues():
+ for func in self.functions_by_name.values():
if func.offset != -1:
temp[ func.offset ] = func
def functionIterateAll(self):
- return self.functions_by_name.itervalues()
+ return self.functions_by_name.values()
def enumIterateByName(self):
def typeIterate(self):
- return self.types_by_name.itervalues()
+ return self.types_by_name.values()
def find_type( self, type_name ):
# Determine how many functions have a defined offset.
func_count = 0
- for f in api.functions_by_name.itervalues():
+ for f in api.functions_by_name.values():
if f.offset != -1:
func_count += 1
# Build the mapping from offset to function name.
funcnames = [None] * func_count
- for f in api.functions_by_name.itervalues():
+ for f in api.functions_by_name.values():
if f.offset != -1:
if not (funcnames[f.offset] is None):
raise Exception("Function table has more than one function with same offset (offset %d, func %s)" % (f.offset, f.name))
c("\n")
register_lengths = compute_register_lengths(set);
- for reg_type, reg_length in register_lengths.iteritems():
+ for reg_type, reg_length in register_lengths.items():
c("static struct brw_perf_query_register_prog {0}_{1}_{2}[{3}];".format(gen.chipset,
set.underscore_name,
reg_type, reg_length))
.c_offset = 46,
"""))
- for reg_type, reg_length in register_lengths.iteritems():
+ for reg_type, reg_length in register_lengths.items():
c(".{0} = {1}_{2}_{3},".format(reg_type, gen.chipset, set.underscore_name, reg_type))
c(".n_{0} = 0, /* Determined at runtime */".format(reg_type))