brintos

brintos / llvm-project-archived public Read only

0
0
Text · 861 B · aff272c Raw
25 lines · plain
1// RUN: mlir-opt %s -convert-vector-to-llvm="enable-x86vector" -test-lower-to-llvm | \2// RUN: mlir-translate --mlir-to-llvmir | \3// RUN: %lli --entry-function=entry --mattr="avx" --dlopen=%mlir_c_runner_utils | \4// RUN: FileCheck %s5 6func.func @entry() -> i32 {7  %i0 = arith.constant 0 : i328  %i4 = arith.constant 4 : i329 10  %a = arith.constant dense<[1.0,  2.0,  3.0,  4.0,  5.0,  6.0,  7.0,  8.0]> : vector<8xf32>11  %b = arith.constant dense<[9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0]> : vector<8xf32>12  %r = x86vector.avx.intr.dot %a, %b : vector<8xf32>13 14  %1 = vector.extract %r[%i0] : f32 from vector<8xf32>15  %2 = vector.extract %r[%i4] : f32 from vector<8xf32>16  %d = arith.addf %1, %2 : f3217 18  // CHECK: ( 110, 110, 110, 110, 382, 382, 382, 382 )19  // CHECK: 49220  vector.print %r : vector<8xf32>21  vector.print %d : f3222 23  return %i0 : i3224}25