Skip to content

Latest commit

 

History

History

vectorization_2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This is a second lab about auto vectorization. The subject of this lab assignment is a part of a checksum algorithm from the 80s, which has risen from the popularity of the Internet and accompanying needs to validate transmitted packets. Even the problem is old, similar issues may exist nowadays in production code.

Modern compilers handle simple loops very well, including horizontal additions. In this lab computations inside the loop are slightly more difficult: we do an "add carry" operation. Some compilers recognize "add carry" and others don't. The carry flag is still a dark area in C++ while it exists more than 40 years. In this lab assignment, you will practice fixing auto-vectorization, which will improve performance significantly.

Hint: the RFC 1071 paper in the section "2. Calculating the Checksum" describes possible techniques to speed up this assignment. Also, clang can help to find causes of bad performance.