When trying to put multiple replacement patterns of the same type, e.g., <imm>, into an instruction pattern it is required to start the numbering at 0.
Works:
class mul(OTBNInstruction):
pattern = "mul <Wd>, <Wa>.<imm0>, <Wb>.<imm1>, <imm2>"
inputs = ["Wa", "Wb"]
outputs = ["Wd", "FGa"]
Does not work:
class mul(OTBNInstruction):
pattern = "mul <Wd>, <Wa>.<imm1>, <Wb>.<imm2>, <imm3>"
inputs = ["Wa", "Wb"]
outputs = ["Wd", "FGa"]
class mul(OTBNInstruction):
pattern = "mul <Wd>, <Wa>.<imm>, <Wb>.<imm>, <imm>"
inputs = ["Wa", "Wb"]
outputs = ["Wd", "FGa"]
At least this should be documented somewhere.