SPRUIG5E January   2018  â€“ March 2023 TDA4VM , TDA4VM-Q1

 

  1.   Abstract
  2. 1About This Document
    1. 1.1 Related Documents
    2. 1.2 Trademarks
  3. 2Migrating C Source from C6000 to C7000
    1. 2.1  Compiler Options
    2. 2.2  Native Vector Data Types
    3. 2.3  Type Qualifiers: near and far
    4. 2.4  64-bit long Type
    5. 2.5  References to Control Registers
    6. 2.6  Memory-Mapped Peripherals
    7. 2.7  Run-Time Support
    8. 2.8  Contents of Migration Header File c6x_migration.h
      1. 2.8.1 Supported Macros
      2. 2.8.2 Non-Supported Macros
      3. 2.8.3 Legacy Data Types
      4. 2.8.4 Legacy Intrinsics
    9. 2.9  Galois Field Multiply Instructions
    10. 2.10 Performance Considerations for Migrated Code
      1. 2.10.1 UNROLL Pragma
      2. 2.10.2 Subvector Access
      3. 2.10.3 16x16 and 16x32 Bit Multiplies
      4. 2.10.4 __x128_t Type
      5. 2.10.5 Unsigned Array Offsets
      6. 2.10.6 Streaming Engine and Streaming Address Generator
      7. 2.10.7 Additional Optimization Guidance
  4. 3Host Emulation
  5. 4Revision History
    1.     29
    2.     30

Native Vector Data Types

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:

  • There is no c6x_vec.h file. Replace #includes of c6x_vec.h and c6x.h with c7x.h alone
  • The --vectypes compiler option is on by default for C7000.
  • Use --vectypes=off if you have symbols that conflict with the names of the native vector types.

On 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.

Table 2-2 C7000 Supported Vector Types
TypeDescriptionMaximum Elements
charnA vector of n 8-bit signed integer values64
ucharnA vector of n 8-bit unsigned integer values64
shortnA vector of n 16-bit signed integer values32
ushortnA vector of n 16-bit unsigned integer values32
intnA vector of n 32-bit signed integer values16
uintnA vector of n 32-bit unsigned integer values16
longnA vector of n 64-bit signed integer values8
ulongnA vector of n 64-bit unsigned integer values8
floatnA vector of n 32-bit single-precision floating-point values16
doublenA vector of n 64-bit double-precision floating-point values8
ccharnA vector of n pairs of 8-bit signed integer values32
cshortnA vector of n pairs of 16-bit signed integer values16
cintnA vector of n pairs of 32-bit signed integer values8
clongnA vector of n pairs of 64-bit signed integer values4
cfloatnA vector of n pairs of 32-bit floating-point values8
cdoublenA vector of n pairs of 64-bit floating-point values4

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.