brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 1feecb2 Raw
45 lines · plain
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 %s5 6func.func @entry() {7  %v = arith.constant dense<[-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]> : vector<24xi4>8  vector.print %v : vector<24xi4>9  //10  // Test vector:11  //12  // CHECK: ( -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, -8, -7, -6, -5, -4, -3, -2, -1 )13 14 15  %0 = vector.reduction <add>, %v : vector<24xi4> into i416  vector.print %0 : i417  // CHECK: 418 19  %1 = vector.reduction <mul>, %v : vector<24xi4> into i420  vector.print %1 : i421  // CHECK: 022 23  %2 = vector.reduction <minsi>, %v : vector<24xi4> into i424  vector.print %2 : i425  // CHECK: -826 27  %3 = vector.reduction <maxsi>, %v : vector<24xi4> into i428  vector.print %3 : i429  // CHECK: 730 31  %4 = vector.reduction <and>, %v : vector<24xi4> into i432  vector.print %4 : i433  // CHECK: 034 35  %5 = vector.reduction <or>, %v : vector<24xi4> into i436  vector.print %5 : i437  // CHECK: -138 39  %6 = vector.reduction <xor>, %v : vector<24xi4> into i440  vector.print %6 : i441  // CHECK: 042 43  return44}45