Skip to content

Instantly share code, notes, and snippets.

View juliuskoskela's full-sized avatar
🎯
Focusing

Julius Koskela juliuskoskela

🎯
Focusing
  • Finland
View GitHub Profile
curl -OL https://gist.githubusercontent.com/juliuskoskela/1a5ce40794325b2dac4a2a072ce5d404/raw/b8fb9b2afa0fe464880e02a25d10ca914b01d461/m4x4d_avx_mul.c
printf "\nCLANG\n\n"
printf "\nclang -march=native -mavx m4x4d_avx_mul.c -o m4x4d_avx_mul\n"
clang -march=native -mavx m4x4d_avx_mul.c -o m4x4d_avx_mul
./m4x4d_avx_mul 10000000
printf "\n---------------------------------------------------------------------\n"
printf "\nclang -O1 -march=native -mavx m4x4d_avx_mul.c -o m4x4d_avx_mul\n"
#include <immintrin.h>
#include <time.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
// Typedef of 16 x doubles alternatively accessable as 4 x (4 x 4)
// row vectors.
typedef union u_m4d