[Mlir-commits] [mlir] [mlir][arith] Add shift integration tests (PR #98183)

Jakub Kuderski llvmlistbot at llvm.org
Sun Aug 25 11:09:27 PDT 2024


================
@@ -0,0 +1,160 @@
+// RUN: mlir-opt %s --test-lower-to-llvm | \
+// RUN:   mlir-cpu-runner -e entry -entry-point-result=void \
+// RUN:                   --shared-libs=%mlir_c_runner_utils | \
+// RUN:   FileCheck %s --match-full-lines
+
+func.func @shrsi_i8(%v1 : i8, %v2 : i8) {
+  vector.print str "@shrsi_i8\n"
+  %res = arith.shrsi %v1, %v2 : i8
+  vector.print %res : i8
+  return
+}
+
+func.func @shrui_i8(%v1 : i8, %v2 : i8) {
+  vector.print str "@shrui_i8\n"
+  %res = arith.shrui %v1, %v2 : i8
+  vector.print %res : i8
+  return
+}
+
+func.func @shli_i8(%v1 : i8, %v2 : i8) {
+  vector.print str "@shli_i8\n"
+  %res = arith.shli %v1, %v2 : i8
+  vector.print %res : i8
+  return
+}
+
+func.func @shrsi_i1(%v1 : i1, %v2 : i1) {
+  vector.print str "@shrsi_i1\n"
+  %res = arith.shrsi %v1, %v2 : i1
+  vector.print %res : i1
+  return
+}
+
+func.func @shrui_i1(%v1 : i1, %v2 : i1) {
+  vector.print str "@shrui_i1\n"
+  %res = arith.shrui %v1, %v2 : i1
+  vector.print %res : i1
+  return
+}
+
+func.func @shli_i1(%v1 : i1, %v2 : i1) {
+  vector.print str "@shli_i1\n"
+  %res = arith.shli %v1, %v2 : i1
+  vector.print %res : i1
+  return
+}
+
+func.func @shrsi() {
+  // ------------------------------------------------
+  // Test i1
+  // ------------------------------------------------
+  %false = arith.constant 0 : i1
+
+  // shift by zero : i1 should be non poison
----------------
kuhar wrote:

We cannot check for poison in integration tests... I'd suggest removing this comment

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


More information about the Mlir-commits mailing list