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

AArch64: -march=armv8-a+simd is incorrect #232

Closed
steleman opened this issue Dec 19, 2018 · 2 comments
Closed

AArch64: -march=armv8-a+simd is incorrect #232

steleman opened this issue Dec 19, 2018 · 2 comments

Comments

@steleman
Copy link

This is based on sleef 3.3.1:

The cmake file Configure.cmake contains the following:

set(CLANG_FLAGS_ENABLE_NEON32 "--target=arm-linux-gnueabihf;-mcpu=cortex-a8")
# Arm AArch64 vector extensions.
set(CLANG_FLAGS_ENABLE_ADVSIMD "-march=armv8-a+simd")

This -march option is incorrect and unnecessary. It causes conflicts with -mcpu.

For example, GCC correctly warns if -mcpu=thunderx2t99 -march=armv8-a+simd was passed on compile-line:

%> cat t.c
#include <stdio.h>

int main()
{
    return 0;
}
%> gcc --version
gcc (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
[ ... ]
%> gcc -O3 -std=c99 -mcpu=thunderx2t99 -march=armv8-a+simd t.c -o t
cc1: warning: switch -mcpu=armv8.1-a conflicts with -march=armv8-a switch

Furthermore, this encourages building sleef without passing -mcpu=[X] on compile-line. Without -mcpu, the compiler will always choose the default generic instruction scheduler, which will lead to very poor performance on some AArch64 CPUs. For example on T99.

-mcpu=[X] is sufficient and should be required in CFLAGS. Either the particular AArch64 micro-arch can do V8 SIMD, or it can't. If it can do V8 SIMD, it will be available by default, without the need to pass -march=armv8-a+simd on compile-line.

@shibatch
Copy link
Owner

Thank you Stefan!
I will fix this problem in probably next week.

fpetrogalli pushed a commit that referenced this issue Jan 23, 2019
1. `-march=armv8-a+simd` is removed as it is not necessary (#232)
2. Delete output that is never generated (#231)

It also includes changes of CI setting for removing GCC/OSX testing on travis. This is because updating gcc with brew takes too much time now. Instead of this, build with gcc is now tested on Jenkins.
@fpetrogalli
Copy link
Collaborator

Fixed in 8e6e52f. Thank you @shibatch .

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

No branches or pull requests

3 participants