[llvm] c084921 - [SystemZ] Use the same PatFrag for all "insert imm" fragments (NFC) (#119962)

via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 09:22:03 PST 2024


Author: Sergei Barannikov
Date: 2024-12-14T20:22:00+03:00
New Revision: c0849218c43db152259a349aee130eda51057e4e

URL: https://github.com/llvm/llvm-project/commit/c0849218c43db152259a349aee130eda51057e4e
DIFF: https://github.com/llvm/llvm-project/commit/c0849218c43db152259a349aee130eda51057e4e.diff

LOG: [SystemZ] Use the same PatFrag for all "insert imm" fragments (NFC) (#119962)

Added: 
    

Modified: 
    llvm/lib/Target/SystemZ/SystemZOperators.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SystemZ/SystemZOperators.td b/llvm/lib/Target/SystemZ/SystemZOperators.td
index 6439c82d26ff5c..15b334b042d2dd 100644
--- a/llvm/lib/Target/SystemZ/SystemZOperators.td
+++ b/llvm/lib/Target/SystemZ/SystemZOperators.td
@@ -757,23 +757,18 @@ defm block_or  : block_op<or>;
 defm block_xor : block_op<xor>;
 
 // Insertions.
-def inserti8 : PatFrag<(ops node:$src1, node:$src2),
-                       (or (and node:$src1, -256), node:$src2)>;
-
-class inserti16<int mask> : PatFrag<(ops node:$src1, node:$src2),
-                                    (or (and node:$src1, mask), node:$src2)>;
-
-def insertll   : inserti16<0xffff0000>;
-def insertlh   : inserti16<0x0000ffff>;
-def insertll64 : inserti16<0xffffffffffff0000>;
-def insertlh64 : inserti16<0xffffffff0000ffff>;
-def inserthl64 : inserti16<0xffff0000ffffffff>;
-def inserthh64 : inserti16<0x0000ffffffffffff>;
-
-def insertlf : PatFrag<(ops node:$src1, node:$src2),
-                       (or (and node:$src1, 0xffffffff00000000), node:$src2)>;
-def inserthf : PatFrag<(ops node:$src1, node:$src2),
-                       (or (and node:$src1, 0x00000000ffffffff), node:$src2)>;
+class insert_imm<int mask> : PatFrag<(ops node:$src1, node:$src2),
+                                     (or (and node:$src1, mask), node:$src2)>;
+
+def inserti8   : insert_imm<-256>;
+def insertll   : insert_imm<0xffff0000>;
+def insertlh   : insert_imm<0x0000ffff>;
+def insertll64 : insert_imm<0xffffffffffff0000>;
+def insertlh64 : insert_imm<0xffffffff0000ffff>;
+def inserthl64 : insert_imm<0xffff0000ffffffff>;
+def inserthh64 : insert_imm<0x0000ffffffffffff>;
+def insertlf   : insert_imm<0xffffffff00000000>;
+def inserthf   : insert_imm<0x00000000ffffffff>;
 
 // ORs that can be treated as insertions.
 def or_as_inserti8 : PatFrag<(ops node:$src1, node:$src2),


        


More information about the llvm-commits mailing list