C7000 C/C++ Code Generation Tools v1.4.2.LTS Release Notes

Table of Contents


0 Introduction to the C7000 Code Generation Tools v1.4 LTS


This release is an LTS (Long-Term Support) release.

Definitions

We normally maintain two active branches at any given time. When a new LTS branch is made, the 2nd to last LTS releases will be made reactive.


1 Documentation


The following documents are included to provide information on how to use, program, and migrate to the C7000 CPU.

SPRUIG8B***.PDF: C7000 C/C++Optimizing Compiler Users Guide

SPRUIV4***.PDF: C7000 Optimization Guide

SPRUIG4C***.PDF: C7000 Embedded Application Binary Interface (EABI) Reference Guide

SPRUIG5C***.PDF: C6000-to-C7000 Migration User’s Guide

SPRUIG3C***.PDF: VCOP Kernel-C to C7000 Migration Tool User’s Guide

SPRUIG6D***.PDF: C7000 Host Emulation User’s Guide (NOTE: Host Emulation is an experimental feature)


2 TI E2E Community - Where to get help


Questions concerning TI Code Generation Tools can be posted to the TI E2E Community forums. The “Development Tools” forum can be found at:

The following is the top-level webpage for all of TI’s Code Generation Tools.

If submitting a defect report, please attach a scaled-down test case with command-line options and the compiler version number to allow us to reproduce the issue easily.


3 Defect Tracking Database


Compiler defect reports can be tracked at the new Development Tools bug database, SIR. SIR is a JIRA-based view into all public tools defects. The old SDOWP tracking database will be retired.

A my.ti.com account is required to access this page. To find an issue in SIR, enter your defect id in the top right search box once logged in. Alternatively from the top red navigation bar, select “Issues” then “Search for Issues”.

To find an old SDOWP issue, place the SDOWP ID in the search box and use double quotes around the SDOWP ID.


4 SE/SA/MMA Interface Changes


As of version 1.3.0, the compiler has a different interface for the streaming engine (SE), streaming address generator (SA) and to a lesser extent, the MMA. These changes involve how to setup and initialize the SE and SA and the enums used in initializing configuration registers and some intrinsics.

Existing code that uses the SE, SA, or MMA will need to be changed to use the new interfaces with this version of the compiler. See the “c7x_strm.h” and “c7x_mma.h” files in the include directory for the current interface.

Here is a summary of some of the interface changes

  1. The __HWAOP() and __HWAOPXFER() intrinsics require an enum argument instead of a simple integer constant.
  2. The __HWA_CONFIG_REG name has changed to __HWA_CONFIG_REG_v1 to allow for additional MMA configuration templates in future devices.
  3. Some fields in the __HWA_CONFIG_REG_v1 struct now require enums instead of constants.
  4. It is recommended to use the __gen_HWA_CONFIG_REG_v1() function to set default values for any new instance of the __HWA_CONFIG_REG_v1 struct. There is a similar function, __gen_HWA_OFFSET_REG() for initializing instances of the __HWA_OFFSET_REG struct.
  5. SE and SA are now configured using structure types. It is recommended to use __gen_SE_TEMPLATE_v1() and similar to initialize them.

As a temporary migration measure, the option --deprecated_api is available to expose the old API and hide the new API. This option will be removed in a future release.

In addition, as of version 1.4.0, the streaming address generator (SA) API has been modified to give greater compatibility with typedefs and const pointers. For example, __SA0ADV(int2_typedef, ptr) was disallowed, but is now legal. Similarly, __SA0ADV(const_int2, ptr) is also now legal and will return a const pointer. For more information, consult the descriptions in “c7x_strm.h”.


5 Complex Types Unsupported for Some Intrinsics


As of version 1.3.0, due to the potential for incorrect address scaling when the streaming address generator (SA) is used, the following intrinsics no longer support complex types and complex vector types.

__vload_unpack_short()
__vload_unpack_int()
__vload_unpack_long()
__vstore_packl()
__vstore_packh()
__vstore_packhs1()
__vstore_pack_byte()
__vstore_packl_2src()
__vstore_packh_2src()
__vstore_packhs1_2src()
__vstore_pack_byte_2src()

