Turn The Library Inside The Nt2 Project in Boost - Simd and Improving It'S Support For The Altivec Instruction Set
Turn The Library Inside The Nt2 Project in Boost - Simd and Improving It'S Support For The Altivec Instruction Set
Turn The Library Inside The Nt2 Project in Boost - Simd and Improving It'S Support For The Altivec Instruction Set
April 8, 2011
1 Personal Details
• Name : Faiçal Tchirou
• Email : [email protected]
• Availability :
2 Background Information
2.1 Education Background
I am in second year at the Africain Institue of Computer Science (it’s real name in French is Institut
Africain d’Informatique). My school is not a really a Computer Science school but a Software Engineering
one. We have basic courses on programming languages (Pascal, C/C++ and Java), on basic algorithms, on
management and software design. We don’t have real courses on algorithms (their analysis with asymptotic
notations, their design, their proof, ... ), data structures like trees, graphs, heaps (we were only basically
thaught about linked lists), programming methodology, etc. because we are primarly formed to work with
RAD applications like WinDev or Delphi. However, me and several students who are primarly interested in
computer science rather than software engineering learn by ourselves by reading books like Structure and
Interpretation of Computer Programs (available online), the courses available online by the OpenCourseWare
initiative and a lot of tutorials on web.
1
2.2 Programming Background
I started learning programming in 2006 with HTML but I really start programming in 2009 with the C
language by trying to solve mathematical problems available on projecteuler.net. When attempting to learn
functionnal programming, I discover LISP which I also used to solve some projecteuler.net problems. I
switched to C++ when trying to solve problems available at uva.onlinejudge.org. I used it first only for the
STL because it provides very good built-in data-structures I used when solving algorithmics problems. But
now I have a good knowledge of object oriented and template programming in C++. I also learned some
other programming languages like Python, Java, ... and of course web oriented programming languages like
PHP and a little of Ruby
So my programming background can be summarized in solving algorithmics problems in C, Lisp, and
C++ and doing some academic projects like inventory management software, websites, ... .
2.5 Do you have any previous work in this area before or on similar projects?
No.
2.6 What are your plans beyond this Summer of Code time frame for your proposed work?
I think a GSoC work is not only a 3 months project. After the deadline, I will remain in contact with my
mentor and the project community and continue contributing to the project.
2.7 Please rate, from 0 to 5, your knowledge of the following languages, technologies or tools:
• C++ : 4
• Subversion : 2
2.8 What software developement environments are you most familiar with ?
I principally use Emacs on my Fedora. I am also familiar with Eclipse and Code::Blocks on GNU/Linux. If
I have to work on Windows, I can work both on Visual Studio, Eclipse or Code::Blocks.
2.9 What software documentation tool are you most familiar with ?
I am most familiar with Doxygen.
2
3 Project Proposal
SIMD is a class of instruction sets in processors that allow to execute an operation on multiple data elements
simultaneously. The future Boost.SIMD library already exists as a part of the NT2 project. The project
consists of
• Making the library inside the NT2 project more boost compliant by following the boost coding and
naming conventions.
As an example of making the library more compliant, this file (comments ommited)
1 #i f n d e f NT2 SDK SIMD DETAILS IMPL VMX ALTIVEC BITWISE AND HPP INCLUDED
2 #define NT2 SDK SIMD DETAILS IMPL VMX ALTIVEC BITWISE AND HPP INCLUDED
3
4 #include <nt2 / sdk /meta/ a s i n t e g e r . hpp>
5 #include <nt2 / sdk / simd / n a t i v e c a s t . hpp>
6
7 NT2 REGISTER DISPATCH ( t a g : : b i t w i s e a n d , t a g : : cpu , (A0 ) ( A1)
8 , ( ( simd <a r i t h m e t i c <A0>, t a g : : a l t i v e c >))
9 ( ( simd <a r i t h m e t i c <A1>, t a g : : a l t i v e c >))
10 );
11
12 namespace nt2 { namespace e x t
13 {
14 template<c l a s s Dummy>
15 struct c a l l < t a g : : b i t w i s e a n d ( t a g : : simd <t a g : : a r i t h m e t i c , t a g : : a l t i v e c >
16 , t a g : : simd <t a g : : a r i t h m e t i c , t a g : : a l t i v e c >
17 )
18 , t a g : : cpu , Dummy
19 >
20 : callable
21 {
22 template<c l a s s Sig > struct r e s u l t ;
23 template<c l a s s This , c l a s s A0 , c l a s s A1>
24 struct r e s u l t <This (A0 , A1)> : meta : : s t r i p <A0> { } ;
25
26 NT2 FUNCTOR CALL( 2 )
27 {
28 A0 o t h e r = simd : : n a t i v e c a s t <A0>( a1 ) ;
29 A0 t h a t = { v e c a n d ( a0 ( ) , o t h e r ( ) ) } ;
30 return t h a t ;
31 }
32 };
33 } }
34
35 #endif
3
14 {
15 template<c l a s s Dummy>
16 struct c a l l <t a g : : b i t w i s e a n d ( t a g : : simd <t a g : : a r i t h m e t i c , t a g : : a l t i v e c >,
17 t a g : : simd <t a g : : a r i t h m e t i c , t a g : : a l t i v e c >
18 ),
19 t a g : : cpu , Dummy
20 >
21 {
22 template<c l a s s Sig > struct r e s u l t ;
23 template<c l a s s This , c l a s s A0 , c l a s s A1>
24 struct r e s u l t <This (A0 , A1)> : meta : : s t r i p <A0> { } ;
25
26 BOOST FUNCTOR CLASS( 2 )
27 {
28 A0 o t h e r = simd : : n a t i v e c a s t <A0>(a1 ) ;
29 A0 t h a t = { v e c a n d ( a0 ( ) , o t h e r ( ) ) } ;
30 return t h a t ;
31 }
32 };
33 } // namespace e x t
34 } // namespace b o o s t
35
36 #endif // BOOST SIMD BITWISE AND HPP