brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 842d2cf 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  %v0 = arith.constant dense<[-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7]> : vector<16xi4>8  %v = vector.bitcast %v0 : vector<16xi4> to vector<16xsi4>9  vector.print %v : vector<16xsi4>10  //11  // Test vector:12  //13  // CHECK: ( -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 )14 15  %0 = vector.reduction <add>, %v : vector<16xsi4> into si416  vector.print %0 : si417  // CHECK: -818 19  %1 = vector.reduction <mul>, %v : vector<16xsi4> into si420  vector.print %1 : si421  // CHECK: 022 23  %2 = vector.reduction <minsi>, %v : vector<16xsi4> into si424  vector.print %2 : si425  // CHECK: -826 27  %3 = vector.reduction <maxsi>, %v : vector<16xsi4> into si428  vector.print %3 : si429  // CHECK: 730 31  %4 = vector.reduction <and>, %v : vector<16xsi4> into si432  vector.print %4 : si433  // CHECK: 034 35  %5 = vector.reduction <or>, %v : vector<16xsi4> into si436  vector.print %5 : si437  // CHECK: -138 39  %6 = vector.reduction <xor>, %v : vector<16xsi4> into si440  vector.print %6 : si441  // CHECK: 042 43  return44}45