1 // RUN: mlir-opt %s | FileCheck %s
3 // CHECK-LABEL: @parse_i64_tensor
4 func.func @parse_i64_tensor() -> tensor<4xi64> {
5 // CHECK: dense<255> : tensor<4xi64>
6 %0 = arith.constant dense<"0xFF00000000000000FF00000000000000FF00000000000000FF00000000000000"> : tensor<4xi64>
7 return %0 : tensor<4xi64>
10 // CHECK-LABEL: @parse_i32_tensor
11 func.func @parse_i32_tensor() -> tensor<8xi32> {
12 // CHECK: dense<255> : tensor<8xi32>
13 %0 = arith.constant dense<"0xFF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000"> : tensor<8xi32>
14 return %0 : tensor<8xi32>
17 // CHECK-LABEL: @parse_i16_tensor
18 func.func @parse_i16_tensor() -> tensor<16xi16> {
19 // CHECK: dense<255> : tensor<16xi16>
20 %0 = arith.constant dense<"0xFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00"> : tensor<16xi16>
21 return %0 : tensor<16xi16>
24 // CHECK-LABEL: @parse_i8_tensor
25 func.func @parse_i8_tensor() -> tensor<32xi8> {
26 // CHECK: dense<15> : tensor<32xi8>
27 %0 = arith.constant dense<"0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F"> : tensor<32xi8>
28 return %0 : tensor<32xi8>
31 // CHECK-LABEL: @parse_i4_tensor
32 func.func @parse_i4_tensor() -> tensor<32xi4> {
33 // CHECK: dense<-1> : tensor<32xi4>
34 %0 = arith.constant dense<"0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F"> : tensor<32xi4>
35 return %0 : tensor<32xi4>
38 // CHECK-LABEL: @parse_i1_tensor
39 func.func @parse_i1_tensor() -> tensor<256xi1> {
40 // CHECK: dense<"0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F"> : tensor<256xi1>
41 %0 = arith.constant dense<"0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F"> : tensor<256xi1>
42 return %0 : tensor<256xi1>