Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2611.mcz==================== Summary ====================
Name: VMMaker.oscog-eem.2611
Author: eem
Time: 13 December 2019, 6:33:49.577684 pm
UUID: 567f0d02-9d72-4fb4-b2c1-13cba6fc2230
Ancestors: VMMaker.oscog-eem.2610
Fix a couple of errors in printFormatForOpcodeName:.
There are more "exit" cases: Add, And, Or.
The correct format for X?rR is #($r $r $r).
=============== Diff against VMMaker.oscog-eem.2610 ===============
Item was changed:
----- Method: CogRTLOpcodes class>>printFormatForOpcodeName: (in category 'debug printing') -----
printFormatForOpcodeName: opcodeName
"Answer a sequence of $r, $f or nil for the operands in the opcode, used for printing, where
r => integer register, f => floating point register, and nil => numeric or address operand."
| printFormat operands |
printFormat := OrderedCollection new.
operands := opcodeName.
+ [(#(('Ab' nil) ('Aw' nil)
- [(#( ('Ab' nil) ('Aw' nil)
('Cw' nil) ('Cq' nil) ('C32' nil)
(Fill32 nil)
(Label nil) (Literal nil)
('Mb' nil) ('Mw' nil) ('M16' nil) ('M32' nil) ('M64' nil)
('Nops' nil)
('R' $r) ('Rd' $f) ('Rs' $f)
+ ('Xbr' 'rr') ('Xwr' 'rr') ('X16r' 'rr') ('X32r' 'rr') ('X64r' 'rr') ('X' $r) ('ow' nil)
+ ('Add' exit) ('And' exit) ('Or' exit)
- ('Xbr' $r) ('Xwr' $r) ('X16r' $r) ('X32r' $r) ('X64r' $r) ('X' $r) ('ow' nil)
('Greater' exit) ('Xor' exit) ('r' $r))
detect: [:pair| operands endsWith: pair first]
ifNone: [])
ifNil: [false]
ifNotNil:
[:match|
match last ~~ #exit
and: [operands := operands allButLast: match first size.
+ match last isCollection
+ ifTrue: [printFormat addAllFirst: match last]
+ ifFalse: [printFormat addFirst: match last].
- printFormat addFirst: match last.
true]]]
whileTrue.
(printFormat isEmpty and: [(operands beginsWith: 'Jump') or: [operands beginsWith: 'Call']]) ifTrue:
[printFormat addFirst: nil].
^printFormat
+ "classPool keys sort collect: [:k| { k. (self printFormatForOpcodeName: k) asArray}]"
+ "Find all initial opcodes ending with r or d; these must have an exit case"
+ "classPool keys sort select: [:opcode| | idx | (idx := opcode allButFirst findFirst: [:c| c isUppercase]) > 0 and: ['rd' includes: (opcode at: idx)]]"!
- "classPool keys sort collect: [:k| { k. (self printFormatForOpcodeName: k) asArray}]"!