-op, rfc, priority, cost, SVP64, group, PO1, page, regs, Level
+op, rfc, priority, cost, SVP64, group, PO1, page, regs, level
# LD/ST-Postincrement
lbzup, ls011, high, PO, yes, EXT2xx, no, isa/pifixedload, 1R2W, SFFS
lbzupx, ls011, high, 10, yes, EXT2xx, no, isa/pifixedload, 2R2W, SFFS
fmvis, ls002, high, 5, yes, TBD, no, sv/bitmanip, 1W, SFFS
fishmv, ls002, high, 5, yes, TBD, no, sv/bitmanip, 1R1W, SFFS
# Shift-and-Add (mitigates LD-ST-Shift; Cryptography e.g. twofish)
-shadd, ls003, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS
-shadduw, ls003, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS
-shaddw, ls003, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS
+shadd, ls004, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS
+shadduw, ls004, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS
+shaddw, ls004, med, 7, yes, TBD, no, sv/bitmanip, 2R1W1w, SFFS
# Audio-Video
absdu, TBD, TBD, 10, yes, TBD, no, sv/av_opcodes, 2R1W1w, SV/D
avgadd, TBD, TBD, 10, yes, TBD, no, sv/av_opcodes, 2R1W1w, SV/D
return 1
return 0
+levels = ['SFFS', 'SV/E', 'SV/D', 'SV/S', 'opt']
+
+def sort_by_level(p1, p2):
+ p1 = levels.index(p1['level'])
+ p2 = levels.index(p2['level'])
+ if p1 < p2: return -1
+ if p1 > p2: return 1
+ return 0
+
priorities = ['high', 'med', 'low', 'TBD']
def sort_by_priority(p1, p2):
if p1 > p2: return 1
return 0
+def sort_by_level_priority_cost(p1, p2):
+ v = sort_by_level(p1, p2)
+ if v == 0:
+ v = sort_by_priority(p1, p2)
+ if v == 0:
+ v = sort_by_cost(p1, p2)
+ return v
+
+
def sort_by_cost_priority_page(p1, p2):
v = sort_by_cost(p1, p2)
if v == 0:
return v
+def by_levelpriority_then_cost(areas):
+ # first blat all columns together (drop area-dict)
+ res = []
+ for row in areas.values():
+ res += row
+ # now sort them
+ res = sorted(res, key=functools.cmp_to_key(sort_by_level_priority_cost))
+ # now split out into a dict again this time by cost-priority
+ levels = {}
+ for row in res:
+ key = row['level']+row['priority']
+ if key not in levels:
+ levels[key] = []
+ levels[key].append(row)
+ return levels
+
+
def by_cost_then_priority_then_page(areas):
# first blat all columns together (drop area-dict)
res = []
# now sort by cost and then by page
print_table("XO cost", header, areas, by_cost_then_priority_then_page)
+ # now sort by level combined with priority, then cost
+ print_table("Level", header, areas, by_levelpriority_then_cost)
+