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

vget_lane_p64 triggers -Wvector-conversion diagnostic #47601

Open
llvmbot opened this issue Nov 22, 2020 · 1 comment
Open

vget_lane_p64 triggers -Wvector-conversion diagnostic #47601

llvmbot opened this issue Nov 22, 2020 · 1 comment
Labels
bugzilla Issues migrated from bugzilla clang:headers Headers provided by Clang, e.g. for intrinsics

Comments

@llvmbot
Copy link
Member

llvmbot commented Nov 22, 2020

Bugzilla Link 48257
Version 11.0
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @topperc,@c-rhodes,@DMG862,@fhahn,@zygoloid,@sjoerdmeijer

Extended Description

vget_lane_p64 is defined in arm_neon.h as:

#define vget_lane_p64(__p0, __p1) extension ({
poly64x1_t __s0 = __p0;
poly64_t __ret;
__ret = (poly64_t) __builtin_neon_vget_lane_i64((poly64x1_t)__s0, __p1);
__ret;
})

Note the cast on the first argument to __builtin_neon_vget_lane_i64; vget_lane_i64 takes an int64x1_t, not a poly64x1_t, so code which calls this macro ends up emitting a -Wvector-conversion diagnostic:

error: incompatible vector types passing 'poly64x1_t' (vector of 1 'poly64_t' value) to parameter of type 'attribute((vector_size(1 * sizeof(long)))) long' (vector of 1 'long' value) [-Werror,-Wvector-conversion]

For an example, you can use:

#include <arm_neon.h>

poly64_t foo (poly64x1_t v);

poly64_t
foo (poly64x1_t v) {
return vget_lane_p64(v, 0);
}

Or, on Compiler Explorer: https://godbolt.org/z/GWf6fq

It looks like this is a problem on all the vget*_lane_p64 functions.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@mr-c
Copy link

mr-c commented May 21, 2023

I can confirm this bug still exists as of clang 16 and clang trunk by using the provided Compiler Explorer link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:headers Headers provided by Clang, e.g. for intrinsics
Projects
None yet
Development

No branches or pull requests

2 participants