xref: /llvm-project/mlir/test/Integration/Dialect/Vector/CPU/print-fp.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
6//
7// Test various floating-point types.
8//
9func.func @entry() {
10  %0 = arith.constant dense<[-1000.0, -1.1, 0.0, 1.1, 1000.0]> : vector<5xf64>
11  vector.print %0 : vector<5xf64>
12  // CHECK: ( -1000, -1.1, 0, 1.1, 1000 )
13
14  %1 = arith.constant dense<[-1000.0, -1.1, 0.0, 1.1, 1000.0]> : vector<5xf32>
15  vector.print %1 : vector<5xf32>
16  // CHECK: ( -1000, -1.1, 0, 1.1, 1000 )
17
18  %2 = arith.constant dense<[-1000.0, -1.1, 0.0, 1.1, 1000.0]> : vector<5xf16>
19  vector.print %2 : vector<5xf16>
20  // CHECK: ( -1000, -1.09961, 0, 1.09961, 1000 )
21
22  %3 = arith.constant dense<[-1000.0, -1.1, 0.0, 1.1, 1000.0]> : vector<5xbf16>
23  vector.print %3 : vector<5xbf16>
24  // CHECK: ( -1000, -1.10156, 0, 1.10156, 1000 )
25
26  return
27}
28