Back to search

University of Peloponesse

A MATLAB to C vectoring compiler exploiting custom instructions of targeted processors

Abstract

dc:description

This Ph.D. dissertation presents a MATLAB to C vectorizing compiler exploiting custom instructions of the target processor such as SIMD instructions or scalar math instructions which are supported by hardware. The compiler generates ANSI C code and the derived custom instructions are represented via intrinsic C functions enabling the compatibility of the compiler to any target processor.Firstly, a parameterized target processor model which is used for the specification of the specialized instruction set is presented. The processor model allows the description of the available customized instructions, operations for packing data to vectors ready for SIMD processing and native data structures such as vector data types. The processor model is used by an instruction selection algorithm to map the MATLAB source code with the available hardware modules of the target architecture. It is also utilized by the type inference compilation stage to infer the result type of the MATLAB function calls that are mapped to customized instructions. The parametrized processor model forms a multi-target MATLAB-to-C compilation framework allowing the generation of optimized code for any target architecture.Next, the compiler's infrastructure is described with emphasis to the parts that support the data parallel execution and the generation of the vectorized C code. Initially, an instruction selection algorithm is presented that matches the MATLAB operations and functions with the customized instructions of the target architecture. The algorithm selects a suitable intrinsic from that have been specified in the processor model. Subsequently, packing and unpacking statements are introduced in the intermediate representation to enable data parallel execution. The process concerns the insertion of packing (and unpacking) instructions to convert data in packed form (and vice versa) ready for SIMD execution. Afterwards local value numbering is performed to remove the redundant packing/unpacking statements that have been inserted from the previous compilation stage. The code generator is also discussed in the dissertation focusing on the production of the vectorized code and the fixed point code generation. The vectorized code generation includes the production of for-loops that correspond to SIMD blocks as well as the generation of packing instructions and the matched SIMD instructions with vector semantics. The code generation of fixed point data types concerns the production of additional C code to handle the fixed point arithmetic such as shift operations. The compilation framework supports the data parallel processing and it leads to the vectorized code generation exploiting the customized instructions of the target architecture. The generated code achieves significant speed-up against other approaches that don't produce vectorized code or any processor's special instruction.Finally, a comprehensive evaluation of the generated code by the MATLAB compiler is presented on diverse architectures. The experimental environment includes two ASIP processors (one of them supporting SIMD) that have been developed in IMEC research center and four processors from ARM and x86 architectures. The benchmark composed by eight representative DSP applications using different SIMD widths as well as a variety of data types including floating or fixed point and packed or unpacked types. The performance of the generated code by the compiler has been compared against the generated code by MathWorks Coder showing that the proposed approach achieves substantial speed-up across all target architectures especially when using SIMD processing. Further experiments have been conducted to evaluate the performance of the auto-vectorization of popular C compilers including Clang/LLVM, GCC and MSVC, on the generated code by MathWorks Coder and the scalarized code that have been produced by the MATLAB compiler. The experimental results show that the auto-vectorizing C compilers vectorize only a small percentage of the benchmark's loops concluding that the processor's SIMD units cannot be fully leveraged by auto-vectorization. In contrast, the approach developed in this thesis handles a much broader class of applications.

Degree

thesis:*
Grantor dc:publisher
University of Peloponesse
Year dc:date
2017

Author and committee

dc:creator, dc:contributor.*
Authors dc:creator
  • Latifis, Ioannis
  • Λατίφης, Ιωάννης

Subjects

dc:subject × 17

Rights

dc:rights
Statement dc:rights
  • BY_NC
Language dc:language
eng

Identifiers

dc:identifier.*
Identifier
10.12681/eadd/41138

Chain of custody

source
Harvested from
Greek National Archive of PhD Theses
Base URL
phdtheses.ekt.gr/eadd_oai/request
Last updated
2026-11-18
Source record
OAI-PMH GetRecord
citation

Latifis, Ioannis; Λατίφης, Ιωάννης. A MATLAB to C vectoring compiler exploiting custom instructions of targeted processors. University of Peloponesse, 2017. http://hdl.handle.net/10442/hedi/41138