SPRUIG5E January 2018 – March 2023 TDA4VM , TDA4VM-Q1
The C6000 compiler supports the use of native vector data types, which are documented in Section 7.4.2 of the TMS320C6000 Optimizing Compiler Users Guide (SPRUI04).
When porting source code that relies on native vector data types to the C7000 compiler, understand the following differences:
c6x_vec.h
file. Replace #includes of
c6x_vec.h
and c6x.h
with
c7x.h
aloneOn C6000, OpenCLâ„¢-like native vector data types had to be enabled using the --vectypes option. However, with the C7000 compiler, all native vector data types are enabled by default. Therefore, there is no need to use --vectypes=on. If you have existing code with symbols that conflict with the native vector data type symbols, you can turn off compiler recognition of those symbols by using the --vectypes=off option.
Note that there are two names for each native
vector data type: one without a double-underscore prefix (for example,
int4
) and one with a double-underscore prefix (for example,
__int4
). The double-underscore versions of the native vector
data types are always recognized by the compiler. The --vectypes=off option turns
off only those vector data types that do not have the double underscore prefix.
For the best possible future compatibility and portability, we recommend that you rename any existing typedefs, structs, or classes (that are not intended to be native vector data types) that use the names of OpenCL and OpenCL-like native vector data types. This also enables use of the shorter native vector type names, which do not use the double-underscore prefix.
Because the C7100 and C7120 have 512-bit vector sizes, the maximum number of elements in a vector is larger than for the C6000. The C6000 is limited by the 16-element limitation imposed by OpenCL. Vector lengths for the C7000 are limited to the maximum elements shown in Table 2-2.
Type | Description | Maximum Elements |
---|---|---|
charn | A vector of n 8-bit signed integer values | 64 |
ucharn | A vector of n 8-bit unsigned integer values | 64 |
shortn | A vector of n 16-bit signed integer values | 32 |
ushortn | A vector of n 16-bit unsigned integer values | 32 |
intn | A vector of n 32-bit signed integer values | 16 |
uintn | A vector of n 32-bit unsigned integer values | 16 |
longn | A vector of n 64-bit signed integer values | 8 |
ulongn | A vector of n 64-bit unsigned integer values | 8 |
floatn | A vector of n 32-bit single-precision floating-point values | 16 |
doublen | A vector of n 64-bit double-precision floating-point values | 8 |
ccharn | A vector of n pairs of 8-bit signed integer values | 32 |
cshortn | A vector of n pairs of 16-bit signed integer values | 16 |
cintn | A vector of n pairs of 32-bit signed integer values | 8 |
clongn | A vector of n pairs of 64-bit signed integer values | 4 |
cfloatn | A vector of n pairs of 32-bit floating-point values | 8 |
cdoublen | A vector of n pairs of 64-bit floating-point values | 4 |
The C6000 64-bit longlongn, ulonglongn, and clonglongn vector types are not supported on C7000. As long as the
c6x_migration.h
file is included, the compiler will map these types to the corresponding types that are supported by C7000: longn, ulongn, and clongn respectively.