xref: /llvm-project/mlir/test/Integration/Dialect/Vector/CPU/interleave.mlir (revision eb206e9ea84eff0a0596fed2de8316d924f946d1)
1// RUN: mlir-opt %s -test-lower-to-llvm | \
2// RUN: mlir-runner -e entry -entry-point-result=void  \
3// RUN:   -shared-libs=%mlir_c_runner_utils | \
4// RUN: FileCheck %s
5
6func.func @entry() {
7  %f1 = arith.constant 1.0 : f32
8  %f2 = arith.constant 2.0 : f32
9  %v1 = vector.splat %f1 : vector<2x4xf32>
10  %v2 = vector.splat %f2 : vector<2x4xf32>
11  vector.print %v1 : vector<2x4xf32>
12  vector.print %v2 : vector<2x4xf32>
13  //
14  // Test vectors:
15  //
16  // CHECK: ( ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ) )
17  // CHECK: ( ( 2, 2, 2, 2 ), ( 2, 2, 2, 2 ) )
18
19  %v3 = vector.interleave %v1, %v2 : vector<2x4xf32> -> vector<2x8xf32>
20  vector.print %v3 : vector<2x8xf32>
21  // CHECK: ( ( 1, 2, 1, 2, 1, 2, 1, 2 ), ( 1, 2, 1, 2, 1, 2, 1, 2 ) )
22
23  return
24}
25