Description • Part I - Strings • Part II - Formulas • Dependencies • Installing And Executing • Author
The Assembly and C Exercise aims to practice assembly language programming using SSE/AVX instructions and C SSE/AVX intrinsics. It consists of two unrelated parts: string processing and floating-point calculations. Each part comprises various tasks and utilizes different source files for its environment.
In this part, two string operators are implemented using SSE/AVX instructions and intrinsics.
The Hamming distance between two strings is calculated as the number of positions at which the corresponding symbols are different. The implementation is done in assembly language only, specifically in the file named hamming.s
.
The Base64 distance between two strings involves:
- Removing non-base 64 characters while maintaining the order of every other character.
- Calculating the numbers represented by the strings and subtracting the first from the second.
The implementation is in C using intrinsics, in the file named
b64.c
.
This part involves mathematical formulas applied to arrays of floating-point numbers.
Formula 1 calculates the expression:
The implementation is in C using intrinsics, in the file named formula1.c
.
Formula 2 computes the expression:
The implementation is in assembly language, specifically in the file named formula2.s
.
This exercise has the following dependencies:
- SSE/AVX Support: Ensure that the target platform supports SSE/AVX instructions for optimal performance.
- Compiler and Assembler: A compatible C compiler and assembler are required to compile and assemble the provided source files.
To install and run the program you use Git. From your command line:
# Clone this repository.
$ git clone https://github.com/TalMizrahii/Parallel-SIMD-and-Intrinsics
# Navigate to the repository directory:
$ cd Parallel-SIMD-and-Intrinsics
# Enter strings:
$ cd strings
# Compile the program:
$ make
# Run the program:
$ make run
# Enter formulas:
$ cd formulas
# Compile the program:
$ make
# Run the program:
$ make run