# keys
[[!table data="""
-unit | in | outcnt | CR in | CR out | imm| name |
-LDST | 1 | 1 | 0 | 0 | 1| LDST-1R-1W-imm |
-LDST | 1 | 2 | 0 | 0 | 1| LDST-1R-2W-imm |
-LDST | 2 | 0 | 0 | 0 | 1| LDST-2R-imm |
-LDST | 2 | 1 | 0 | 0 | | LDST-2R-1W |
-LDST | 2 | 1 | 0 | 0 | 1| LDST-2R-1W-imm |
-LDST | 2 | 2 | 0 | 0 | | LDST-2R-2W |
-LDST | 3 | 0 | 0 | 0 | | LDST-3R |
-LDST | 3 | 0 | 0 | 1 | | LDST-3R-CRo |
-LDST | 3 | 1 | 0 | 0 | | LDST-3R-1W |
-OTHER | 0 | 0 | 0 | 0 | | |
-OTHER | 0 | 0 | 0 | 0 | 1| imm |
-OTHER | 0 | 0 | 1 | 0 | | CRi |
-OTHER | 0 | 0 | 1 | 0 | 1| CRi |
-OTHER | 0 | 0 | 1 | 1 | | CRio |
-OTHER | 0 | 1 | 0 | 0 | | 1W |
-OTHER | 0 | 1 | 1 | 0 | | 1W-CRi |
-OTHER | 1 | 0 | 0 | 0 | | 1R |
-OTHER | 1 | 0 | 0 | 0 | 1| 1R-imm |
-OTHER | 1 | 0 | 0 | 1 | 1| 1R-CRo |
-OTHER | 1 | 0 | 1 | 1 | | 1R-CRio |
-OTHER | 1 | 1 | 0 | 0 | | 1R-1W |
-OTHER | 1 | 1 | 0 | 0 | 1| 1R-1W-imm |
-OTHER | 1 | 1 | 0 | 1 | | 1R-1W-CRo |
-OTHER | 1 | 1 | 0 | 1 | 1| 1R-1W-CRo |
-OTHER | 1 | 1 | 1 | 1 | | 1R-1W-CRio |
-OTHER | 2 | 0 | 0 | 0 | | 2R |
-OTHER | 2 | 0 | 0 | 1 | | 2R-CRo |
-OTHER | 2 | 0 | 1 | 1 | | 2R-CRio |
-OTHER | 2 | 1 | 0 | 0 | | 2R-1W |
-OTHER | 2 | 1 | 0 | 1 | | 2R-1W-CRo |
-OTHER | 2 | 1 | 0 | 1 | 1| 2R-1W-CRo |
-OTHER | 2 | 1 | 1 | 0 | | 2R-1W-CRi |
-OTHER | 2 | 1 | 1 | 1 | | 2R-1W-CRio |
-OTHER | 3 | 1 | 1 | 1 | | 3R-1W-CRio |
+unit | in | outcnt | CR in | CR out | imm| imms | name |
+LDST | 1 | 1 | 0 | 0 | 1| SI/DS | LDST-1R-1W-imm |
+LDST | 1 | 2 | 0 | 0 | 1| SI/DS | LDST-1R-2W-imm |
+LDST | 2 | 0 | 0 | 0 | 1| SI/DS | LDST-2R-imm |
+LDST | 2 | 1 | 0 | 0 | | | LDST-2R-1W |
+LDST | 2 | 1 | 0 | 0 | 1| SI/DS | LDST-2R-1W-imm |
+LDST | 2 | 2 | 0 | 0 | | | LDST-2R-2W |
+LDST | 3 | 0 | 0 | 0 | | | LDST-3R |
+LDST | 3 | 0 | 0 | 1 | | | LDST-3R-CRo |
+LDST | 3 | 1 | 0 | 0 | | | LDST-3R-1W |
+OTHER | 0 | 0 | 0 | 0 | | | |
+OTHER | 0 | 0 | 0 | 0 | 1| LI | imm |
+OTHER | 0 | 0 | 1 | 0 | | | CRi |
+OTHER | 0 | 0 | 1 | 0 | 1| BD | CRi |
+OTHER | 0 | 0 | 1 | 1 | | | CRio |
+OTHER | 0 | 1 | 0 | 0 | | | 1W |
+OTHER | 0 | 1 | 1 | 0 | | | 1W-CRi |
+OTHER | 1 | 0 | 0 | 0 | | | 1R |
+OTHER | 1 | 0 | 0 | 0 | 1| SI | 1R-imm |
+OTHER | 1 | 0 | 0 | 1 | 1| SI/UI | 1R-CRo |
+OTHER | 1 | 0 | 1 | 1 | | | 1R-CRio |
+OTHER | 1 | 1 | 0 | 0 | | | 1R-1W |
+OTHER | 1 | 1 | 0 | 0 | 1| SI/UI | 1R-1W-imm |
+OTHER | 1 | 1 | 0 | 1 | | | 1R-1W-CRo |
+OTHER | 1 | 1 | 0 | 1 | 1| M1/SI/SH/UI/SH32 | 1R-1W-CRo |
+OTHER | 1 | 1 | 1 | 1 | | | 1R-1W-CRio |
+OTHER | 2 | 0 | 0 | 0 | | | 2R |
+OTHER | 2 | 0 | 0 | 1 | | | 2R-CRo |
+OTHER | 2 | 0 | 1 | 1 | | | 2R-CRio |
+OTHER | 2 | 1 | 0 | 0 | | | 2R-1W |
+OTHER | 2 | 1 | 0 | 1 | | | 2R-1W-CRo |
+OTHER | 2 | 1 | 0 | 1 | 1| SH/SH32 | 2R-1W-CRo |
+OTHER | 2 | 1 | 1 | 0 | | | 2R-1W-CRi |
+OTHER | 2 | 1 | 1 | 1 | | | 2R-1W-CRio |
+OTHER | 3 | 1 | 1 | 1 | | | 3R-1W-CRio |
"""]]
## LDST-1R-1W-imm (I)
bykey = {}
primarykeys = set()
dictkeys = OrderedDict()
+ immediates = {}
print ("# OpenPOWER ISA register 'profile's")
print ('')
bykey[key].append((csvname, row['opcode'], row['comment'],
row['form'].upper() + '-Form'))
+ # detect immediates, collate them (useful info)
+ if row['in2'].startswith('CONST_'):
+ imm = row['in2'].split("_")[1]
+ if key not in immediates:
+ immediates[key] = set()
+ immediates[key].add(imm)
+
primarykeys = list(primarykeys)
primarykeys.sort()
print ("# keys")
print ('')
print ('[[!table data="""')
- print (tformat(tablecols) + " name |")
+ print (tformat(tablecols) + " imms | name |")
for key in primarykeys:
name = keyname(dictkeys[key])
- print (tformat(dictkeys[key].values()) + " %s |" % name)
+ row = tformat(dictkeys[key].values())
+ row += " %s | " % ("/".join(list(immediates.get(key, ""))))
+ row += " %s |" % name
+ print (row)
print ('"""]]')
print ('')