mirror of
https://github.com/RPCSX/xed.git
synced 2026-01-31 01:05:17 +01:00
more replacing of map(str with list comprehension
Change-Id: I0b3832f5e30c35927c46d177b7b3b13692c6d306 (cherry picked from commit 34c9f848802827bf4699c06b97a732ef79875218)
This commit is contained in:
@@ -224,7 +224,7 @@ class flags_rec_t(object):
|
||||
s.append(self.qualifier)
|
||||
s.append(self.may_must)
|
||||
s.append('[')
|
||||
s.extend(map(str,self.flag_actions))
|
||||
s.extend([str(x) for x in self.flag_actions])
|
||||
s.append(']')
|
||||
return ' '.join(s)
|
||||
|
||||
@@ -302,7 +302,7 @@ class flags_info_t(object):
|
||||
return self.complex_id
|
||||
|
||||
def __str__(self):
|
||||
s = ', '.join(map(str,self.flags_recs))
|
||||
s = ', '.join( [str(x) for x in self.flags_recs] )
|
||||
return s
|
||||
|
||||
def x87_flags(self):
|
||||
|
||||
@@ -708,7 +708,7 @@ class prebinding_t(object):
|
||||
def __str__(self):
|
||||
s = []
|
||||
s.append(self.field_name)
|
||||
s.extend(map(str,self.bit_info_list))
|
||||
s.extend( [str(x) for x in self.bit_info_list ] )
|
||||
return ', '.join(s)
|
||||
|
||||
def get_btype(b):
|
||||
@@ -1418,7 +1418,7 @@ class instruction_info_t(partitionable_info_t):
|
||||
return ''.join(s)
|
||||
if self.prebindings:
|
||||
s.append('prebindings: \n\t' +
|
||||
'\n\t'.join(map(str,list(self.prebindings.values()))) + '\n')
|
||||
'\n\t'.join( [str(x) for x in list(self.prebindings.values())]) + '\n')
|
||||
for op in self.operands:
|
||||
s.append(pad)
|
||||
s.append(" ")
|
||||
@@ -2034,19 +2034,19 @@ def partition_by_required_values(options, instructions, bitpos, token,
|
||||
osf = operand_storage_dict[operand_decider.token]
|
||||
if osf.ctype.find('enum') == -1:
|
||||
nvalues = 1 << int(osf.bitwidth)
|
||||
#all_values_for_this_od = map(str,range(0,nvalues))
|
||||
#all_values_for_this_od = [ str(x) for x in range(0,nvalues) ]
|
||||
all_values_for_this_od = range(0,nvalues)
|
||||
if vod():
|
||||
msge("Synthesized values for %s: %s" %
|
||||
( operand_decider.token,
|
||||
", ".join(map(str,all_values_for_this_od))))
|
||||
", ".join( [ str(x) for x in all_values_for_this_od])))
|
||||
except:
|
||||
die("could not find %s in state space dictionary" %
|
||||
(operand_decider.token))
|
||||
|
||||
if vod():
|
||||
msge("All values for OD: %s" %
|
||||
", ".join(map(str,all_values_for_this_od)))
|
||||
", ".join( [ str(x) for x in all_values_for_this_od] ))
|
||||
for a in all_values_for_this_od:
|
||||
all_values[a]=True
|
||||
trimmed_vals = list(filter(lambda x: x != operand_decider.requirement,
|
||||
|
||||
@@ -230,7 +230,7 @@ def hex_to_binary(x):
|
||||
return decimal_to_binary(i)
|
||||
|
||||
def stringify_list(lst):
|
||||
return ' '.join(map(str,lst))
|
||||
return ' '.join([ str(x) for x in lst])
|
||||
|
||||
def round_up_power_of_two(x):
|
||||
lg = math.ceil(math.log(x,2))
|
||||
|
||||
@@ -259,7 +259,7 @@ def _replace_RM_with_RM4(cnames, ptrn_list):
|
||||
cnames.add(_rm_token_4)
|
||||
for ptrn in ptrn_list:
|
||||
found = False
|
||||
#print "PATTERN BITS", "\t\n".join(map(str,ptrn.ii.ipattern.bits))
|
||||
#print "PATTERN BITS", "\t\n".join( [str(x) for x in ptrn.ii.ipattern.bits])
|
||||
for bt in ptrn.ii.ipattern.bits:
|
||||
if bt.token == _rm_token:
|
||||
if bt.test == 'eq':
|
||||
@@ -268,7 +268,7 @@ def _replace_RM_with_RM4(cnames, ptrn_list):
|
||||
break
|
||||
if not found:
|
||||
#print "X", str(cnames)
|
||||
#print "\t\n".join(map(str,ptrn_list))
|
||||
#print "\t\n".join( [ str(x) for x in ptrn_list] )
|
||||
ptrn.constraints[_rm_token_4] = {0:True, 1:True}
|
||||
|
||||
#FIXME: probably should move this one to layers
|
||||
|
||||
@@ -292,8 +292,6 @@ class l1_phash_t(phash_t):
|
||||
# legal ordinal starts at 1
|
||||
self.cdict.tuple2rule[t].index = hash_val + 1
|
||||
|
||||
#for key sequence postprocessing analysis
|
||||
#sys.stderr.write("KEYS:" + " ".join(map(str,sorted(self.x2hx.keys()))) + '\n')
|
||||
|
||||
def __str__(self):
|
||||
lines = ['-----------1-LEVEL-PHASH-------------']
|
||||
|
||||
@@ -197,7 +197,7 @@ class operand_info_t(object):
|
||||
s.append("MULTIREG{}".format(self.multireg))
|
||||
|
||||
if self.bit_positions:
|
||||
s.append(' bitpos: ' + ', '.join(map(str,self.bit_positions)))
|
||||
s.append(' bitpos: ' + ', '.join( [str(x) for x in self.bit_positions] ))
|
||||
|
||||
if self.invert:
|
||||
s.append('invert')
|
||||
|
||||
@@ -579,7 +579,7 @@ class conditions_t(object):
|
||||
generation (emit actions), by searching the conditions to see
|
||||
which ones are captures"""
|
||||
if vcapture():
|
||||
msgb("CAPTURE COLLECTION USING:\n\t%s\n" % "\n\t".join(map(str,clist)))
|
||||
msgb("CAPTURE COLLECTION USING:\n\t%s\n" % "\n\t".join( [ str(x) for x in clist] ))
|
||||
full_captures = list(filter(lambda x: x.is_bit_capture(), clist))
|
||||
captures = [ x.capture_info() for x in full_captures]
|
||||
return captures
|
||||
@@ -1009,7 +1009,7 @@ class rule_t(object):
|
||||
list_of_tuples = self.compute_field_capture_list()
|
||||
|
||||
if vtuples():
|
||||
msgb("TUPLES", (" ,".join(map(str, list_of_tuples))))
|
||||
msgb("TUPLES", (" ,".join( [str(x) for x in list_of_tuples] )))
|
||||
if len(list_of_tuples) == 0 or a.emit_type == 'numeric':
|
||||
# no substitutions required
|
||||
(length, s) = self.prepare_value_for_emit(a)
|
||||
@@ -2179,7 +2179,7 @@ class encoder_configuration_t(object):
|
||||
# decode-patterns are encode-actions [blot_t],
|
||||
# modal-patterns that become encode-conditions [string])
|
||||
|
||||
#msgerr("OPERANDS %s" % ' '.join(map(str,operands)))
|
||||
#msgerr("OPERANDS %s" % ' '.join( [str(x) for x in operands]))
|
||||
return (operands, patterns, modal_patterns)
|
||||
|
||||
def print_iclass_info(self,iclass, operands, ipattern, conditions,
|
||||
|
||||
Reference in New Issue
Block a user