Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix power10 gcc intrinsic check #4193

Merged
merged 1 commit into from
Aug 17, 2023
Merged

Conversation

imciner2
Copy link
Contributor

__builtin_vsx_assemble_pair was introduced in GCC 10 as the replacement, so it should be used for all greater GCC versions as well, otherwise compilation with GCC 11 will fail.

@RajalakshmiSR
Copy link

@imciner2 Can you paste the gcc version that you are using?

@@ -167,7 +167,7 @@ typedef __vector unsigned char vec_t;

#define INIT_1ACC() __builtin_mma_xxsetaccz(&acc0);

#if (defined(__GNUC__) && (__GNUC__ == 10))
#if (defined(__GNUC__) && (__GNUC__ >= 10))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__builtin_vsx_build_pair() is the correct usage for gcc 11 and above.

@imciner2
Copy link
Contributor Author

The GCC version is

$CC --version
powerpc64le-linux-gnu-gcc (GCC) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The errors I am seeing are specifically these:

[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c: In function ‘dgemm_small_kernel_nn_POWER10’:
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:180:3: warning: implicit declaration of function ‘__builtin_vsx_build_pair’; did you mean ‘__builtin_vsx_mul_2di’? [-Wimplicit-function-declaration]
[14:06:41]   180 |   __builtin_vsx_build_pair(&pair, (vec_t)v0, (vec_t)v1);
[14:06:41]       |   ^~~~~~~~~~~~~~~~~~~~~~~~
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:206:3: note: in expansion of macro ‘LOAD_PAIR’
[14:06:41]   206 |   LOAD_PAIR(pb0, t0, t1);           \
[14:06:41]       |   ^~~~~~~~~
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:368:13: note: in expansion of macro ‘LOAD_BTP_8x2’
[14:06:41]   368 |             LOAD_BTP_8x2(n, k);
[14:06:41]       |             ^~~~~~~~~~~~
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:368:13: error: AltiVec argument passed to unprototyped function
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:368:13: error: AltiVec argument passed to unprototyped function
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:368:13: error: AltiVec argument passed to unprototyped function
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:368:13: error: AltiVec argument passed to unprototyped function
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:379:13: error: AltiVec argument passed to unprototyped function
[14:06:41]   379 |             LOAD_BTP_8x1(n, k);
[14:06:41]       |             ^~~~~~~~~~~~
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:379:13: error: AltiVec argument passed to unprototyped function
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:405:11: error: AltiVec argument passed to unprototyped function
[14:06:41]   405 |           LOAD_BTP_8x2(n, k);
[14:06:41]       |           ^~~~~~~~~~~~
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:405:11: error: AltiVec argument passed to unprototyped function
[14:06:41] ../kernel/power/dgemm_small_kernel_nn_power10.c:405:11: error: AltiVec argument passed to unprototyped function

@RajalakshmiSR
Copy link

RajalakshmiSR commented Aug 17, 2023

__builtin_vsx_build_pair() is available from 11.3. Can you change it as..
#if (defined(__GNUC__) && (__GNUC__ == 10 || (__GNUC__ == 11 && __GNUC_MINOR__ <= 2))

__builtin_vsx_assemble_pair was only in GCC 10-11.2 and was replaced by
__builtin_vsx_build_pair thereafter.
@imciner2
Copy link
Contributor Author

__builtin_vsx_build_pair() is available from 11.3. Can you change it as..
#if (defined(GNUC) && (GNUC == 10 || (GNUC == 11 && GNUC_MINOR <= 2))

Yep, that works in my local testing, changed in the PR.

@martin-frbg martin-frbg added this to the 0.3.24 milestone Aug 17, 2023
@martin-frbg martin-frbg merged commit 1b09f4b into OpenMathLib:develop Aug 17, 2023
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants