46 lines · plain
1// RUN: %clang_cc1 %s -triple spir-unknown-unknown -finclude-default-header -fdeclare-opencl-builtins -cl-std=CL1.2 -emit-llvm -o - -O0 | FileCheck %s2 3// Pragmas are only accepted for backward compatibility.4// The builtins are made available with the following defines.5 6#define cl_arm_integer_dot_product_int8 17#define cl_arm_integer_dot_product_accumulate_int8 18#define cl_arm_integer_dot_product_accumulate_int16 19#define cl_arm_integer_dot_product_accumulate_saturate_int8 110 11#pragma OPENCL EXTENSION cl_arm_integer_dot_product_int8 : enable12#pragma OPENCL EXTENSION cl_arm_integer_dot_product_int8 : disable13void test_int8(uchar4 ua, uchar4 ub, char4 sa, char4 sb) {14 uint ur = arm_dot(ua, ub);15 // CHECK: call spir_func i32 @_Z7arm_dotDv4_hS_16 int sr = arm_dot(sa, sb);17 // CHECK: call spir_func i32 @_Z7arm_dotDv4_cS_18}19 20#pragma OPENCL EXTENSION cl_arm_integer_dot_product_accumulate_int8 : enable21#pragma OPENCL EXTENSION cl_arm_integer_dot_product_accumulate_int8 : disable22void test_accumulate_int8(uchar4 ua, uchar4 ub, uint uc, char4 sa, char4 sb, int c) {23 uint ur = arm_dot_acc(ua, ub, uc);24 // CHECK: call spir_func i32 @_Z11arm_dot_accDv4_hS_j25 int sr = arm_dot_acc(sa, sb, c);26 // CHECK: call spir_func i32 @_Z11arm_dot_accDv4_cS_i27}28 29#pragma OPENCL EXTENSION cl_arm_integer_dot_product_accumulate_int16 : enable30#pragma OPENCL EXTENSION cl_arm_integer_dot_product_accumulate_int16 : disable31void test_accumulate_int16(ushort2 ua, ushort2 ub, uint uc, short2 sa, short2 sb, int c) {32 uint ur = arm_dot_acc(ua, ub, uc);33 // CHECK: call spir_func i32 @_Z11arm_dot_accDv2_tS_j34 int sr = arm_dot_acc(sa, sb, c);35 // CHECK: call spir_func i32 @_Z11arm_dot_accDv2_sS_i36}37 38#pragma OPENCL EXTENSION cl_arm_integer_dot_product_accumulate_saturate_int8 : enable39#pragma OPENCL EXTENSION cl_arm_integer_dot_product_accumulate_saturate_int8 : disable40void test_accumulate_saturate_int8(uchar4 ua, uchar4 ub, uint uc, char4 sa, char4 sb, int c) {41 uint ur = arm_dot_acc_sat(ua, ub, uc);42 // CHECK: call spir_func i32 @_Z15arm_dot_acc_satDv4_hS_j43 int sr = arm_dot_acc_sat(sa, sb, c);44 // CHECK: call spir_func i32 @_Z15arm_dot_acc_satDv4_cS_i45}46