SPRUIG3C January 2018 – August 2019 TDA4VM , TDA4VM-Q1
The VCOP virtual machine (VVM, or simply virtual machine) is a C++ library that implements VCOP operations on C7x. The C7x source code generated by the migration tool contains calls to the virtual machine. The virtual machine is intended to be an implementation mechanism; the programmer does not need to know anything about it or even be aware of its existence. However, it is also not intended to be a “black box.” Programmers may find it useful to understand at least the API to the virtual machine so they can understand the code from the migration tool. Further, programmers may wish to consult the virtual machine to see specifically how VCOP operations are implemented for C7x.
The virtual machine consists entirely of inline functions and C++ classes. None of the classes are actually instantiated into objects; all the member functions are static inline, and the variables static. There is no object component of the virtual machine to include at link time; it consists entirely of header files.
The classes and functions use C++ templates to abstract low-level details between similar constructs. Template parameters specify things like data type, distribution mode, addressing mode, and SIMD factor; these items are determined by the migration tool and therefore known at compile time. The library uses template specialization to customize the implementation of a given operation for specific combinations of the template parameters.
The implementation uses the C7x low-level
programming model, consisting of native vector (extended OpenCL) types and C7x
intrinsics from <c7x.h>
. That header file cross-references
the intrinsic names with the actual C7x mnemonics; in this way the programmer can
see what instructions are actually being generated.
A detailed description of the virtual machine is beyond the scope of this document. However, the core components of the VVM are as follows:
_LOOKUP, _HIST
, and some forms of
OFFSET_NP1
and PDDA
.)