[RISCV] Fix the code alignment for GroupFloatVectors. NFC
[llvm-project.git] / mlir / test / mlir-cpu-runner / X86Vector / math-polynomial-approx-avx2.mlir
blobce7a6550dbecf95a986d1bdb8740fdcc57e5eff7
1 // RUN:   mlir-opt %s -test-math-polynomial-approximation="enable-avx2"        \
2 // RUN:               -convert-arith-to-llvm                                   \
3 // RUN:               -convert-vector-to-llvm="enable-x86vector"               \
4 // RUN:               -convert-math-to-llvm                                    \
5 // RUN:               -convert-std-to-llvm                                     \
6 // RUN:               -reconcile-unrealized-casts                              \
7 // RUN: | mlir-cpu-runner                                                      \
8 // RUN:     -e main -entry-point-result=void -O0                               \
9 // RUN:     -shared-libs=%linalg_test_lib_dir/libmlir_c_runner_utils%shlibext  \
10 // RUN:     -shared-libs=%linalg_test_lib_dir/libmlir_runner_utils%shlibext    \
11 // RUN: | FileCheck %s
13 // -------------------------------------------------------------------------- //
14 // rsqrt.
15 // -------------------------------------------------------------------------- //
17 func @rsqrt() {
18   // Sanity-check that the scalar rsqrt still works OK.
19   // CHECK: inf
20   %0 = arith.constant 0.0 : f32
21   %rsqrt_0 = math.rsqrt %0 : f32
22   vector.print %rsqrt_0 : f32
23   // CHECK: 0.707107
24   %two = arith.constant 2.0: f32
25   %rsqrt_two = math.rsqrt %two : f32
26   vector.print %rsqrt_two : f32
28   // Check that the vectorized approximation is reasonably accurate.
29   // CHECK: 0.707107, 0.707107, 0.707107, 0.707107, 0.707107, 0.707107, 0.707107, 0.707107
30   %vec8 = arith.constant dense<2.0> : vector<8xf32>
31   %rsqrt_vec8 = math.rsqrt %vec8 : vector<8xf32>
32   vector.print %rsqrt_vec8 : vector<8xf32>
34   return
37 func @main() {
38   call @rsqrt(): () -> ()
39   return