This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |