[NFC][libclc] Move _CLC_V_V_VP_VECTORIZE macro into clc_lgamma_r.cl and delete clcmacro.h (#156280)

clcmacro.h only defines _CLC_V_V_VP_VECTORIZE which is only used in
clc/lib/generic/math/clc_lgamma_r.cl.
This commit is contained in:
Wenju He 2025-09-03 08:23:01 +08:00 committed by GitHub
parent d7484684e5
commit d50f2ef437
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 55 additions and 116 deletions

View File

@ -9,7 +9,7 @@
#ifndef __CLC_CLC_CONVERT_H__
#define __CLC_CLC_CONVERT_H__
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#define _CLC_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \
_CLC_OVERLOAD _CLC_DECL TO_TYPE __clc_convert_##TO_TYPE##SUFFIX(FROM_TYPE x);

View File

@ -1,69 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef __CLC_CLCMACRO_H__
#define __CLC_CLCMACRO_H__
#include <clc/internal/clc.h>
#include <clc/utils.h>
#define _CLC_V_V_VP_VECTORIZE(DECLSPEC, RET_TYPE, __CLC_FUNCTION, ARG1_TYPE, \
ADDR_SPACE, ARG2_TYPE) \
DECLSPEC __CLC_XCONCAT(RET_TYPE, 2) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 2) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 2) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 2))(__CLC_FUNCTION(x.s0, ptr), \
__CLC_FUNCTION(x.s1, ptr + 1)); \
} \
\
DECLSPEC __CLC_XCONCAT(RET_TYPE, 3) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 3) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 3) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 3))(__CLC_FUNCTION(x.s0, ptr), \
__CLC_FUNCTION(x.s1, ptr + 1), \
__CLC_FUNCTION(x.s2, ptr + 2)); \
} \
\
DECLSPEC __CLC_XCONCAT(RET_TYPE, 4) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 4) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 4) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 4))( \
__CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \
__CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3)); \
} \
\
DECLSPEC __CLC_XCONCAT(RET_TYPE, 8) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 8) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 8) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 8))( \
__CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \
__CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3), \
__CLC_FUNCTION(x.s4, ptr + 4), __CLC_FUNCTION(x.s5, ptr + 5), \
__CLC_FUNCTION(x.s6, ptr + 6), __CLC_FUNCTION(x.s7, ptr + 7)); \
} \
\
DECLSPEC __CLC_XCONCAT(RET_TYPE, 16) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 16) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 16) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 16))( \
__CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \
__CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3), \
__CLC_FUNCTION(x.s4, ptr + 4), __CLC_FUNCTION(x.s5, ptr + 5), \
__CLC_FUNCTION(x.s6, ptr + 6), __CLC_FUNCTION(x.s7, ptr + 7), \
__CLC_FUNCTION(x.s8, ptr + 8), __CLC_FUNCTION(x.s9, ptr + 9), \
__CLC_FUNCTION(x.sa, ptr + 10), __CLC_FUNCTION(x.sb, ptr + 11), \
__CLC_FUNCTION(x.sc, ptr + 12), __CLC_FUNCTION(x.sd, ptr + 13), \
__CLC_FUNCTION(x.se, ptr + 14), __CLC_FUNCTION(x.sf, ptr + 15)); \
}
#endif // __CLC_CLCMACRO_H__

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_ldexp.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#define __CLC_FLOAT_ONLY

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_fma.h>
#include <clc/math/clc_ldexp.h>

View File

@ -11,7 +11,6 @@
// been updated as appropriate.
#include <clc/clc_as_type.h>
#include <clc/clcmacro.h>
#include <clc/float/definitions.h>
#include <clc/integer/clc_abs.h>
#include <clc/integer/clc_clz.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#define DEGREES_SINGLE_DEF(TYPE, LITERAL) \

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#define __CLC_RADIANS_SINGLE_DEF(TYPE, LITERAL) \

View File

@ -5,7 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/shared/clc_clamp.h>

View File

@ -6,7 +6,5 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#define __CLC_BODY <clc_step.inc>
#include <clc/math/gentype.inc>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/integer/clc_clz.h>
#include <clc/internal/clc.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/integer/clc_ctz.h>
#include <clc/internal/clc.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/integer/clc_add_sat.h>
#include <clc/integer/clc_mad24.h>
#include <clc/integer/clc_mul_hi.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_copysign.h>
#include <clc/math/clc_fabs.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/float/definitions.h>
#include <clc/math/clc_fabs.h>
#include <clc/math/clc_sincos_helpers.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_fma.h>
#include <clc/math/clc_ldexp.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/integer/clc_clz.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_floor.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_floor.h>
#include <clc/math/clc_fmin.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/utils.h>
#if __CLC_FPSIZE == 32

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/integer/clc_abs.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_fma.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/float/definitions.h>
#include <clc/integer/clc_clz.h>
#include <clc/internal/clc.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/integer/clc_add_sat.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_subnormal_config.h>

