Lines Matching +full:llvm +full:- +full:3
1 // RUN: mlir-opt -convert-spirv-to-llvm %s | FileCheck %s
3 //===----------------------------------------------------------------------===//
5 //===----------------------------------------------------------------------===//
7 // CHECK-LABEL: @bitcast_float_to_integer_scalar
9 // CHECK: llvm.bitcast {{.*}} : !llvm.float to !llvm.i32
14 // CHECK-LABEL: @bitcast_float_to_integer_vector
15 spv.func @bitcast_float_to_integer_vector(%arg0 : vector<3xf32>) "None" {
16 // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.vec<3 x float> to !llvm.vec<3 x i32>
17 %0 = spv.Bitcast %arg0: vector<3xf32> to vector<3xi32>
21 // CHECK-LABEL: @bitcast_vector_to_scalar
23 // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.vec<2 x float> to !llvm.i64
28 // CHECK-LABEL: @bitcast_scalar_to_vector
30 // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.double to !llvm.vec<2 x i32>
35 // CHECK-LABEL: @bitcast_vector_to_vector
37 // CHECK: {{.*}} = llvm.bitcast {{.*}} : !llvm.vec<4 x float> to !llvm.vec<2 x i64>
42 // CHECK-LABEL: @bitcast_pointer
44 // CHECK: llvm.bitcast %{{.*}} : !llvm.ptr<float> to !llvm.ptr<i32>
49 //===----------------------------------------------------------------------===//
51 //===----------------------------------------------------------------------===//
53 // CHECK-LABEL: @convert_float_to_signed_scalar
55 // CHECK: llvm.fptosi %{{.*}} : !llvm.float to !llvm.i32
60 // CHECK-LABEL: @convert_float_to_signed_vector
62 // CHECK: llvm.fptosi %{{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x i32>
67 //===----------------------------------------------------------------------===//
69 //===----------------------------------------------------------------------===//
71 // CHECK-LABEL: @convert_float_to_unsigned_scalar
73 // CHECK: llvm.fptoui %{{.*}} : !llvm.float to !llvm.i32
78 // CHECK-LABEL: @convert_float_to_unsigned_vector
80 // CHECK: llvm.fptoui %{{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x i32>
85 //===----------------------------------------------------------------------===//
87 //===----------------------------------------------------------------------===//
89 // CHECK-LABEL: @convert_signed_to_float_scalar
91 // CHECK: llvm.sitofp %{{.*}} : !llvm.i32 to !llvm.float
96 // CHECK-LABEL: @convert_signed_to_float_vector
97 spv.func @convert_signed_to_float_vector(%arg0: vector<3xi32>) "None" {
98 // CHECK: llvm.sitofp %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x float>
99 %0 = spv.ConvertSToF %arg0: vector<3xi32> to vector<3xf32>
103 //===----------------------------------------------------------------------===//
105 //===----------------------------------------------------------------------===//
107 // CHECK-LABEL: @convert_unsigned_to_float_scalar
109 // CHECK: llvm.uitofp %{{.*}} : !llvm.i32 to !llvm.float
114 // CHECK-LABEL: @convert_unsigned_to_float_vector
115 spv.func @convert_unsigned_to_float_vector(%arg0: vector<3xi32>) "None" {
116 // CHECK: llvm.uitofp %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x float>
117 %0 = spv.ConvertUToF %arg0: vector<3xi32> to vector<3xf32>
121 //===----------------------------------------------------------------------===//
123 //===----------------------------------------------------------------------===//
125 // CHECK-LABEL: @fconvert_scalar
127 // CHECK: llvm.fpext %{{.*}} : !llvm.float to !llvm.double
130 // CHECK: llvm.fptrunc %{{.*}} : !llvm.double to !llvm.float
135 // CHECK-LABEL: @fconvert_vector
137 // CHECK: llvm.fpext %{{.*}} : !llvm.vec<2 x float> to !llvm.vec<2 x double>
140 // CHECK: llvm.fptrunc %{{.*}} : !llvm.vec<2 x double> to !llvm.vec<2 x float>
145 //===----------------------------------------------------------------------===//
147 //===----------------------------------------------------------------------===//
149 // CHECK-LABEL: @sconvert_scalar
151 // CHECK: llvm.sext %{{.*}} : !llvm.i32 to !llvm.i64
154 // CHECK: llvm.trunc %{{.*}} : !llvm.i64 to !llvm.i32
159 // CHECK-LABEL: @sconvert_vector
160 spv.func @sconvert_vector(%arg0: vector<3xi32>, %arg1: vector<3xi64>) "None" {
161 // CHECK: llvm.sext %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x i64>
162 %0 = spv.SConvert %arg0: vector<3xi32> to vector<3xi64>
164 // CHECK: llvm.trunc %{{.*}} : !llvm.vec<3 x i64> to !llvm.vec<3 x i32>
165 %1 = spv.SConvert %arg1: vector<3xi64> to vector<3xi32>
169 //===----------------------------------------------------------------------===//
171 //===----------------------------------------------------------------------===//
173 // CHECK-LABEL: @uconvert_scalar
175 // CHECK: llvm.zext %{{.*}} : !llvm.i32 to !llvm.i64
178 // CHECK: llvm.trunc %{{.*}} : !llvm.i64 to !llvm.i32
183 // CHECK-LABEL: @uconvert_vector
184 spv.func @uconvert_vector(%arg0: vector<3xi32>, %arg1: vector<3xi64>) "None" {
185 // CHECK: llvm.zext %{{.*}} : !llvm.vec<3 x i32> to !llvm.vec<3 x i64>
186 %0 = spv.UConvert %arg0: vector<3xi32> to vector<3xi64>
188 // CHECK: llvm.trunc %{{.*}} : !llvm.vec<3 x i64> to !llvm.vec<3 x i32>
189 %1 = spv.UConvert %arg1: vector<3xi64> to vector<3xi32>