1 // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s
3 spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Bfloat16ConversionINTEL], [SPV_INTEL_bfloat16_conversion]> {
4 // CHECK-LABEL: @f32_to_bf16
5 spirv.func @f32_to_bf16(%arg0 : f32) "None" {
6 // CHECK: {{%.*}} = spirv.INTEL.ConvertFToBF16 {{%.*}} : f32 to i16
7 %0 = spirv.INTEL.ConvertFToBF16 %arg0 : f32 to i16
11 // CHECK-LABEL: @f32_to_bf16_vec
12 spirv.func @f32_to_bf16_vec(%arg0 : vector<2xf32>) "None" {
13 // CHECK: {{%.*}} = spirv.INTEL.ConvertFToBF16 {{%.*}} : vector<2xf32> to vector<2xi16>
14 %0 = spirv.INTEL.ConvertFToBF16 %arg0 : vector<2xf32> to vector<2xi16>
18 // CHECK-LABEL: @bf16_to_f32
19 spirv.func @bf16_to_f32(%arg0 : i16) "None" {
20 // CHECK: {{%.*}} = spirv.INTEL.ConvertBF16ToF {{%.*}} : i16 to f32
21 %0 = spirv.INTEL.ConvertBF16ToF %arg0 : i16 to f32
25 // CHECK-LABEL: @bf16_to_f32_vec
26 spirv.func @bf16_to_f32_vec(%arg0 : vector<2xi16>) "None" {
27 // CHECK: {{%.*}} = spirv.INTEL.ConvertBF16ToF {{%.*}} : vector<2xi16> to vector<2xf32>
28 %0 = spirv.INTEL.ConvertBF16ToF %arg0 : vector<2xi16> to vector<2xf32>
35 //===----------------------------------------------------------------------===//
36 // spirv.INTEL.SplitBarrier
37 //===----------------------------------------------------------------------===//
39 // CHECK: spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [SplitBarrierINTEL], [SPV_INTEL_split_barrier]>
40 spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [SplitBarrierINTEL], [SPV_INTEL_split_barrier]> {
41 // CHECK-LABEL: @split_barrier
42 spirv.func @split_barrier() "None" {
43 // CHECK: spirv.INTEL.ControlBarrierArrive <Workgroup> <Device> <Acquire|UniformMemory>
44 spirv.INTEL.ControlBarrierArrive <Workgroup> <Device> <Acquire|UniformMemory>
45 // CHECK: spirv.INTEL.ControlBarrierWait <Workgroup> <Device> <Acquire|UniformMemory>
46 spirv.INTEL.ControlBarrierWait <Workgroup> <Device> <Acquire|UniformMemory>