llvm-project
43 строки · 1.7 Кб
1// RUN: mlir-opt %s | FileCheck %s
2
3// CHECK-LABEL: @parse_i64_tensor
4func.func @parse_i64_tensor() -> tensor<4xi64> {
5// CHECK: dense<255> : tensor<4xi64>
6%0 = arith.constant dense<"0xFF00000000000000FF00000000000000FF00000000000000FF00000000000000"> : tensor<4xi64>
7return %0 : tensor<4xi64>
8}
9
10// CHECK-LABEL: @parse_i32_tensor
11func.func @parse_i32_tensor() -> tensor<8xi32> {
12// CHECK: dense<255> : tensor<8xi32>
13%0 = arith.constant dense<"0xFF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000"> : tensor<8xi32>
14return %0 : tensor<8xi32>
15}
16
17// CHECK-LABEL: @parse_i16_tensor
18func.func @parse_i16_tensor() -> tensor<16xi16> {
19// CHECK: dense<255> : tensor<16xi16>
20%0 = arith.constant dense<"0xFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00"> : tensor<16xi16>
21return %0 : tensor<16xi16>
22}
23
24// CHECK-LABEL: @parse_i8_tensor
25func.func @parse_i8_tensor() -> tensor<32xi8> {
26// CHECK: dense<15> : tensor<32xi8>
27%0 = arith.constant dense<"0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F"> : tensor<32xi8>
28return %0 : tensor<32xi8>
29}
30
31// CHECK-LABEL: @parse_i4_tensor
32func.func @parse_i4_tensor() -> tensor<32xi4> {
33// CHECK: dense<-1> : tensor<32xi4>
34%0 = arith.constant dense<"0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F"> : tensor<32xi4>
35return %0 : tensor<32xi4>
36}
37
38// CHECK-LABEL: @parse_i1_tensor
39func.func @parse_i1_tensor() -> tensor<256xi1> {
40// CHECK: dense<"0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F"> : tensor<256xi1>
41%0 = arith.constant dense<"0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F"> : tensor<256xi1>
42return %0 : tensor<256xi1>
43}
44