On 12/06/2024 03:38, Narishima, Keiichirou via Gcc-help wrote: > GCC Helper, > > 【English】 > Product information: armv8.2 CoretevA76 aarch64 > > Question background > I am the person in charge of obtaining functional safety approval for > arm_neon.h. > > I inquired at ARM, but they were unable to answer because it was an > internal code of GCC, and asked me to check the GCC documentation, so I > contacted GCC Help. > Problem > When I run the static analysis tool, it says "Casting between pointers to > objects that point to different types is prohibited." > I tried looking for information about __builtin_aarch64_simd_qi, but I was > unable to find anything in the official GCC documentation. > > Question > Could you please tell me the following information? > > 1. Why is no data loss occurring when (int8_t *) is cast to > (__builtin_aarch64_simd_qi *)? > 2. Could you please tell me the specifications of the built-in functions of > __builtin_aarch64_st1v8qi, or give me the URL of the specifications? > 3. Please tell me the specification of built-in cast of > __builtin_aarch64_simd_qi or the URL of the specification. arm_neon.h in GCC implements the AdvancedSIMD (Neon) related aspects of the Arm ACLE specification. The internals of how that is done is private to the compiler (implementation detail), and we do not publicly document that as it may change from release to release; the low-level builtin functions should only be used via the intrinsic functions that ACLE specifies. For static analysis purposes you should treat everything within this header as private to the compiler. For example, arm_sve.h defines a large number of ACLE intrinsics for use with the SVE extension, but it hides all the implementation detail behind a single #pragma statement. R. > > 【日本語】 > 製品情報:armv8.2 CoretevA76 aarch64 > > 確認状況 > ARM社に問い合わせましたが、GCCの内部コードの内容のため回答できなく、GCCのドキュメントを確認してほしいといわれたため > GCC Helpに問合せしました。 > > 問題点 > ソースコードの静的解析ツールをかけると「異なる型を指すオブジェクトへのポインタ間で、キャストしてはならない」と指摘されます。 > __builtin_aarch64_simd_qi に関して、探してみましたが、GCCの公式資料から探すことができませんでした。 > > 質問内容 > 以下の情報を教えていただけないでしょうか。 > > 1.(int8_t *) を (__builtin_aarch64_simd_qi *)にキャストしているが、データの消失が起きない理由。 > 2.__builtin_aarch64_st1v8qiのビルドイン関数の仕様のご教授、もしくは、仕様のURL > 3.__builtin_aarch64_simd_qi のビルドインキャストの仕様のご教授 、もしくは、仕様のURL > > Copyright (C) 2011-2018 Free Software Foundation, Inc. > Contributed by ARM Ltd. > arm_neon.h > __extension__ extern __inline void > __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > vst1_s8 (int8_t *a, int8x8_t b) > { > __builtin_aarch64_st1v8qi ((__builtin_aarch64_simd_qi *) a, b); > } >