6 Data Movement Intrinsic Updates


Version 1.3.0 implemented new data movement intrinsics that broke compatibility with previous versions. A data movement intrinsic is defined as an intrisic that moves data without regard for data format, such as a shuffle or deal operation. These intrinsics have been updated to only accept element types that precisely fit the data movement operation. For example, a shuffle operation that operates on 32 bit boundaries no longer accepts char vectors. In addition, any element type that may fit is now available, including complex and floating point types. For reference, the following intrinsics were affected:

__deal_stride2()
__deal_stride4()
__duplicate()
__pack_consec_high_char()
__pack_consec_high_int()
__pack_consec_high_long()
__pack_consec_high_short()
__pack_consec_low_char()
__pack_consec_low_int()
__pack_consec_low_long()
__pack_consec_low_short()
__pack_even_cross_short()
__pack_even_short()
__pack_high_char()
__pack_high_low_short()
__pack_high_short()
__pack_low_char()
__pack_low_high_char()
__pack_low_high_short()
__pack_low_int()
__pack_low_short()
__reverse()
__shuffle_stride2()
__shuffle_stride2_even_even()
__shuffle_stride2_even_odd()
__shuffle_stride2_high_high()
__shuffle_stride2_low_high()
__shuffle_stride2_low_low()
__shuffle_stride2_odd_odd()
__shuffle_stride4()
__swap()

This set of intrinsics has been replaced with the following set:

__deal_stride2()
__deal_stride4()
__duplicate()
__duplicate16()
__duplicate2()
__duplicate32()
__duplicate4()
__duplciate8()
__pack()
__pack_consec_high()
__pack_consec_low()
__pack_even()
__pack_even_cross()
__pack_high()
__pack_high_low()
__pack_low()
__pack_low_high()
__reverse()
__shuffle_stride2()
__shuffle_stride2_even_even()
__shuffle_stride2_even_odd()
__shuffle_stride2_high_high()
__shuffle_stride2_low_high()
__shuffle_stride2_low_low()
__shuffle_stride2_odd_odd()
__shuffle_stride4()
__swap()

In version 1.3.0, these changes were not present in host emulation. Version 1.4.0 corrects this difference.


7 API Updates for Constant Arguments


Version 1.4.0 adjusted some intrinsics to ensure that they only accept constant arguments and/or enumeration arguments. The following intrinsics are affected:

__get_indexed()
__set_indexed()
__mtag()
__memory_fence()
__memory_fence_store()
__se_cache_op()
__se_cache_preload()

8 Supported and Unsupported Features


New Features

Supported Intrinsics

The included top-level header files “c7x.h” and “c6x_migration.h” list the supported intrinsics for both C7x and C6x, respectively. Note that you must include these header files with your source in order to leverage many of the C7x intrinsics and all of the legacy C6x intrinsics. “c7x.h” includes other useful header files that document/describe supported intrinsics:

Unsupported Features


9 Support for Vector Data Types


The C7000 C/C++ compiler supports the use of OpenCL-like vector data types in C/C++ source files by default.


9.1 Basic Usage

Support for vector data types is available on the C7100 architecure.

Support for vector data types is enabled by default. When the --vectypes=off option is specified on the compiler command line, vector types will be interpreted as identifiers rather than types.

All of the vector data types and related built-in functions that are supported in the C7x programming model are specified in the “c7x.h” header file that you can find in the “include” sub-directory where your C7000 CGT was installed.

Any C/C++ source file that utilizes vector data types or any of the built-in functions must #include <c7x.h> in that source file.


9.2 Vector Data Types and Operations

Vector Data Types

A vector type name is a concatenation of element type name with a number representing vector length. A vector with such type consists of vector length number of vector elements.

The C7x programming model implementation of vector data types and operations follows the OpenCL C language specification very closely. For a more detailed description of OpenCL vector data types and operations, please see “The OpenCL Specification” version 1.2 which is available from the Khronos OpenCL Working Group:

http://www.khronos.org/opencl/

