Skip to main content

Posts

Showing posts from March, 2014

Auto - Vectorization with little help from GCC!

This tutorial helps the programmers to benefit the progress of the auto-vectorization algorithms that are implemented in modern compilers, such as gcc. Before you start playing with the vectorization of your code i assume that you don't have any bottleneck in you code (like dynamic memory allocation etc) in the critical path. In this tutorial we will use the gcc 4.4.1, but the same steps can be applied to newer or older versions.  First of all there are two issues with auto vectorization:  1) gcc must know the architecture (eg what SIMD instructions are available)  2) The data structures must by properly aligned in memory The first step is to find the architecture of your processor and point it to gcc using the flags -mtune=... / -march=... you specify the architecture.  For example, my laptop is core2Duo so i put -march=core2. You can find more more information  here .  The next problem we must solve is knowledge of memory alignment.   You can help the compiler by alloc

Static linking with gcc and g++

In this tutorial, we will explain what the static linking is, how this affect the size of final binary, and why statically linking with g++ sometimes is pain. By definition, a statically compiled binary is a group of programmer ‘s routines, external functions, and variables which are packed into the final binary executable. The compiler or the linker produces the final object and embeds all the functions and variables and the linking phase.  There are two reasons of using dynamic linking and shared libraries: 1) Avoid creating a huge binary, if all the programs use a standard set of libraries why not having the operating system providing to them 2) Compatibility on operating system and machine dependant characteristics: sometimes the libraries must be implemented based on the architecture or the operating system and using dynamic linking is an easy way to avoid this catch. On the other hand, static linking is the ideal way of distributing one software product, paying

A new blog... a new start.

I 'm working as storage systems engineer at OnApp. I'm conducting research (eg. playing) in ARM micro-server architectures in the topic of the virtualization (XEN). I 'm also working on different small projects when i have time, mostly systems engineering. This blog contains short stories of systems development as some experiences from kernel hacking and research community. Basically i post whatever i'm working... even useless :)