# Libraries The Hexagon LLVM compilers include the following libraries: - C standard library - C++ standard library - Dynamic loading library - Hexagon-specific libraries - HVX-specific libraries - Intrinsics emulation library The C and C++ standard libraries are based on the industry-standard Dinkumware libraries. The dynamic loading library allows programs to load and unload libraries at runtime. It is derived from the standard UNIX dynamic loading library (`libdl`). The Hexagon-specific libraries support the following features: - Low-level intrinsics (instruction access, vector access, circular addressing) - An API for accessing timer information in the Hexagon processor simulator The HVX-specific library supports low-level intrinsics for HVX operations (instruction access, vector access, vector initialization, vector assignment). The intrinsics emulation library allows developers to compile a C or C++ program that contains Hexagon instruction intrinsics into a native executable file for the host development system. ## C standard library and C++ libraries The C standard library and one of the C++ libraries are derived from the corresponding libraries developed by Dinkumware. The Dinkumware C and C++ libraries are conforming implementations of the standard C and C++ libraries. For more information, see the following documents: - *Hexagon C Library User Guide* (80-N2040-13) - *Hexagon C++ Library User Guide* (80-N2040-14) ### C library The C library is always the Dinkumware C library. It supports C11. ### C++ libraries You can choose between two C++ libraries, Dinkumware or Libc++. - Dinkumware is the default library when no standard is specified or when `-std=c++03` is specified. - Dinkumware’s C++ library supports C++03. It does not support C++11 or newer C++ standards. - Dinkumware is supported on the standalone environment and the QuRT™ software environment. - You can override the default library by specifying `-stdlib=libstdc++` for Dinkumware. - Libc++ is the default library when one of the following options is specified: `-std=c++11`, `-std=c++14`, `-std=c++17`. - Libc++ supports C++03, C++11, C++14, and C++17. - You can override the default library by specifying `-std=libc++` for Libc++. ## Hexagon-specific libraries The Hexagon processor-specific libraries support the following features: - Instruction access - Vector access (32- and 64-bit; C and C++) - Circular addressing - Bit-reversed addressing - Simulation timer Vector access is supported in the `hexagon_types.h` library. Instruction access and circular/bit-reversed addressing are supported in the `hexagon_protos.h` library. Simulator timer access is supported in the `hexagon_sim_timer.h` library. ### Instruction access To support efficient coding of the time-intensive sections of a program (without resorting to inline assembly language), the LLVM compiler provides intrinsics that are used to directly access Hexagon processor instructions. The instruction intrinsics are accessed by including the `hexagon_protos.h` library file. The following example shows how an instruction intrinsic is used to directly access the ALU64 instruction `Rdd=vminh(Rtt,Rss)`: #include int main() { long long v1=0xFFFF0000FFFF0000; long long v2=0x0000FFFF0000FFFF; long long result; // find the minimum for each half-word in 64-bit vector result = Q6_P_vminh_PP(v1,v2); } Copy to clipboard Intrinsics are defined for most of the Hexagon processor instructions. For more information, see the *Qualcomm Hexagon Programmer’s Reference Manual* (see [References](https://docs.qualcomm.com/doc/80-N3040-23/topic/references.html)). ### Vector access (32-bit) To support efficient coding of 32-bit vector operations, the LLVM compiler provides intrinsics that are used to perform the following tasks: - Read or write individual words, half-words, or bytes in 32-bit vectors - Construct 32-bit vectors from a sequence of words, half-words, or bytes The vector intrinsics are accessed by including the header file hexagon\_types.h. 32-bit vectors are defined as variables of type `Q6Vect32`. The following example shows how the 32- bit vector intrinsics are used: #include extern int foo(unsigned char, Q6Vect32, Q6Vect32); int bar() { short w=1, x=3; int t=1; unsigned char b; Q6Vect32 v, rslt; // construct 32-bit vector from two half-words v = Q6V32_CREATE_H(w, x); // read low-order byte of 32-bit vector b = Q6V32_GET_UB0(v); // write word as 32-bit vector // return modified vector, v remains unchanged rslt = Q6V32_PUT_W(v, t); return foo(b, v, rslt); } Copy to clipboard The following figure shows how words, half-words, and bytes are accessed in a 32-bit vector. ![../../_images/libraries_vector_access_32bit.png](data:image/png;base64,UklGRsgJAABXRUJQVlA4TLwJAAAv/AFAAM/iqLZtpzm/08FEBwVIYIQKpKKgk4wiIQa6CFaxbSvZz3EI4ZLgNSUIFUjg8kkPGES2reR8/zglHApAA4qQjxQkcOnC/Cfw9f+01qSUlFK8wBNCkFIyxtBa01ozxnDOidOEEIIxhhCCF3he4KV5RgjBOcdaS0rJCzwv8LzA8wJPHAJrCQobLxbA4gkeAFp4wKEDjJsF0AN67K2ZA2xYAT0WwKYH+BUj6NHVgFEDqMAM6KX5ICtyWmtSSlpr1lpe4P17nwcfSsCLFzyAyf3GbceAwIppxDjNclq84AEsCADcNJJU2p2ccx6WvTHdk21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mi+5lScst7k2RT0khhXXYM8//kw3Q/U9qwvDfRpHTBvryB/h81TPczpVjem2py3qajdpj/Rw3T/UwplvcmmxKa7jXj+hnm/1HDdD8TCTqu2t6bSdloQL8eh/l/1DDdTzCeXOL67ymsGOr/CfzTyjvpCP3nBcK+9v7zuxjv38z7eu85H09fm/d1+mPgX0re9U+bZL0uGCY1TOjRVzME/NS0ywgzNWAPDDK8EKlhtrYZptQONcwE4jLCTA3YA4MML19J1DAaLDOMcqthpg+XEWZisNZTZHihUcOkC4VHptxqmImjeF05jDAThVLtETwiUcNsYhu3GmbCQOvqsnIYYSYD83ekY2WBDC+HJGqY7doywyi3GmaqQAfSFJ48q2wjzIScX2iM08UGGV6OadQwDjOMWw0TjCeXuP6NCiuGqmEC/7TybkjOvZn3dc53F9D1a/O+bnxWYV97//ldjHdv5n29890FdOravK9Te/1cQNajrtr5cGfxMutFRylAjXQhsaFNMvS+Ly+zbpBBt2kWWa/Mp016ab/Dvg8dmwHikTlG2ERBBzZBJBl+ALw9gh9+gkWmHaafjl8qpWzZi44MBz9DjN63yPIXZdC9jHUOLXKAIEPEj0nWrmzTj/1eDbU1BsNRnW9qbI1Rug46ilfIAAWA/V94+bFlL87DT1pjfYhhVSod2URh97bUuFyw8WcYOlJoCUoB/haStAfPKoWMP6jRwMJqWGAzHNbAKaX6G2kdduQb8yGOLuvftovMZfrBXVKAyPQDcHZJvmzDqwtHtd8NGVRwfRBL6WgAxcss8E8r7zbk9P15X6c95/ODmc+Dz76iAA==) #### Construct vector Construct a 32-bit vector from the specified values and return it as a result value. Q6Vect32 Q6V32_CREATE_W(int w); Q6Vect32 Q6V32_CREATE_H(short h1, short h0); Q6Vect32 Q6V32_CREATE_B(char b3, char b2, char b1, char b0); Copy to clipboard #### Extract word Extract a word (either signed or unsigned) from a 32-bit vector and return it as a result value. int Q6V32_GET_W(Q6Vect32 v); unsigned int Q6V32_GET_UW(Q6Vect32 v); Copy to clipboard #### Extract half-word Extract a specified half-word (either signed or unsigned) from a 32-bit vector and return it as a result value. short Q6V32_GET_H0(Q6Vect32 v); short Q6V32_GET_H1(Q6Vect32 v); unsigned short Q6V32_GET_UH0(Q6Vect32 v); unsigned short Q6V32_GET_UH1(Q6Vect32 v); Copy to clipboard #### Extract byte Extract a specified byte (either signed or unsigned) from a 32-bit vector and return it as a result value. signed char Q6V32_GET_B0(Q6Vect32 v); signed char Q6V32_GET_B1(Q6Vect32 v); signed char Q6V32_GET_B2(Q6Vect32 v); signed char Q6V32_GET_B3(Q6Vect32 v); unsigned char Q6V32_GET_UB0(Q6Vect32 v); unsigned char Q6V32_GET_UB1(Q6Vect32 v); unsigned char Q6V32_GET_UB2(Q6Vect32 v); unsigned char Q6V32_GET_UB3(Q6Vect32 v); Copy to clipboard #### Set word Assign a word value to a 32-bit vector and return the modified vector as a result value. Q6Vect32 Q6V32_PUT_W(Q6Vect32 v, int val); Copy to clipboard #### Set half-word Assign a value to the specified half-word in a 32-bit vector and return the modified vector as a result value. Q6Vect32 Q6V32_PUT_H0(Q6Vect32 v, short val); Q6Vect32 Q6V32_PUT_H1(Q6Vect32 v, short val); Copy to clipboard #### Set byte Assign a value to the specified byte in a 32-bit vector and return the modified vector as a result value. Q6Vect32 Q6V32_PUT_B0(Q6Vect32 v, char val); Q6Vect32 Q6V32_PUT_B1(Q6Vect32 v, char val); Q6Vect32 Q6V32_PUT_B2(Q6Vect32 v, char val); Q6Vect32 Q6V32_PUT_B3(Q6Vect32 v, char val); Copy to clipboard ### Vector access (32-bit; C++) For C++ programs the vector access library also implements the 32-bit vector access operations (see [Vector access (32-bit)](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-vector-access-32bit-sub)) as member functions of the class `Q6Vect32C`. #### Constructors Construct a 32-bit vector from the specified values. Q6Vect32C::Q6Vect32C(int w); Q6Vect32C::Q6Vect32C(short h1, short h0); Q6Vect32C::Q6Vect32C(signed char b3, signed char b2, signed char b1, signed char b0); Q6Vect32C::Q6Vect32C(const Q6Vect32C & v); Q6Vect32C::Q6Vect32C& operator = (const Q6Vect32C & v); Copy to clipboard #### Extract word Extract a word (either signed or unsigned) from a 32-bit vector and return it as a result value. int Q6Vect32C::W(void); unsigned int Q6Vect32C::UW(void); Copy to clipboard #### Extract half-word Extract a specified half-word (either signed or unsigned) from a 32-bit vector and return it as a result value. short Q6Vect32C::H0(void); short Q6Vect32C::H1(void); unsigned short Q6Vect32C::UH0(void); unsigned short Q6Vect32C::UH1(void); Copy to clipboard #### Extract byte Extract a specified byte (either signed or unsigned) from a 32-bit vector and return it as a result value. signed char Q6Vect32C::B0(void); signed char Q6Vect32C::B1(void); signed char Q6Vect32C::B2(void); signed char Q6Vect32C::B3(void); unsigned char Q6Vect32C::UB0(void); unsigned char Q6Vect32C::UB1(void); unsigned char Q6Vect32C::UB2(void); unsigned char Q6Vect32C::UB3(void); Copy to clipboard #### Set word Assign a word value to a 32-bit vector and return the modified vector as a result value. Q6Vect32C Q6Vect32C::W(int w); Copy to clipboard #### Set half-word Assign a value to the specified half-word in a 32-bit vector and return the modified vector as a result value. Q6Vect32C Q6Vect32C::H0(short h); Q6Vect32C Q6Vect32C::H1(short h); Copy to clipboard #### Set byte Assign a value to the specified byte in a 32-bit vector and return the modified vector as a result value. Q6Vect32C Q6Vect32C::B0(signed char b); Q6Vect32C Q6Vect32C::B1(signed char b); Q6Vect32C Q6Vect32C::B2(signed char b); Q6Vect32C Q6Vect32C::B3(signed char b); Copy to clipboard ### Vector access (64-bit) To support efficient coding of 64-bit vector operations, the LLVM compiler provides intrinsics that are used to perform the following tasks: - Read or write double-words, words, half-words, or bytes in 64-bit vectors - Construct 64-bit vectors from double-words, words, half-words, or bytes The vector intrinsics are accessed by including the header file `hexagon_types.h`. 64-bit vectors are defined as variables of type `Q6Vect64`. The following example shows how the 64-bit vector intrinsics are used: #include extern int foo(unsigned char, Q6Vect64, Q6Vect64); int bar() { short w=1, x=3, y=2, z=1; int t=1; unsigned char b; Q6Vect64 v, rslt; // construct 64-bit vector from four half-words v = Q6V64_CREATE_H(w, x, y, z); // read low-order byte of 64-bit vector b = Q6V64_GET_UB0(v); // write high-order word of 64-bit vector // return modified vector, v remains unchanged rslt = Q6V64_PUT_W1(v, t); return foo(b, v, rslt); } Copy to clipboard The following figure shows how double-words, words, half-words, and bytes are accessed. ![../../_images/libraries_vector_access_64bit.png](data:image/png;base64,UklGRtIPAABXRUJQVlA4TMUPAAAvCAJSAPfjJrZtV9nnvFh9FfmDHlpcIgEFOVR0tBjIItzUti0n594/VomJOUEBEpBKRYeDKGCGEh9xVNu205x7fx2BiV4UIJkRKlCQnnjJ/JNN2pA5ae8Avva/GCPbbJMkhCDGSJIfttn282KMYowksS2l5O/G98ffEUlsyzkLIUgpKaWQpJRCkhCCGKMYI9tsq7WSpJSi1qrWapA82lbTNCSRJMYo5yznzDZJJIkxqrX6o/4r+KHDDbR88QNfQA86tw+uD8DP5Qb4OgA2wOkJ7gAWHAEPS8DhZgdYABseixVgeYAbBtDj8AVcuGAHWMAZW8ABsIMNN8ANG2Cz2cEPHQs6cMX6dICHbdvbNq62DchaXsvpvffee6/TG6PFSSQuJlxrpOmN4Ypi2Z5YMSc/nrhQrhMXKYlblhzRfwmOJIlt0wcQOINWZpc0pZC6foBeyzgqpbKGdGe4dDNXKuuWNhRk33S2t3STbo/q3Y451obBlR+W7009SQaXR91CuaxP5oXWVdY5+2S9AWXesPpP5oW9Wf13qZTKl/kX+j+pceIQehw+JHwcgec8Kr6uw9KPyokO4dTmq+Dx4N3onA/dhc5595PonH9Hx3zsH+icj96DznnPo+icm6e6g5MPo3O+9zY656evoHM+dAidU6Fjfv4sOueXj6NzPv4lOufDJ9fGUk8ScgN+fFM146epynwwcialUsWgyemDEbNSau/HJqYXRk7zdNaU5YVXV2Zy+mDk/H5qtc0Lpw/pztDk9MGIObfawKfJpzKTN4zBNKPF2KRXE/EUJMPuUFcoCvM81/SnAlFo69lvhaIwEbbyJieKwv7uX4Wi0GWhSdtQFNr6VmEForAfclZ8T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VkXSH2LuUoh43ellyCHc0yVGNLYUPhUh6cpt8dfy1yvh0qHiJQWa9mFJ5pdR/V1Xq85dGmoiXyGSuxtbEgtj+LIVX0KTKVkcGU/Mijl32fpiNE5d5ieyiyYdWg3uXydnZardLjFH/zAm10r1QlFHmDNKryQF77qZecWGNBgA=) #### Construct vector Construct a 64-bit vector from the specified values and return it as a result value. Q6Vect64 Q6V64_CREATE_D(long long d); Q6Vect64 Q6V64_CREATE_W(int w1, int w0); Q6Vect64 Q6V64_CREATE_H(short h3, short h2, short h1, short h0); Q6Vect64 Q6V64_CREATE_B(char b7, char b6, char b5, char b4, char b3, char b2, char b1, char b0); Copy to clipboard #### Extract double-word Extract a double-word (either signed or unsigned) from a 64-bit vector and return it as a result value. long long Q6V64_GET_D(Q6Vect64 v); unsigned long long Q6V64_GET_UD(Q6Vect64 v); Copy to clipboard #### Extract word Extract a specified word (either signed or unsigned) from a 64-bit vector and return it as a result value. int Q6V64_GET_W0(Q6Vect64 v); int Q6V64_GET_W1(Q6Vect64 v); unsigned int Q6V64_GET_UW0(Q6Vect64 v); unsigned int Q6V64_GET_UW1(Q6Vect64 v); Copy to clipboard #### Extract half-word Extract a specified half-word (either signed or unsigned) from a 64-bit vector and return it as a result value. short Q6V64_GET_H0(Q6Vect64 v); short Q6V64_GET_H1(Q6Vect64 v); short Q6V64_GET_H2(Q6Vect64 v); short Q6V64_GET_H3(Q6Vect64 v); unsigned short Q6V64_GET_UH0(Q6Vect64 v); unsigned short Q6V64_GET_UH1(Q6Vect64 v); unsigned short Q6V64_GET_UH2(Q6Vect64 v); unsigned short Q6V64_GET_UH3(Q6Vect64 v); Copy to clipboard #### Extract byte Extract a specified byte (either signed or unsigned) from a 64-bit vector and return it as a result value. signed char Q6V64_GET_B0(Q6Vect64 v); signed char Q6V64_GET_B1(Q6Vect64 v); signed char Q6V64_GET_B2(Q6Vect64 v); signed char Q6V64_GET_B3(Q6Vect64 v); signed char Q6V64_GET_B4(Q6Vect64 v); signed char Q6V64_GET_B5(Q6Vect64 v); signed char Q6V64_GET_B6(Q6Vect64 v); signed char Q6V64_GET_B7(Q6Vect64 v); unsigned char Q6V64_GET_UB0(Q6Vect64 v); unsigned char Q6V64_GET_UB1(Q6Vect64 v); unsigned char Q6V64_GET_UB2(Q6Vect64 v); unsigned char Q6V64_GET_UB3(Q6Vect64 v); unsigned char Q6V64_GET_UB4(Q6Vect64 v); unsigned char Q6V64_GET_UB5(Q6Vect64 v); unsigned char Q6V64_GET_UB6(Q6Vect64 v); unsigned char Q6V64_GET_UB7(Q6Vect64 v); Copy to clipboard #### Set double-word Assign a double-word value to a 64-bit vector and return the modified vector as a result value. Q6Vect64 Q6V64_PUT_D(Q6Vect64 v, long long val); Copy to clipboard #### Set word > > > Assign a value to the specified word in a 64-bit vector and return the modified vector as a result value. Q6Vect64 Q6V64_PUT_W0(Q6Vect64 v, int val); Q6Vect64 Q6V64_PUT_W1(Q6Vect64 v, int val); Copy to clipboard #### Set half-word Assign a value to the specified half-word in a 64-bit vector and return the modified vector as a result value. Q6Vect64 Q6V64_PUT_H0(Q6Vect64 v, short val); Q6Vect64 Q6V64_PUT_H1(Q6Vect64 v, short val); Q6Vect64 Q6V64_PUT_H2(Q6Vect64 v, short val); Q6Vect64 Q6V64_PUT_H3(Q6Vect64 v, short val); Copy to clipboard #### Set byte Assign a value to the specified byte in a 64-bit vector and return the modified vector as a result value. Q6Vect64 Q6V64_PUT_B0(Q6Vect64 v, char val); Q6Vect64 Q6V64_PUT_B1(Q6Vect64 v, char val); Q6Vect64 Q6V64_PUT_B2(Q6Vect64 v, char val); Q6Vect64 Q6V64_PUT_B3(Q6Vect64 v, char val); Q6Vect64 Q6V64_PUT_B4(Q6Vect64 v, char val); Q6Vect64 Q6V64_PUT_B5(Q6Vect64 v, char val); Q6Vect64 Q6V64_PUT_B6(Q6Vect64 v, char val); Q6Vect64 Q6V64_PUT_B7(Q6Vect64 v, char val); Copy to clipboard ### Vector access (64-bit; C++) For C++ programs the vector access library also implements the 64-bit vector access operations (see [Vector access (64-bit)](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-vector-access-64bit-sub)) as member functions of the class `Q6Vect64C`. #### Constructors Construct a 64-bit vector from the specified values. Q6Vect64C::Q6Vect64C(long long d = 0); Q6Vect64C::Q6Vect64C(int w1, int w0); Q6Vect64C::Q6Vect64C(short h3, short h2, short h1, short h0); Q6Vect64C::Q6Vect64C(signed char b7, signed char b6, signed char b5, signed char b4, signed char b3, signed char b2, signed char b1, signed char b0); Q6Vect64C::Q6Vect64C(const Q6Vect64C & v); Q6Vect64C::Q6Vect64C& operator = (const Q6Vect64C & v); Copy to clipboard #### Extract double-word Extract a double-word (either signed or unsigned) from a 64-bit vector and return it as a result value. long long Q6Vect64C::D(void); unsigned long long Q6Vect64C::UD(void); Copy to clipboard #### Extract word Extract a specified word (either signed or unsigned) from a 64-bit vector and return it as a result value. int Q6Vect64C::W0(void); int Q6Vect64C::W1(void); unsigned int Q6Vect64C::UW0(void); unsigned int Q6Vect64C::UW1(void); Copy to clipboard #### Extract half-word Extract a specified half-word (either signed or unsigned) from a 64-bit vector and return it as a result value. short Q6Vect64C::H0(void); short Q6Vect64C::H1(void); short Q6Vect64C::H2(void); short Q6Vect64C::H3(void); unsigned short Q6Vect64C::UH0(void); unsigned short Q6Vect64C::UH1(void); unsigned short Q6Vect64C::UH2(void); unsigned short Q6Vect64C::UH3(void); Copy to clipboard #### Extract byte Extract a specified byte (either signed or unsigned) from a 64-bit vector and return it as a result value. signed char Q6Vect64C::B0(void); signed char Q6Vect64C::B1(void); signed char Q6Vect64C::B2(void); signed char Q6Vect64C::B3(void); signed char Q6Vect64C::B4(void); signed char Q6Vect64C::B5(void); signed char Q6Vect64C::B6(void); signed char Q6Vect64C::B7(void); unsigned char Q6Vect64C::UB0(void); unsigned char Q6Vect64C::UB1(void); unsigned char Q6Vect64C::UB2(void); unsigned char Q6Vect64C::UB3(void); unsigned char Q6Vect64C::UB4(void); unsigned char Q6Vect64C::UB5(void); unsigned char Q6Vect64C::UB6(void); unsigned char Q6Vect64C::UB7(void); Copy to clipboard #### Set double-word Assign a double-word value to a 64-bit vector and return the modified vector as a result value. Q6Vect64C Q6Vect64C::D(long long d); Copy to clipboard #### Set word Assign a value to the specified word in a 64-bit vector and return the modified vector as a result value. Q6Vect64C Q6Vect64C::W0(int w); Q6Vect64C Q6Vect64C::W1(int w); Copy to clipboard #### Set half-word Assign a value to the specified half-word in a 64-bit vector and return the modified vector as a result value. Q6Vect64C Q6Vect64C::H0(short h); Q6Vect64C Q6Vect64C::H1(short h); Q6Vect64C Q6Vect64C::H2(short h); Q6Vect64C Q6Vect64C::H3(short h); Copy to clipboard #### Set byte Assign a value to the specified byte in a 64-bit vector and return the modified vector as a result value. Q6Vect64C Q6Vect64C::B0(signed char b); Q6Vect64C Q6Vect64C::B1(signed char b); Q6Vect64C Q6Vect64C::B2(signed char b); Q6Vect64C Q6Vect64C::B3(signed char b); Q6Vect64C Q6Vect64C::B4(signed char b); Q6Vect64C Q6Vect64C::B5(signed char b); Q6Vect64C Q6Vect64C::B6(signed char b); Q6Vect64C Q6Vect64C::B7(signed char b); Copy to clipboard ### Circular addressing To support data stream processing the Hexagon processor supports circular buffer addressing. Because it is difficult for compilers to generate efficient code for this address mode, the following intrinsics have been defined to efficiently support circular addressing: Q6_circ_load_update_XX Q6_circ_store_update_XX Copy to clipboard These intrinsics perform both the circular buffer access (load or store) and the updating of the circular buffer pointer. The pointer is updated with a constant increment/decrement value. Note The `_XX` suffix specifies the type of data accessed by the intrinsic (such as byte). The circular addressing intrinsics are accessed by including the `hexagon_protos.h` library file. For more information on circular addressing, see the *Qualcomm Hexagon Programmer’s Reference Manual* (see [References](https://docs.qualcomm.com/doc/80-N3040-23/topic/references.html)). **Example 1** The following example shows how the circular addressing intrinsics are used. #include #include void circular(int input_array[], int output_array[], int element_load[]) { int *p0 = &input_array[20]; int *p1 = output_array; int i; for (i = 0; i < 150; i++) { Q6_circ_load_update_W(element_load[i], p0, 1, 150, 8); } for (i = 0; i < 160; i++) { Q6_circ_store_update_W(i, p1, 1, 150, 8); } } #define N 150 int g_input_array[N] __attribute__((aligned(1024))); int g_output_array[N] __attribute__((aligned(1024))); //circular buffers should be global or static int main() { int i; int element_load[150]; for (i = 0; i < N; i++) { g_input_array[i] = i; } circular(g_input_array, g_output_array, element_load); printf("\n-----------element_load------------\n"); for (i = 0; i < 150; i++) { printf("%d; ", element_load[i]); if((i%15)==14) printf("\n"); } printf("\n-----------g_output_array------------\n"); for (i = 0; i < 150; i++) { printf("%d; ", g_output_array[i]); if((i%15)==14)printf("\n"); } printf("\n-----------end------------\n"); } Copy to clipboard - In the first for-loop of function `circular`, pointer `p0` is used to load array `element_load` with the contents of circular buffer `input_array`. - `input_array` is initialized with the values 0 to 149, and 150 circular loads are performed on it; however, because the circular loads start from the 21^st^ element in `input_array`, the values loaded into `element_load` initially range from 20 to 149, then (wrapping around to the front of `input_array`) continue from 0 to 19, as shown in [Example 2](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-circle-addr-ex2-bookmark). - In the second for-loop of function circular, pointer `p1` is used to store the current value of the loop variable into circular buffer `output_array`. - The circular stores write 160 elements, which is 10 more than the circular buffer length. Because of this, the circular stores first write the values 0 to 149 to `output_array` (starting at index 0), then wrap around to the front of `output_array` and overwrite its first 10 elements (index 0 to 9) with the values 150 to 159, as shown in [Example 2](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-circle-addr-ex2-bookmark). **Example 2** Following is an example of the program output generated by the program in [Example 1](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-circle-addr-ex1-bookmark). -----------element_load------------ 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; 101; 102; 103; 104; 105; 106; 107; 108; 109; 110; 111; 112; 113; 114; 115; 116; 117; 118; 119; 120; 121; 122; 123; 124; 125; 126; 127; 128; 129; 130; 131; 132; 133; 134; 135; 136; 137; 138; 139; 140; 141; 142; 143; 144; 145; 146; 147; 148; 149; 0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; -----------g_output_array------------ 150; 151; 152; 153; 154; 155; 156; 157; 158; 159; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; 101; 102; 103; 104; 105; 106; 107; 108; 109; 110; 111; 112; 113; 114; 115; 116; 117; 118; 119; 120; 121; 122; 123; 124; 125; 126; 127; 128; 129; 130; 131; 132; 133; 134; 135; 136; 137; 138; 139; 140; 141; 142; 143; 144; 145; 146; 147; 148; 149; -----------end------------ Copy to clipboard #### Circular load Load values from the circular buffer and update the circular buffer pointer. Q6_circ_load_update_XX( , , , , ); Copy to clipboard - The `_XX` suffix specifies the data type of the intrinsic (see [Data type specification](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-circle-addr-data-type-spec-sub-sub)). - The destination and buffer location pointer must be L-values. - The increment/decrement value must be specified as a signed constant value, with one array element considered as unity (in conformance with ANSI C pointer increments). The value must be in the range -8 … 7, and must have an absolute value less than the buffer length. - The buffer length specifies the number of data elements in the buffer, and can be specified by either a constant or a variable. The length can be between 3 and (128K-1) bytes. - The K1 value determines the maximum possible buffer length (that is, 2^K1^-1 elements, where 2^K1-1^ <= buffer length <= 2^K1^-1). - The intrinsic behavior is undefined if the specified K1 value is incompatible with the circular buffer length. - If the circular load intrinsic is used only to increment the circular buffer pointer (that is, a *dummy* load), the destination variable must be declared `volatile` to prevent the compiler from optimizing away the intrinsic call. **Example** For an example of a circular load, consider the variable `input_array`, which is a circular buffer of 150 integer elements. Access from the first element (`input_array[0]`) to the 150^th^ element (`input_array[149]`) is to be circular, with access initially starting from the 21^st^ element (`input_array[20]`). The pointer initialization statement would appear as follows: int *p0 = &input_array[20]; Copy to clipboard This C statement initializes the buffer location pointer (which will be used to perform circular access on the buffer) to the address of the 21^st^ element of `input_array`. The circular load statement would appear as follows: Q6_circ_load_update_W(x, p0, 1, 150, 8); Copy to clipboard This C statement loads the data currently pointed by the pointer variable `p0` into the integer variable `x`. The load intrinsic circularly post-increments the pointer variable by 1 (that is, by one unit of the `input_array` base type `(int)`). The circular buffer in the example has the following properties: - Buffer start address `= &input_array[0]`, because the current location that `p0` points to (that is, `element input_array[20]`) has element `input_array[0]` as the closest memory location that is aligned to 1024 bytes (the alignment requirement for circular buffer input\_array; see [Circular buffer alignment](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-circle-addr-circular-buff-align-sub-sub)), and that appears at or before it. - Buffer length = 150 integer words = 150 \(\times\) 4 bytes If the increment/decrement value is a positive number, a circular post-increment is performed. If it is a negative number, a circular post-decrement is performed. If the circular pointer increment/decrement is not required at the access point, the increment/decrement value can be specified as zero: Q6_circ_load_update_W(x, p0, 0, 150, 8) Copy to clipboard The buffer length can be a variable, but must have a known upper bound. In this case, the K1 value is based on the upper bound of the buffer length. For example, `Q6_circ_load_update_W(x, p0, 1, y, 8)` specifies that the buffer length variable `y` can specify a maximum length of 255 elements (since the K1 value is 8). The `K1` value field is redundant if the buffer length is constant, but it still must be assigned a valid K1 value. Note Substituting `element_load[i]` for the `x` parameter makes this example identical to part of the program in [Example 1](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-circle-addr-ex1-bookmark). #### Circular store Store value to circular buffer and update circular buffer pointer. Q6_circ_store_update_XX( , , , , ); Copy to clipboard - The `_XX` suffix specifies the data type of the intrinsic (see [Data type specification](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-circle-addr-data-type-spec-sub-sub)). - The source expression specifies the value to be stored. - The buffer location pointer must be an L-value. - The increment/decrement value must be specified as a signed constant value, with one array element considered as unity (in conformance with ANSI C pointer increments). The value must be in the range -8 … 7, and it must have an absolute value less than the buffer length. - The buffer length specifies the number of data elements in the buffer, and can be specified by either a constant or a variable. The length can be between 3 and (128K-1) bytes. - The K1 value determines the maximum possible buffer length (that is, 2^K1^-1 elements, where 2^K1-1^ <= buffer length <= 2^K1^-1). Note The intrinsic behavior is undefined if the specified K1 value is incompatible with the circular buffer length. **Example** For an example of a circular store, consider the variable `output_array`, which is a circular buffer of 150 integer elements. Access from the first element (`output_array[0]`) to the 150^th^ element (`output_array[149]`) is to be circular, with access initially starting from the first element (`output_array[0]`). The pointer initialization statement would appear as follows: int *p1 = output_array[0]; Copy to clipboard This C statement initializes the buffer location pointer (that will be used to perform circular access on the buffer) to the address of the first element of `output_array`. The circular store statement would appear as follows: Q6_circ_store_update_W(x, p1, 1, 150, 8); Copy to clipboard This C statement loads the data currently pointed by the pointer variable `p1` into the integer variable `x`. The store intrinsic circularly post-increments the pointer variable by 1 (that is, by one unit of the `output_array` base type `(int)`). The circular buffer in the example has the following properties: - Buffer start address = `&output_array[0]`, because the current location that `p1` points to (element `output_array[0]`) has element `output_array[0]` as the closest memory location that is aligned to 1024 bytes (the alignment requirement for circular buffer `output_array`; see [Circular buffer alignment](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-circle-addr-circular-buff-align-sub-sub)), and that appears at or before it. - Buffer length = 150 integer words = 150 \(\times\) 4 bytes If the increment/decrement value is a positive number a circular post-increment is performed. If it is a negative number a circular post-decrement is performed. If the circular pointer increment/decrement is not required at the access point, then the increment/decrement value can be specified as 0: Q6_circ_store_update_W(x, p1, 0, 150, 8) Copy to clipboard The buffer length can be a variable, but must have a known upper bound. In this case, the K1 value is based on the upper bound of the buffer length. For example, `Q6_circ_store_update_W(x, p1, 1, y, 8)` specifies that the buffer length variable y can specify a maximum length of 255 elements (since the K1 value is 8). The `K1` value field is redundant if the buffer length is constant, but still must be assigned a valid K1 value. Note Substituting `i` for the `x` parameter makes the preceding example identical to part of the program in [Example 1](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-circle-addr-ex1-bookmark). #### Data type specification The Hexagon processor can perform memory accesses with different data types. The data type (size, signed/unsigned, and byte positions) is an important aspect in determining the correct assembly instruction for circular access. Therefore a data type suffix is appended to the name of the circular load/store intrinsics: - The suffix B, H, UB, UBH, UH, W, or D is appended to the name of the circular load intrinsic. - The suffix B, HL, HH, W, or D is appended to the name of the circular store intrinsic. The following table lists the names of the specific circular load intrinsics. | Intrinsic name | Memory size | | --- | --- | | `Q6_circ_load_update_UB` | 8-bit, with zero extension to 32 bits | | `Q6_circ_load_update_B` | 8-bit, with sign extension to 32 bits | | `Q6_circ_load_update_UH` | 16-bit, with zero extension to 32 bits | | `Q6_circ_load_update_H` | 16-bit, with sign extension to 32 bits | | `Q6_circ_load_update_UBH` | Currently unused | | `Q6_circ_load_update_W` | 32-bit, with all bits loaded | | `Q6_circ_load_update_D` | 64-bit, with all bits loaded | Two versions of the UBH data type exist: one returns a 32-bit result, the other a 64-bit result. This would normally present a problem for C. However, because the UBH types specify vector operations and circular/bit-reversed addressing cannot be vectorized, the UBH data type is ignored in this version. The following table lists the names of the specific circular store intrinsics. | Intrinsic name | Memory size | | --- | --- | | `Q6_circ_store_update_B` | 8-bit | | `Q6_circ_store_update_HL` | 16-bit, store lower half (bits 15:0) | | `Q6_circ_store_update_HH` | 16-bit, store upper half (bits 31:16) | | `Q6_circ_store_update_W` | 32-bit | | `Q6_circ_store_update_D` | 64-bit | #### Circular buffer alignment To support circular addressing, circular buffers must be properly aligned in memory. Alignment is performed with the aligned attribute. For example: int circ_buffer[150] attribute ((aligned(1024))); Copy to clipboard A circular buffer is properly aligned when its starting byte address is an integral multiple of the closest power-of-2 value larger than the buffer size (in bytes). For example, the circular buffer declared in the example is aligned to 1024 bytes because the buffer size is 600 bytes (150 integer words \(\times\) 4 bytes), and 1024 is the next power of 2 above 600. The alignment can be expressed in terms of K1 values (see [Circular load](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-circle-addr-circular-load-sub-sub)): - 2^K1+3^ for 8-byte data types (such as `long long`) - 2^K1+2^ for 4-byte data types (such as `integer`) - 2^K1+1^ for 2-byte data types (such as `short`) - 2^K1^ for 1-byte data types (such as `char`) Circular buffers can be set up on portions (or *slices*) of an array as long as the buffers themselves are properly aligned. For example, consider the following array: int big_array[1600] attribute ((aligned(1024))); Copy to clipboard Given the alignment of big\_array, it is possible to allocate circular buffers of length 150 integer words (600 bytes) at each location in big\_array that has an alignment equal to 1024 bytes, as shown in the following figure. ![../../_images/libraries_circular_buffer_align.png](data:image/png;base64,UklGRhwyAABXRUJQVlA4TA8yAAAvvIFqAFWLg7aRJCkV/qx3964/ABGhsG3bRk7SvXsFL+UjIgWpPkCDzIPyYkn1tDwsyd+J/Dss3Ymqq4mUcGqihWp6EzEw0XDvubmGhp34p/k1UdgXWOP/l+XazgnF0NBQITgEQ0NBQ0NDwwMNHcKDgoYPPnjggxde+Nip2uv3/6+hd6/euzzbF6tqo4OUhaGYXxZNOotdpRCcgTJRJkrAw01A5UkR9F3ohNFhNNMLQ+g4Eu0kXjVTdQYdgTY6QXiQhzw6Bg+bSqDTUEdhPL7hMg9vjEPU0xsD6KobRMNb62YgD1R5eFASFwvsLDwIXn4COAkoBpGdya2GHt/kABSAq8HNQ+W0tva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SXC96ykTDSIZE4qsCGqyDJarwJ+528VhsK2vi4iroIvD8hQddAn+OblIXUibPZGOs96g4kRS4k4NMqekC7hXk+BSrgsiGRMRWTEicCUhza6wXBdYLcuzI+3SsM9sz+iilqcAl9ilDPJEiLVTG4oD9jtRqDiAsUjfTdKtlPt2pLTx2IET1kXhufDsO0ZIbkmv+eIVB+KXipRicxgFZbngl2q+k1jYHt1P38ut1QhJHQPskVepywABi2MsxtokshNeRfU77zVXB/Cvh6FyFGe7HdKIsbkeFzDMekiss3CzPtDI4cexAcNNvkhPqbp2MX0aHzBk0bSkkeQi0jd76Lxcf3WwQ1THECJwc91sBpqlFuJec7mhqMDO/9XPdqrdLF1taJZrLTcUFZgfDutnO7jTbVZYbcjYckMNnU1fP9twotvMr7YBaRDmlhuKA1yoYG65oTjA+IjAVcwtNxQH8GMK7VKaW24oHjTLT2RwuaGY0Ky8aa9ZFBeaDZG6lo8j+Fqu3BALmiexjot5rGM8jHVsbcY6Dk6/p0jzcBgWLjUvi4NxHbF5qd0c57aD01jHxTz2oN38vbs3DwA=) In this case, when multiple circular buffer start addresses potentially exist within an array, an arbitrary pointer variable used for circular buffer access will always wrap around to the most recently preceding circular buffer start address, as shown in figure above. Therefore circular buffers are feasible within an array only under the following conditions: - The buffer start address is one of the possible buffer start addresses - The buffer size (in bytes) is less than the buffer alignment value Note Because variables allocated in the stack should have an alignment of 8 bytes or less, circular buffers (in most cases) must be declared either as global variables or (if declared locally within a function) as static. #### Special issues Exceptional cases may arise if ordinary pointer arithmetic is performed on the C pointer variable used for circular accesses. Whenever ordinary pointer arithmetic is performed on the pointer variable, the pointer update no longer occurs in the modulo-wrap around fashion. If the pointer arithmetic (such as p = p + 256, where `p` is a pointer to `int` on a buffer of 600 bytes, as shown in the following figure) adds a value that makes the pointer point to a location outside the intended circular buffer, the subsequent circular load/store would access data from a new invalid circular buffer. ![../../_images/libraries_invalid_buffer_access.png](data:image/png;base64,UklGRoolAABXRUJQVlA4TH0lAAAv/sFXAB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sfDriVprqIivxOElbOkfYMy8uymzzMAJLoTfyTOaabeM5VQPdASKOKLwEr6+ivbhurws2Oh3VUBx5wvPtCsDVgRA4SWMNYx3VHLOf+T8CQsodli+B+UmjC4JEyK4IgAKLyHMivjCJK1ZmGsCFKPlNSRERSL09URUJNQCoCIdn4FJ34VXbrMkHj2c0SEv6Sb9EDMT90a/JiXuRmLGkhzAjX+Eck5oxRob4lpi1sMW12aPJJK/MgJ6XAv9mIXWlgXyhcWhpposUIxrcUpFf1oZNOb5hjuGydd42NC45KihFtaQnwcT2RznSoHe7N4qPEZVJih1vJaAcJULcR6E/0f6U4059O0s5GSWGzUUC0YZQTfkTAfKiGc6AoVAwCwIVxUqZkMCvFniy0A928j6WOHAwrjkqCE8yogjHltQS8QKURd17Tq4DcImKkWZxwwUThLGn2QRKHQzTjeCEHaKiwOJUUP4i4uyYIWiRLmZeLK/IRaGhJohMWpI8MVFyGy9OW6EBgqjuqjIS1jUEu205aWJ7LmAUq3JI9k8TqCorUsariPBiuki86RvA8BizCSebA8gaFypkoTtFYIXtuwShJwgxqrl/TQ04h+DWguYXRMAPZwBWzYn/9Ia9nyP0u/20AQ60kny2dIRbN2mpF5R5gQ92r6VefNM8ONjTvz5hn/4052UK3qHBrc5CacrTDbTPT+0VPNs71F/JUyiPh1Wu60sO93P1FQalx8/ZmrMVZZVxqQlNhdflBdjLpKsvRtjBoeMdjPG9JJMmUOUOSpUbw5xk2OZh7m3iLDGeExyLD3osw6Vwk33g4sc24zZGk3YRJeVxgxyzAwzoRS62e6x7bSNgOLeEF7xtYQ0/b1CpagtoChRW2mE9T0CiX+h+T/+e5X/vMp/Xp6el/SXV/lP4UMA) #### Mapping intrinsics to assembly code The `Q6_circ_load_update_W(x,p,8,24,5)` intrinsic translates to the following assembly code sequence: R1.H = #0x5000; R1.L = #96; M1 = R1; R0 = MEMW(R2++#32):circ(M1); // Word load with post-update of 32 Copy to clipboard This example sets up a 12 \(/times\) 4` byte circular buffer. The length must be set to 96. The closest power-of-2 size larger than 96 is 128. The K1 value is set to 5. The Modifier register used is `M1`. The base address register used is `R2`. However, any other allowed modify registers and address registers can be used, respectively. The circular buffer must be aligned on a 128-byte boundary. ### Bit-reversed addressing To support Viterbi encoding and fast Fourier transforms (FFT) the Hexagon processor supports bit-reversed addressing. Because it is difficult for compilers to generate efficient code for this address mode, the following intrinsics have been defined to efficiently support bit-reversed addressing: - `Q6_bitrev_load_update_XX` - `Q6_bitrev_store_update_XX` These intrinsics perform both the bit-reversed buffer access (load or store) and the updating of the bit-reversed buffer pointer. The bit-reversed addressing intrinsics are accessed by including the `hexagon_protos.h` library file. **Example 1** This example shows how the bit-reversed addressing intrinsics are used. #include #include void bitrev(int input_array[], int output_array[], int element_load[]) { int *p0 = input_array; int *p1 = output_array; int i; for (i = 0; i < 256; i++) { Q6_bitrev_load_update_W(element_load[i], p0, 8); } for (i = 0; i < 256; i++) { Q6_bitrev_store_update_W(element_load[i], p1, 8); } } #define N 256 int g_input_array[N] __attribute__((aligned(1<<16))); int g_output_array[N] __attribute__((aligned(1<<16))); //bit-reversed buffers should be global or static int main() { int i; int element_load[256]; for (i = 0; i < N; i++) { g_input_array[i] = i; } bitreverse(g_input_array, g_output_array, element_load); printf("\n-----------element_load------------\n"); for (i = 0; i < 256; i++) { printf("%d; ", element_load[i]); if((i%16)==15) printf("\n"); } printf("\n-----------output_array------------\n"); for (i = 0; i < 256; i++) { printf("%d; ", g_output_array[i]); if((i%16)==15)printf("\n"); } printf("\n-----------end------------\n"); } Copy to clipboard In the first for-loop of function `bitreverse` (shown in [Example 1](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-bit-reverse-addr-ex1-bookmark)), pointer `p0` is used to load array element\_load with the bit-reversed contents of array input\_array. `input_array` was initialized with the values 0 to 255, so `element_load` contains the bit- reversed values of the sequence 0 to 255, as shown in [Example 2](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-bit-reverse-addr-ex2-bookmark). In the second for-loop of `bitreverse`, pointer `p1` is used to store the bit-reversed contents of `element_load` into array `output_array`. Because the contents of `element_load` are already bit-reversed, `output_array` ends up containing the original sequence 0 to 255, as shown in [Example 2](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-bit-reverse-addr-ex2-bookmark). **Example 2** This example shows the program output generated by the program in [Example 1](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-hex-spec-bit-reverse-addr-ex1-bookmark). -----------element_load------------ 0; 128; 64; 192; 32; 160; 96; 224; 16; 144; 80; 208; 48; 176; 112; 240; 8; 136; 72; 200; 40; 168; 104; 232; 24; 152; 88; 216; 56; 184; 120; 248; 4; 132; 68; 196; 36; 164; 100; 228; 20; 148; 84; 212; 52; 180; 116; 244; 12; 140; 76; 204; 44; 172; 108; 236; 28; 156; 92; 220; 60; 188; 124; 252; 2; 130; 66; 194; 34; 162; 98; 226; 18; 146; 82; 210; 50; 178; 114; 242; 10; 138; 74; 202; 42; 170; 106; 234; 26; 154; 90; 218; 58; 186; 122; 250; 6; 134; 70; 198; 38; 166; 102; 230; 22; 150; 86; 214; 54; 182; 118; 246; 14; 142; 78; 206; 46; 174; 110; 238; 30; 158; 94; 222; 62; 190; 126; 254; 1; 129; 65; 193; 33; 161; 97; 225; 17; 145; 81; 209; 49; 177; 113; 241; 9; 137; 73; 201; 41; 169; 105; 233; 25; 153; 89; 217; 57; 185; 121; 249; 5; 133; 69; 197; 37; 165; 101; 229; 21; 149; 85; 213; 53; 181; 117; 245; 13; 141; 77; 205; 45; 173; 109; 237; 29; 157; 93; 221; 61; 189; 125; 253; 3; 131; 67; 195; 35; 163; 99; 227; 19; 147; 83; 211; 51; 179; 115; 243; 11; 139; 75; 203; 43; 171; 107; 235; 27; 155; 91; 219; 59; 187; 123; 251; 7; 135; 71; 199; 39; 167; 103; 231; 23; 151; 87; 215; 55; 183; 119; 247; 15; 143; 79; 207; 47; 175; 111; 239; 31; 159; 95; 223; 63; 191; 127; 255; -----------output_array------------ 0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93; 94; 95; 96; 97; 98; 99; 100; 101; 102; 103; 104; 105; 106; 107; 108; 109; 110; 111; 112; 113; 114; 115; 116; 117; 118; 119; 120; 121; 122; 123; 124; 125; 126; 127; 128; 129; 130; 131; 132; 133; 134; 135; 136; 137; 138; 139; 140; 141; 142; 143; 144; 145; 146; 147; 148; 149; 150; 151; 152; 153; 154; 155; 156; 157; 158; 159; 160; 161; 162; 163; 164; 165; 166; 167; 168; 169; 170; 171; 172; 173; 174; 175; 176; 177; 178; 179; 180; 181; 182; 183; 184; 185; 186; 187; 188; 189; 190; 191; 192; 193; 194; 195; 196; 197; 198; 199; 200; 201; 202; 203; 204; 205; 206; 207; 208; 209; 210; 211; 212; 213; 214; 215; 216; 217; 218; 219; 220; 221; 222; 223; 224; 225; 226; 227; 228; 229; 230; 231; 232; 233; 234; 235; 236; 237; 238; 239; 240; 241; 242; 243; 244; 245; 246; 247; 248; 249; 250; 251; 252; 253; 254; 255; -----------end------------ Copy to clipboard #### Bit-reversed load Load value from bit-reversed buffer and update bit-reversed buffer pointer. Q6_bitrev_load_update_XX( , , ); Copy to clipboard - The `_XX` suffix specifies the data type of the intrinsic (see [Data type specification](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-bit-reverse-data-type-spec-sub-sub)). - The destination and buffer location pointer must be L-values. - The buffer length specifies the number of data elements in the buffer, and can be specified by either a constant or a variable. The length must be an integral power of 2, with a maximum length of 64K bytes. **Example** For example, consider the following bit-reversed buffer: int input_array[256] __attribute__((aligned(1<<16))); Copy to clipboard Access from the first element (`input_array[0]`) to the 256^th`^ element (`input_array[255]`) is to be bit-reversed, with access initially starting from the first element (`input_array[0]`). The pointer initialization statement will appear as follows: int *p = &input_array[0]; Copy to clipboard This C statement initializes the buffer location pointer (which will be used to perform bit-reversed access on the buffer) to the address of the first element of `input_array`, with the least-significant 16 bits of the address value bit-reversed. Note Because `input_array` is aligned on a 64K byte boundary (see [Bit-reversed buffer alignment](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-circle-addr-bit-reverse-buff-align-sub-sub)) the least-significant 16 bits of the buffer location pointer’s initial value are all set to zero. Bit- reversing all zeros yields all zeros; therefore the C statement shown does in fact generate the value described in the preceding paragraph. The bit-reversed load statement will appear as follows: Q6_bitrev_load_update_W(x,p,8); Copy to clipboard This C statement loads the data from an address created by bit-reversing the least-significant 16 bits of the buffer location pointer, and then updates the buffer location pointer by post-incrementing it by the fixed value Mt. The auto-increment value Mt is determined from the size (in bytes) of the bit-reversed buffer. In the example, the load intrinsic post-increments by the following amount: Mt = 1 << (16 - log2(256 x 4)) = 1 << (16 -10) = 1 << 6 = 64 bytes Copy to clipboard Note It is not possible to perform bit-reversed access without changing the buffer location pointer. Normal loads and stores cannot be performed using the buffer location pointer when the buffer length is large enough that the value of Mt is less than the byte alignment required for a normal load or store. Otherwise the buffer location pointer would be incremented by the value in Mt, which in turn could lead to address values that work for the bit-reversed loads and stores but not for normal loads and stores (which are subject to the alignment restrictions). For example, a normal load or store on a long long data element requires an address alignment of 8 bytes. To ensure that this alignment always exists in a buffer location pointer, the bit-reversed buffer length must not be greater than 1024 `long long` data elements: Mt = 1 << (16 - log2(1024 x 8)) = 1 << (16 -13) = 1 << 3 = 8 bytes Copy to clipboard #### Bit-reversed store Store value to bit-reversed buffer and update bit-reversed buffer pointer. Q6_bitrev_store_update_XX( , , ); Copy to clipboard - The `_XX` suffix specifies the data type of the intrinsic (see [Data type specification](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-bit-reverse-data-type-spec-sub-sub)). - The source expression specifies the value to be stored. - The buffer location pointer must be an L-value. - The buffer length specifies the number of data elements in the buffer, and can be specified by either a constant or a variable. The length must be an integral power of 2, with a maximum length of 64K bytes. **Example** For example, consider the following bit-reversed buffer: int output_array[256] __attribute__((aligned(1<<16))); Copy to clipboard Access from the first element (`output_array[0]`) to the 256th element (`output_array[255]`) is to be bit-reversed, with access initially starting from the first element (`output_array[0]`). The pointer initialization statement will appear as follows: int *p = &output_array[0]; Copy to clipboard This C statement initializes the buffer location pointer (which will be used to perform bit- reversed access on the buffer) to the address of the first element of `output_array`, with the least-significant 16 bits of the address value bit-reversed. Note Because output\_array is aligned on a 64K byte boundary ([Bit-reversed buffer alignment](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-circle-addr-bit-reverse-buff-align-sub-sub)) the least-significant 16 bits of the buffer location pointer’s initial value are all set to zero. Bit- reversing all zeros yields all zeros; therefore the C statement shown does in fact generate the value described in the preceding paragraph. The bit-reversed store statement will appear as follows: Q6_bitrev_store_update_W(x,p,8); Copy to clipboard This C statement stores the data to an address created by bit-reversing the least-significant 16 bits of the buffer location pointer, and then updates the buffer location pointer by post-incrementing it by the fixed value Mt. The auto-increment value Mt is determined from the size (in bytes) of the bit-reversed buffer. In the example, the store intrinsic post-increments by the following amount: Mt = 1 << (16 - log2(256 x 4)) = 1 << (16 -10) = 1 << 6 = 64 bytes Copy to clipboard Note It is not possible to perform bit-reversed access without changing the buffer location pointer. Normal loads and stores cannot be performed using the buffer location pointer when the buffer length is large enough that the value of Mt is less than the byte alignment required for a normal load or store. For more information, see [Bit-reversed load](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-circle-addr-bit-reverse-load-sub-sub). #### Data type specification The Hexagon processor can perform memory accesses of different data types. The data type (size, signed/unsigned, and byte positions) is an important aspect in determining the correct assembly instruction for bit-reversed access. Therefore a data type suffix is appended to the name of the bit-reversed load/store intrinsics: - The suffix B, H, UB, UBH, UH, W, or D is appended to the name of the bit-reversed load intrinsic. - The suffix B, HL, HH, W, or D is appended to the name of the bit-reversed store intrinsic. The following table lists the names of the specific bit-reversed load intrinsics. | Intrinsic name | Memory size | | --- | --- | | `Q6_bitrev_load_update_UB` | 8-bit, with zero extension to 32 bits | | `Q6_bitrev_load_update_B` | 8-bit, with sign extension to 32 bits | | `Q6_bitrev_load_update_UH` | 16-bit, with zero extension to 32 bits | | `Q6_bitrev_load_update_H` | 16-bit, with sign extension to 32 bits | | `Q6_bitrev_load_update_UBH` | Currently unused | | `Q6_bitrev_load_update_W` | 32-bit, with all bits loaded | | `Q6_bitrev_load_update_D` | 64-bit, with all bits loaded | Two versions of the UBH data type exist: one returns a 32-bit result and the other returns a 64-bit result. This would typically present a problem for C. However, because the UBH types specify vector operations and circular/bit-reversed addressing cannot be vectorized, the UBH data type is ignored in this version. The following table lists the names of the specific bit-reversed store intrinsics. | Intrinsic name | Memory size | | --- | --- | | `Q6_bitrev_store_update_B` | 8-bit | | `Q6_bitrev_store_update_HL` | 16-bit, store in lower half (bits 15:0) | | `Q6_bitrev_store_update_HH` | 16-bit, store in upper half (bits 31:16) | | `Q6_bitrev_store_update_W` | 32-bit | | `Q6_bitrev_store_update_D` | 64-bit | #### Bit-reversed buffer alignment To support bit-reversed addressing bit-reversed buffers must be properly aligned in memory. Alignment is performed with the aligned attribute. For example: int input_array[256] __attribute__((aligned(1024))); Copy to clipboard A bit-reversed buffer is properly aligned when its starting byte address is aligned to a power of 2 greater than or equal to the buffer size (in bytes). For example, the bit-reversed buffer declared in the example is aligned to 1024 bytes because the buffer size is 1024 bytes (256 integer words \(\times\) 4 bytes), and 1024 is an integral power of 2. The buffer location pointer for a bit-reversed buffer must be initialized so the least-significant 16 bits of the address value are bit-reversed. However, the C language offers no simple way to express a pointer value with its least-significant 16 bits bit-reversed. Note To simplify the initialization of the bit-reversed pointer, bit-reversed buffers can be aligned to a 64K-byte boundary. This has the advantage of allowing the bit-reversed pointer to be initialized to the base address of the bit-reversed buffer, with no bit-reversing required for the least-significant 16 bits of the pointer value (which are all set to 0 by the 64K alignment). Variables allocated in the stack should have an alignment of 8 bytes or less. In most cases, bit- reversed buffers must be declared either as global variables or (if declared locally within a function) as static. #### Special issues Exceptional cases might arise if ordinary pointer arithmetic is performed on the C pointer variable used for bit-reversed accesses. If the pointer arithmetic adds a value that makes the pointer point to a location outside the intended bit-reversed buffer, the subsequent bit- reversed load/store accesses data from a new invalid buffer. For more information, see the *Qualcomm Hexagon Programmer’s Reference Manual* (see [References](https://docs.qualcomm.com/doc/80-N3040-23/topic/references.html)). Note A pointer used for bit-reversed addressing is not a valid pointer for any other purpose. Therefore, performing any pointer arithmetic on it outside of the bit-reversed intrinsics (except for adding or subtracting a multiple of Mt) is inherently not useful and should therefore be avoided. #### Mapping intrinsics to assembly code The `Q6_bitrev_load_update_W(x,p,4)` intrinsic translates to the following assembly code sequence: R1 = 512; M0 = R1; R0 = MEMW(R2++M0:brev); Copy to clipboard This sequence example sets up a 32 (2^4^) \(\times\) 4 byte buffer where bit-reversed access will be performed. The Modifier register used is `M0`. The Base Address Register used is `R2`. The Modifier setting is: M0 = 1 << (16 - log2(32 x 4)) = 1 << (16 -7) = 1 << 9 = 512 Copy to clipboard However, any other allowed modify registers and address registers can be used respectively. Use the alignment language extensions to perform any buffer alignment requirements. ### Circular intrinsics The Hexagon processor provides hardware-level support for implementing circular buffer addressing. Because it is difficult for compilers to generate efficient code for these features, the C language has been extended with the following intrinsics to efficiently support circular addressing: Q6_circ_load_update Q6_circ_store_update Copy to clipboard These intrinsics perform as an atomic operation on both the buffer access (load or store) and the updating of the buffer pointer. The circular buffer addressing intrinsics are accessed by including the `hexagon-clang_protos.h` library file. ### Simulation timer (hexagon\_sim\_timer.h) The Hexagon processor simulator supports a timer interface that allows you to collect timing information on the execution of target applications. The timer interface functions are accessed by including the hexagon\_sim\_timer.h library file. For more information, see the *Qualcomm Hexagon Simulator User Guide* (80-N2040-17). ## HVX-specific library The HVX-specific library supports the following operations: - Instruction access - Vector access - Vector initialization - Vector assignment These operations are supported in the `hvx_hexagon_protos.h` library. ### Instruction access To support efficient coding of the time-intensive sections of a program (without resorting to inline assembly language), the LLVM compiler provides intrinsics that are used to directly access HVX instructions. The instruction intrinsics are accessed by including the `hvx_hexagon_protos.h` library file. The following example shows how intrinsics are used to initialize two HVX vectors and directly access the `ALU-DOUBLE-RESOURCE` instruction, `Vdd=vcombine(Vu,Vv)`: #include int main() { HVX_Vector v1, v2; HVX_VectorPair result; // initialize vectors v1 and v2 v1 = Q6_V_vzero(); v2 = Q6_V_vzero(); // combine v1 and v2 into vector pair result = Q6_W_vcombine_VV(v1,v2); } Copy to clipboard Intrinsics are defined for most of the HVX processor instructions. For more information see the *Qualcomm Hexagon HVX Programmer’s Reference Manual* (see [References](https://docs.qualcomm.com/doc/80-N3040-23/topic/references.html)). ### Vector access To support efficient coding of vector operations, the LLVM compiler provides intrinsics that are used to read the individual vectors from a vector pair. The vector access intrinsics are accessed by including the `hvx_hexagon_protos.h` header file. The following example shows how intrinsics are used to read the low and high vectors from a vector pair: #include int main() { HVX_Vector v1, v2; HVX_VectorPair vp; // read low-order vector from vector pair v1 = Q6_V_lo_W(vp); // read high-order vector from vector pair v2 = Q6_V_hi_W(vp); } Copy to clipboard The following figure shows how vectors are accessed in a vector pair. ![../../_images/libraries_vector_access_hvx.png](data:image/png;base64,UklGRjADAABXRUJQVlA4TCQDAAAv0gETAM/BJrJtJ+cHqLKDnFGABNCDNarYUuYKL9hgG9m2kvM1QkMyJ/oV0IJ3SwdUQEQjLoxq21Zy/kdGWsIhAQ0IzKKBDd3ndPD5D+D//yzPYBiNFzkMo3FDm2l1ptVt1wUSOLREWMGCBg8NKlyQe5ngAAMmQIkNN4AUJBoi5f8TwtcDyCQ1qACHD2itCtIH7JgxGY3WqmNvZUyoQIlOAAY0JRxGflDYk4Yfn2gHb5UY/ggkWtvWtg1f0u2ByfIeqI2ULuyEulT3f2fwQxf6D8qM6D8EtZEkSU7IYRKqiTpm9qggH4DnfaOeCzGuMBWHXcApJ3yoP6AZaBB1kdKpELbMIDucO0YCU2vGlX8HGDK2XlV/IE/sNag6ovRChsNVZEQ7nH846xQ5Ge3oe+BqF51jIeHe7jVQb+qlBlVHlaLUSOxdB4rOol7qZqCNx8jk94ajIuCJ1MWShEKJQfcuf6YyPrP0GfGrs4BRTlHSaSqjg95XUj236Z8sPjXDKplSxGWi1KhAXylPyTcC/f2P0k6AVDkNURcpDaJKbthj9bj+wnh85nzJMuf0Hd/x+oTxJXu1zhsBvmP9BnzH8ficOkYokCssJyy7mPgKxQmbJ39+D5fka8UTKnLWwDGMiq/fXCeI7A5TixTNkB2udsRtQ5w1GZP5kkWX5J2hXoTZVpgSC6ETYjwTMmFR+iaEZQAj4WxIyJrMl4xaWboDXDi75LHOhjPlzoZVbFEKp/sTAzSDm4HOn7yXrHPJVz8uNahFySj6JmFRam+F4qDsLhTyJ+cl62AZuPopQXcKIZlfiaSolI7TDCu073cdIPMli6wsHcIQ38zUJxseu7+5G1exRWnqy5wMA4B8h3VmyQrk72EA+f493Jkl66X/tXqWi15qNu2llvA+Gi/0cv2lzCNzTt9xHgXTUKDI43h8gQN+Ggo0A11+iaWGAuUHBw0FNNCe3wkJoqQZ6KCl7MocNBSA54P2GtoJ6sXWI0svMdBQgDABjArCDgFVesMYaCiQSk75VIRw0FAAcbm9FYfLH72Ffx/t5HfDHioBntehl5pN70Us4QA=) ### Vector initialization To support efficient initialization of vectors, the LLVM compiler provides a dedicated intrinsic for setting a vector to zero. The vector initialization intrinsic is accessed by including the `hvx_hexagon_protos.h` header file. The following example shows how the vector initialization intrinsic is used: #include int main() { HVX_Vector v1; // initialize vector v1 to zero v1 = Q6_V_vzero(); } Copy to clipboard ### Vector assignment To support efficient assignment of vectors, the LLVM compiler provides a dedicated intrinsic for assigning values between two vector pairs. The following example shows how the vector assignment intrinsic is used: #include int main() { HVX_VectorPair vp1, vp2; // assign vp1 = vp2 vp1 = Q6_W_equals_W(vp2); } Copy to clipboard ## Hexagon intrinsics emulation library The intrinsics emulation library emulates Hexagon processor instruction intrinsics (see [Hexagon-specific libraries](https://docs.qualcomm.com/doc/80-N3040-23/topic/libraries.html#hccpp-libraries-hex-spec)) on non-Hexagon processor target platforms. The library (named libnative) allows developers to compile a C or C++ program that contains intrinsics into a native Linux or Windows executable. This enables code portability, easier debugging, and a more efficient development work flow for Hexagon processor applications. The library is included in the tools release in the `Tools/libnative/lib` directory. ### Application build procedure The intrinsics emulation library enables Hexagon processor C or C++ applications to be compiled into Linux or Windows binaries. Therefore, to use the library a native compiler (such as GCC) must be used to build the applications. To successfully compile the intrinsics, the compiler must include the header file `hexagon_protos.h` from directory `Tools/libnative/include`, and the linker must include `libnative` from `Tools/libnative/lib`. This is done by passing the following three command line options to the native compiler: -Itools_dir/Tools/libnative/include -Ltools_dir//Tools/libnative/lib -lnative -lm Copy to clipboard For example, the following command uses GCC to compile an application file `foo.c` that includes calls to Hexagon instruction intrinsics: gcc -Itools_dir/Tools/libnative/include foo.c \ -Ltools_dir/Tools/libnative/lib -lnative -lm Copy to clipboard The linker options in this example (`-L`, `-lnative`, `-lm`) must follow any source files specified on the compiler command line. The `-lm` option is required for floating-point support on Linux only. Starting from v79, the `HVX_Vector` type is 160 Bytes. The representation of a register internally has changed. `HVX_Vector` will have 128 Bytes of vector elements and an additional 32 Bytes to maintain an internal state. | 128 Bytes | 32 Bytes | | --- | --- | Similarly, `HVX_VectorPair` is of size 320 Bytes as represented below. | 128 Bytes | 32 Bytes | 128 Bytes | 32 Bytes | | --- | --- | --- | --- | Any existing code should be backward compatible with the change in size of the type `HVX_Vector`/`HVX_VectorPair` unless the code either relies on size of these types or copying data in to these types not accounting for the extra 32 Bytes. The additional 32 Bytes need to be initialized to 0x0A per Byte. ### Restrictions The intrinsics emulation library has the following restrictions on its use: - It is not intended for performance modeling, because the emulation does not accurately represent how the Hexagon processor core actually operates. It is thus best suited for tasks such as unit testing, or to facilitate porting of code from a PC platform to the Hexagon processor. - It supports only the intrinsics that specify instructions directly supported by the Hexagon processor. In particular, it does not support instructions that the assembler maps to an equivalent assembly instruction; for instance, the comparison instruction (`x >= 8`) that is mapped by the assembler to (`x > 7`). Note Most assembler-mapped instructions are provided as a convenience for the compiler or assembly language programmer. Some of them enable newer Hexagon processor versions to maintain backwards compatibility with previous versions. Last Published: Oct 06, 2026 [Previous Topic Attributes](https://docs.qualcomm.com/bundle/publicresource/80-N3040-23/topics/attributes.md) [Next Topic Acknowledgments](https://docs.qualcomm.com/bundle/publicresource/80-N3040-23/topics/llvm-ccpp-acknowledgments.md)