Chapter 6, section 6.1.2 of “The OpenCL Specification” version 1.2 provides a detailed description of the built-in vector data types supported in the OpenCL C programming language.

The C7x programming model provides the following built-in vector data types:

The C7x programming model also provides an extension to the OpenCL C programming language for representing vectors of complex type. A prefix of c is used to indicate a complex type name. Each complex type vector element contains a real part and an imaginary part with the real part occupying the lower address in memory.

Vector Operations: component access

A component access can occur on the left-hand-side (lhs) or right-hand-side (rhs) of an assignment operator. If specified on the lhs of an assignment, each component must be uniquely identifiable.

The C7x programming model implementation supports OpenCL C like swizzle operators:

Vector Operations: concatenation

Scalar entities or shorter vectors can be concatenated together to form longer vectors. When all of the components involved are constants, the result is a vector literal. Otherwise, the vector’s value is determined at run-time.

Vector Operations: conversion and re-interpretation

The C7x programming model includes functions that can convert or re-interpret the elements of one vector type as another vector type.

The convert_<destination type>(<source type object>) operation may be used with complex types, but only when converting from one complex type to another. (Such as from cint2 to cfloat2.)

Vector Operations: infix operators

When infix operators are applied to vector type objects, the operator is applied element by element. That is, each element in the result vector is the result of applying the infix operator to the corresponding elements in the source vector(s).

Vector Operations: built-in functions

Prototypes for all of the vector built-in functions supported in the C7x programming model are listed in the “c7x.h” header file that you can find in the “include” sub-directory where your C7000 CGT package was installed. Please refer to the contents of “c7x.h” for a complete list of the vector built-in functions.

Here is an example which uses vector built-in functions:

  [vbif_ex.c]

    #include <stdio.h>
    #include <c7x.h>

    void print_short4(char *s, short4 v)
    {
       printf("%s", s);
       printf(" <%d, %d, %d, %d>\n", v.x, v.y, v.z, v.w);
    }

    int main()
    {
       short4 va = (short4) (1, 2, 3, -32766);
       short4 vb = (short4) (5, 32767, -13, 17);
       short4 vc = va + vb;
       short4 vd = va - vb;
       short4 ve = __add_sat(va, vb);
       short4 vf = __sub_sat(va, vb);
       print_short4("va=", va);
       print_short4("vb=", vb);
       print_short4("vc=(va+vb)=", vc);
       print_short4("vd=(va-vb)=", vd);
       print_short4("ve=__add_sat(va,vb)=", ve);
       print_short4("vf=__sub_sat(va,vb)=", vf);
       return 0;
    }

Compile:

    %> cl7x -mv7100 -o1 -k vbif_ex.c -z -o vbif_ex.out -llnk.cmd

Run:

Load and run vbif_ex.out from the C7000 simulator to get the following result:

    va= <1, 2, 3, -32766>
    vb= <5, 32767, -13, 17>
    vc=(va+vb)= <6, -32767, -10, -32749>
    vd=(va-vb)= <-4, -32765, 16, 32753>
    ve=__add_sat(va,vb)= <6, 32767, -10, -32749>
    vf=__sub_sat(va,vb)= <-4, -32765, 16, -32768>

10 Removal of MISRA 2004 compiler command-line options


The C7000 C/C++ Compiler does not support MISRA 2004 checking as some other Texas Instruments compilers do. Therefore, the command-line options for MISRA 2004 checking have been removed and are no longer accepted by the compiler.


11 Silicon errata i2117 workaround support


The compiler option --silicon_errata_i2117 has been added to generate code that automatically works around silicon errata i2117. MMA performance may be negatively impacted by the use of this option in edge cases.


12 Half-float conversion intrinsics


Starting with the v1.4.1 compiler, half-float conversion intrinsics are supported, which map to appropriate C7000 half-float conversion instructions:

// VSPHP
uint   = __float_to_half_float(float);
uint2  = __float_to_half_float(float2);
uint3  = __float_to_half_float(float3);
uint4  = __float_to_half_float(float4);
uint8  = __float_to_half_float(float8);
uint16 = __float_to_half_float(float16);

