Skip to content
Snippets Groups Projects
build.sh 665 B
Newer Older
#!/usr/bin/bash

# This shell script will build vectorized and un-vectorized versions of code
# for x86_64 and  AArch64
# Must have the AArch64 cross compiler placed in your home dir under ~/aarch

# Build the x86 with O1 and -ftree-vectorize -fopt-info-vec-all and static

ARM=~/aarch/bin/aarch64-none-linux-gnu-gcc
BASE="-static -O2"
echo "Building x86"

echo "Vectorized"
gcc $BASE -ftree-vectorize -msse -fopt-info-vec-all $1.c -o $1-x86-vec

echo "No vectorize"
gcc $BASE -msse $1.c -o $1-x86-nvec

echo "Building AArch64"

echo "Vectorized"
$ARM $BASE -ftree-vectorize -fopt-info-vec-all $1.c -o $1-arm-vec

echo "No vectorize"
$ARM $BASE $1.c -o $1-arm-nvec