26 lines · plain
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#if (__CLC_VECSIZE_OR_1 == 1 || __CLC_VECSIZE_OR_1 == 2 || \10 __CLC_VECSIZE_OR_1 == 3 || __CLC_VECSIZE_OR_1 == 4)11 12_CLC_OVERLOAD _CLC_DEF __CLC_SCALAR_GENTYPE __clc_dot(__CLC_GENTYPE x,13 __CLC_GENTYPE y) {14#if __CLC_VECSIZE_OR_1 == 115 return x * y;16#elif __CLC_VECSIZE_OR_1 == 217 return x.s0 * y.s0 + x.s1 * y.s1;18#elif __CLC_VECSIZE_OR_1 == 319 return x.s0 * y.s0 + x.s1 * y.s1 + x.s2 * y.s2;20#else21 return x.s0 * y.s0 + x.s1 * y.s1 + x.s2 * y.s2 + x.s3 * y.s3;22#endif23}24 25#endif26