This repository provides sample C++ code illustrating the utilization of MMX, SSE, SSE2, and AVX instructions.
The repository consists of two source files:
sample_code.cpp
:- Demonstrates the usage of MMX, SSE, and SSE2 instructions.
- Performs operations such as comparing vectors, adding elements, computing square roots, and finding minimum elements.
- Utilizes both inline assembly and intrinsic functions.
mmx_sse_avx.cpp
:- Expands the usage to include AVX instructions along with MMX, SSE, and SSE2.
- Implements functions using data formats
__m64
,__m128
, and__m256
. - Performs vector addition, square root calculation, and comparison of elements to find the minimum.
clang++ ./sample_code.cpp -std=c++20 -Ofast -march=native -o sample_code.exe
clang++ ./mmx_sse_avx.cpp -std=c++20 -Ofast -march=native -o mmx_sse_avx.exe
- Course: Peter the Great St. Petersburg Polytechnic University (SPbPU), Computer Architecture.
- Teachers: Molodyakov S.A., Militsyn A.V.