SPRUIG3C January 2018 – August 2019 TDA4VM , TDA4VM-Q1
The migration tool generates C++ code that invokes methods in the virtual machine, which is also C++. As such, it relies heavily on the compiler to achieve an efficient translation. In particular, the following compiler optimizations are critical for VCOP translation:
vloops()
function of a translated kernel should contain no calls.
PARALLEL_LOOP
pragma to convey this property to the compiler. The compiler must not limit the initiation interval of a software pipelined loop due to memory dependence. VMV SE0++,Vreg1
...
VADDW Vreg1,Vreg2,Vdst
can be optimized to:
VADDW SE0++,Vreg2,Vdst
A related issue is that the migration tool sometimes generates SA-based references to objects separately from the actual indirection. The compiler should combine these. For example, the migration tool may generate:
int16 *p = &__sa_noadv_int(0, 4, base); // note “address of”
...
*p = Vreg;
this generates:
ADDAW reg_base, SA0++, reg_p
...
VSTW Vreg,*reg_p
which should be optimized to:
VSTW Vreg,*reg_base[SA0++]
This is by no means an exhaustive list. Efficient translation relies on dozens of compiler optimizations, not all of which have been implemented.