-
Bug
-
Resolution: Fixed
-
Medium
-
Code Generation Tools
-
CODEGEN-7654
-
C7000_1.4.0.LTS
-
C7000_1.4.1.LTS*
-
default
-
If a function contains all of the following:
1. Any vector operation that is wider than what the hardware supports (512 bits). For example, an add operation on two double16 vectors (1024 bits) that must be split by the compiler into two add operations on double8 vectors.
2. A load of a vector by streaming engine advance.
3. Non-overlapping accesses of the vector loaded by the streaming engine advance.
Then at any optimization level (-o0 or higher), the streaming engine advance may be duplicated causing too many advances to occur. The following example contains the necessary components for the bug to occur:
#include <c7x.h>
int a; int b; int c; int d;
double16 foo(double16 d1, double16 d2)
This will result in assembly that contains four SE advances. If the code is modified such that the load is not associated with an advance, which breaks the second condition for the bug to occur:
int4 v = __SE0(int4); __SE0ADV(int4);
Then, only one SE advance will occur, avoiding the bug. Similarly, if the code is modified to not have a vector operation that is larger than what the hardware supports, which breaks the first condition:
double8 foo(double8 d1, double16 8)
Then the SE advance will not be duplicated, avoiding the bug. The third condition may be more difficult to break in source code, but if the assignments to a, b, c, and d from non-overlapping subvector accesses are removed in the example, the bug will not occur.