View File

@ -16,6 +16,60 @@
#include <clc/math/clc_sinpi.h>
#include <clc/math/math.h>
#define _CLC_V_V_VP_VECTORIZE(DECLSPEC, RET_TYPE, __CLC_FUNCTION, ARG1_TYPE, \
ADDR_SPACE, ARG2_TYPE) \
DECLSPEC __CLC_XCONCAT(RET_TYPE, 2) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 2) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 2) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 2))(__CLC_FUNCTION(x.s0, ptr), \
__CLC_FUNCTION(x.s1, ptr + 1)); \
} \
\
DECLSPEC __CLC_XCONCAT(RET_TYPE, 3) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 3) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 3) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 3))(__CLC_FUNCTION(x.s0, ptr), \
__CLC_FUNCTION(x.s1, ptr + 1), \
__CLC_FUNCTION(x.s2, ptr + 2)); \
} \
\
DECLSPEC __CLC_XCONCAT(RET_TYPE, 4) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 4) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 4) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 4))( \
__CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \
__CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3)); \
} \
\
DECLSPEC __CLC_XCONCAT(RET_TYPE, 8) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 8) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 8) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 8))( \
__CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \
__CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3), \
__CLC_FUNCTION(x.s4, ptr + 4), __CLC_FUNCTION(x.s5, ptr + 5), \
__CLC_FUNCTION(x.s6, ptr + 6), __CLC_FUNCTION(x.s7, ptr + 7)); \
} \
\
DECLSPEC __CLC_XCONCAT(RET_TYPE, 16) \
__CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 16) x, \
ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 16) * y) { \
ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \
return (__CLC_XCONCAT(RET_TYPE, 16))( \
__CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \
__CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3), \
__CLC_FUNCTION(x.s4, ptr + 4), __CLC_FUNCTION(x.s5, ptr + 5), \
__CLC_FUNCTION(x.s6, ptr + 6), __CLC_FUNCTION(x.s7, ptr + 7), \
__CLC_FUNCTION(x.s8, ptr + 8), __CLC_FUNCTION(x.s9, ptr + 9), \
__CLC_FUNCTION(x.sa, ptr + 10), __CLC_FUNCTION(x.sb, ptr + 11), \
__CLC_FUNCTION(x.sc, ptr + 12), __CLC_FUNCTION(x.sd, ptr + 13), \
__CLC_FUNCTION(x.se, ptr + 14), __CLC_FUNCTION(x.sf, ptr + 15)); \
}
// ====================================================
// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
//

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/float/definitions.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_log2.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/tables.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/tables.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/float/definitions.h>
#include <clc/integer/clc_clz.h>
#include <clc/internal/clc.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_fabs.h>
#include <clc/relational/clc_isnan.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_fabs.h>
#include <clc/math/clc_fma.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_fabs.h>
#include <clc/math/clc_fma.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_fabs.h>
#include <clc/math/clc_fma.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/integer/clc_clz.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_floor.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/integer/clc_clz.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_floor.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_convert.h>
#include <clc/clcmacro.h>
#include <clc/float/definitions.h>
#include <clc/internal/clc.h>
#include <clc/math/clc_fabs.h>

View File

@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include <clc/clc_as_type.h>
#include <clc/clcmacro.h>
#include <clc/float/definitions.h>
#include <clc/integer/clc_abs.h>
#include <clc/integer/clc_clz.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
#define __CLC_BODY <clc_bitselect.inc>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
_CLC_OVERLOAD _CLC_DEF float __clc_native_rsqrt(float x) {

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
_CLC_OVERLOAD _CLC_DEF float __clc_rsqrt(float x) {

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
_CLC_DEF _CLC_OVERLOAD float __clc_fmax(float x, float y) {

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/internal/clc.h>
_CLC_DEF _CLC_OVERLOAD float __clc_fmin(float x, float y) {

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/common/clc_sign.h>
#include <clc/opencl/common/sign.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/common/clc_smoothstep.h>
#include <clc/opencl/common/smoothstep.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/math/clc_atan2.h>
#include <clc/opencl/math/atan2.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/math/clc_atan2pi.h>
#include <clc/opencl/math/atan2pi.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/math/clc_log.h>
#include <clc/opencl/math/log.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/math/clc_log10.h>
#include <clc/opencl/math/log10.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/math/clc_log2.h>
#include <clc/opencl/math/log2.h>

View File

@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#include <clc/clcmacro.h>
#include <clc/math/clc_nan.h>
#define __CLC_BODY <nan.inc>