Installation guide
63
Chapter 9.
Vector1 Library
Vector1 is a template library for SIMD programming since Sora SDK 1.1. Vector1 library provides
new vector data types and vector operations to accelerate PHY signal processing. Vector1
provides a general vector abstraction that is rather independent from the real processor
architecture. Therefore, it improves the portability of algorithms implemented using SIMD
instructions. When porting to a new SIMD processor, only a new implementation of Vector1
library is needed, while the algorithm implementations can remain unchanged (or with only
minor modification). Currently, Vector1 is implemented based on C++ SSE4 intrinsic functions,
which are supported in most modern C++ compiler. The implementation of Vector1 can be
found in the header file vector128.h.
9.1 Data type
Vector1 defines vector data type which contains an array of elements. An element can be of
various types, from integer, float, to complex values. The element type is typedef-ed as
elem_type in the vector type, for example vb::elem_type is defined as “Signed Byte”. Table 6
summarizes the vector types supported in the Vector1 library. It also summarizes the size of
each element and the number of elements in one vector type. For example, a vb variable
contains a vector of sixteen 8-bit long integers (a byte) and a vub presents a vector contains
sixteen unsigned bytes. Note that a vector type should be 16-byte aligned.
Vector Type
Element Type
Element Size
No. of Elements
vb/vub
Signed /Unsigned Byte
8b
16
vs/vus
Signed /Unsigned Short
16b
8
vi/vui
Signed /Unsigned Integer
32b
4
vq/vuq
Signed/Unsigned Quad Word
64b
2
vf
Float
32b
4
vcb/vcub
Complex Signed / Unsigned Byte
16b
8
vcs/vcus
Complex Signed / Unsigned Short
32b
4
vci/vcui
Complex Signed / Unsigned Integer
64b
2










