[PATCH] D22050: [SystemZ] Add support for missing instructions

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 11:09:47 PDT 2016

uweigand added a comment.

See inline comments.

Also, when adding new instructions, you need to add disassembler tests as well (test/MC/Disassembler/SystemZ).

It would be nice to add not just single instructions you find missing somewhere, but full related groups of instructions where it makes sense.  For example, when adding EX, it might be nice to also add EXRL.  Similarly, when adding ICM(Y), it would be nice to also add ICMH, and possibly even STCM(Y/H) and CLCM(Y/H) as well.  (To be clear: this is just a suggestion, not a requirement.)

Comment at: lib/Target/SystemZ/SystemZInstrInfo.td:706
@@ -705,1 +705,3 @@
+def LM : LoadMultipleRS<"lm", 0x98, GR32>;
+def LMY : LoadMultipleRSY<"lmy", 0xEB98, GR32>;
 def LMG : LoadMultipleRSY<"lmg", 0xEB04, GR64>;
This should use a *Pair pattern like all other "y" instructions.

Comment at: lib/Target/SystemZ/SystemZInstrInfo.td:711
@@ -708,1 +710,3 @@
+def STM : StoreMultipleRS<"stm", 0x90, GR32>;
+def STMY : StoreMultipleRSY<"stmy", 0xEB90, GR32>;
 def STMG : StoreMultipleRSY<"stmg", 0xEB24, GR64>;

Comment at: lib/Target/SystemZ/SystemZInstrInfo.td:825
@@ +824,3 @@
+  def ICMY : InstRSY<0xEB81, (outs GR32:$R1), (ins imm32zx4:$R3, bdaddr20only:$BD2),
+                     "icmy\t$R1, $R3, $BD2", []>;
Please create a new TernaryRSPair for those (implemented similarly to TernaryRXF).

Comment at: lib/Target/SystemZ/SystemZInstrInfo.td:1381
@@ +1380,3 @@
+    def TML : CompareRI<"tml", 0xA71, z_tm_reg, GR32, imm32ll16>;
+    def TMH : CompareRI<"tmh", 0xA70, z_tm_reg, GR32, imm32lh16>;
+  }
These are just aliases for TMLL/TMLH, so it should be enough to define those via InstAlias.

Comment at: lib/Target/SystemZ/SystemZInstrInfo.td:1672
@@ -1651,1 +1671,3 @@
+                  "ex\t$R1, $XBD2", []>;
Don't need the { } for a single statement here.


More information about the llvm-commits mailing list