32 lines · plain
1// RUN: %clang_cc1 %s -cl-std=cl3.0 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s2// RUN: %clang_cc1 %s -cl-std=cl3.0 -emit-llvm -o - -triple spirv64-unknown-unknown | FileCheck %s3 4kernel void test(global __bf16 *a, global __bf16 *b){5// CHECK-LABEL: spir_kernel void @test(6// CHECK: fadd bfloat7// CHECK: fsub bfloat8// CHECK: fmul bfloat9// CHECK: fdiv bfloat10 11 *b += *a;12 *b -= *a;13 *b *= *a;14 *b /= *a;15}16 17typedef __bf16 __bf16v4 __attribute((ext_vector_type(4)));18 19kernel void test_v4(global __bf16v4 *a, global __bf16v4 *b){20// CHECK-LABEL: spir_kernel void @test_v4(21// CHECK: fadd <4 x bfloat>22// CHECK: fsub <4 x bfloat>23// CHECK: fmul <4 x bfloat>24// CHECK: fdiv <4 x bfloat>25 26 *b += *a;27 *b -= *a;28 *b *= *a;29 *b /= *a;30}31 32