[llvm-branch-commits] [SPARC][IAS] Add definitions for cryptographic instructions (PR #139451)

Sergei Barannikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 2 23:18:33 PDT 2025


================
@@ -0,0 +1,98 @@
+//===----------- SparcInstrCrypto.td - cryptographic extensions -----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains instruction formats, definitions and patterns needed for
+// cryptographic instructions on SPARC.
+//===----------------------------------------------------------------------===//
+
+
+// Convenience template for 4-operand instructions
+class FourOpImm<string OpcStr, bits<6> op3val, bits<4> op5val,
+        RegisterClass RC>
+      : F3_4<op3val, op5val, (outs RC:$rd), (ins RC:$rs1, RC:$rs2, simm5Op:$rs3),
+        !strconcat(OpcStr, " $rs1, $rs2, $rs3, $rd")>;
----------------
s-barannikov wrote:

```suggestion
class FourOpImm<string OpcStr, bits<6> op3val, bits<4> op5val,
                RegisterClass RC>
    : F3_4<op3val, op5val, (outs RC:$rd), (ins RC:$rs1, RC:$rs2, simm5Op:$rs3),
      !strconcat(OpcStr, " $rs1, $rs2, $rs3, $rd")>;
```

https://github.com/llvm/llvm-project/pull/139451


More information about the llvm-branch-commits mailing list