// VINTHP
uint   = __int_to_half_float(int);
uint2  = __int_to_half_float(int2);
uint3  = __int_to_half_float(int3);
uint4  = __int_to_half_float(int4);
uint8  = __int_to_half_float(int8);
uint16 = __int_to_half_float(int16);

// VHPSP
float   = __half_float_to_float(uint);
float2  = __half_float_to_float(uint2);
float3  = __half_float_to_float(uint3);
float4  = __half_float_to_float(uint4);
float8  = __half_float_to_float(uint8);
float16 = __half_float_to_float(uint16);

// VHPINT
int   = __half_float_to_int(uint);
int2  = __half_float_to_int(uint2);
int3  = __half_float_to_int(uint3);
int4  = __half_float_to_int(uint4);
int8  = __half_float_to_int(uint8);
int16 = __half_float_to_int(uint16);

Each half-float in a vector register occupies the least significant 16-bits of a 32-bit vector element, with zero padding to 32-bits. Because the C and C++ language specifications do not define a half-float type and because only conversion instructions are supported by the C7000 architecture, **a vector of half-floats is represented with __uint vector where the __uint serves as a container for the half-float**. The following intrinsics may be used to load and store this representation efficiently:

__vload_unpack_int()  [VLDHUNPKWU]
__vstore_packl()      [VSTHSVPACKL]

13 Resolved defects


Resolved defects in v1.4.2.LTS:

ID Summary
CODEGEN-8640 Incrementing a volatile bit-field leads to corrupted code
CODEGEN-8589 Compiler intermittently crashes on switch with 20k cases
CODEGEN-8579 Software pipelined loop register allocation mistakenly assigns same register to conflicting variables
CODEGEN-8563 C7000 RTS memcpy and memset routines may trigger page fault exception
CODEGEN-8538 Compiler does not honor attribute aligned when applied to function
CODEGEN-8485 sscanf float conversion should fail and return 0 when input string starts with E or e
CODEGEN-8458 C6x intrinsics in C7000 Host Emulation have incorrect results
CODEGEN-8454 Streaming address generator (SA) advance may be removed as dead code
CODEGEN-8451 Streaming address generator (SA) advance may over-execute in software pipelines
CODEGEN-8389 Including cmath causes remark: zero used for undefined preprocessing identifier “STDC_VERSION
CODEGEN-7956 Compiler incorrectly elides short-circuit behavior of && when right operand might invoke undefined behavior
CODEGEN-7778 Remove –asm_includes as CCS option
CODEGEN-7499 Host Emulation: __gmpy gives incorrect result (uchar variant)

14 Known defects

Known defects in v1.4.x.LTS:

ID Summary
CODEGEN-8620 Remove integer divide and remainder functions from RTS
CODEGEN-8576 Loop that iterates a very large number of times causes compiler to fail with: Optimizer terminated abnormally
CODEGEN-8075 Vector pointer array access operator in host emulation causes memory use after free
CODEGEN-7510 __store_predicate_char intrinsic gives incorrect result in big endian
CODEGEN-7509 __vstore_reverse_bit variants reverse output of complex types in big endian
CODEGEN-7503 Host Emulation: __vsel_pvkv with float16 arguments gives incorrect results
CODEGEN-7497 Host Emulation: Use of complex matrix multiplies for cshort (full vector) produces incorrect results
CODEGEN-6995 __builtin_expect not supported yet on C7000 Compiler: Compiler fails with INTERNAL ERROR: no match for ICALL
CODEGEN-6931 Use of built-ins conversion suffixes: _sat, _rte, _rtz, _rtp, _rtn results in compiler error
CODEGEN-6807 Disassembler may not show sign extension of immediate values
CODEGEN-6677 C7x assembler core dumps on file with many asm() statements in C code
CODEGEN-6509 Compiler error: no instance of function template matches the argument list
CODEGEN-6084 –list_directory option should not be available on cl7x
CODEGEN-2534 Compiler terminates abnormally with incomplete complex initialization

End Of File