Skip to content

C & C++ reverse-complement Jeremy Zerfas

CONTRIBUTE SOURCE CODE

C reverse-complement Jeremy Zerfas

Since programs that are using explicit SIMD code are being categorized differently now, I thought I should submit a version of my previous program that has been modified to have the explicit SIMD code removed. I only briefly tested this but it looks like compared to my previous program, the run time should be only a little slower and the source code should be a couple hundred bytes smaller but the CPU time should be noticeably higher.

The code is almost all the same as my last program except that I've removed the code between the #ifdef __SSE4_1__ and #endif lines to remove the explicit SIMD code, removed the include line for the SIMD intrinsics, updated the comments to remove everything regarding the SIMD code, and removed two newline entries in the lookup table since there is no longer a need to accommodate for the previous SIMD code. Removing a bunch of the code obviously reduced the source code size a good amount. Removing the explicit SIMD code does increase the CPU time but run time seems to increase only a little bit because I believe both programs are somewhat I/O and memory bound on multi-core systems.

Attach your source code file

Reverse-Complement.c

Provide an example build command-line

GCC
gcc -O3 -march=native -static -pthread Reverse-Complement.c -o Reverse-Complement

Clang
clang -O3 -march=native -static -pthread Reverse-Complement.c -o Reverse-Complement

Edited by Jeremy Zerfas