#
# In this file, any line beginning with a '#' is ignored, but the # must be in
# column 0.  All multiple whitespace is reduced to one space (i.e. used only
# to distinguish where words begin/end)
#
# The file has the following format:
# MACH=<#>,...,<#> OS=<#>,...,<#> LVL=<#> COMPS=[icc,smc,dmc,skc,dkc,xccf77]
#  'compiler' 'flags'
# Where MACH indicates the MACHTYPE(s) that the compiler should be available
# on, the OS indicates which Operating systems that compiler is available on,
# and both of these can take the value of 0, which means the compiler and
# associated flags can be used for any machine/OS.  There should be no
# space in the #,# strings.
#
# LVL gives a priority, and the highest available priority compiler is used
# by ATLAS by default.  If the user overrides to a compiler that's listed
# as a possiblity, the flags given in this line will be used (if the user
# does not also override flags) regardless of priority.  In general, here
# are some reserved priorities:
#   1000: Default compiler for particular OS/flag
#    500: Alternative compiler getting roughly same performance
#    100: Alternative compiler getting crappier performance
#     50: Default compiler for particular OS / general family
#     10: Default compiler for particular OS / completely unknown arch
#      0: Fallback compiler when nothing is known
#
# COMPS is a list saying which of ATLAS's compiler this comp/flag combo are
# to be used for:
#  icc: Used to compiler interface; perf neutral, so set to anything user
#       uses for interoperability
#  f77: Same as above but for f77 interface.
#  dkc: Used to compile all non-matmul double prec computational kernels.
#  skc: Used to compile all non-matmul single prec computational kernels.
#  dmc: Used to compile all matmul single prec computational kernels.
#  smc: Used to compile all matmul single prec computational kernels.
#*****************************************************************************
#
# All non-core x86 like these params for MMFLAGS (probably want -O3 for
# Level 1 & 2, but must confirm)
#
# Core2Solo and Core2Duo
MACH=Core2Solo OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc
   'gcc' '-fomit-frame-pointer -mfpmath=sse -msse3 -O2'
# Core2/Corei1/Corei2
MACH=Corei2 OS=Win9x,WinNT LVL=1005 COMPS=smc,dmc,skc,dkc,icc
   'gcc-4' '-fomit-frame-pointer -mfpmath=sse -mavx -O2 -fno-schedule-insns2'
MACH=Corei2 OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc
    'gcc' '-fomit-frame-pointer -mfpmath=sse -mavx -O2 -fno-schedule-insns2'
MACH=Corei1 OS=Win9x,WinNT LVL=1005 COMPS=smc,dmc,skc,dkc,icc
   'gcc-4' '-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -fno-schedule-insns2'
MACH=Corei1 OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc
   'gcc' '-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -fno-schedule-insns2'
MACH=Core2 OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc
   'gcc' '-fomit-frame-pointer -mfpmath=sse -msse3 -O2'
# PPRO,PII,PIII,P4,P4E,K7,HAMMER
MACH=PPRO,PII,PIII,P4,P4E,K7,HAMMER OS=ALL LVL=1000 COMPS=f77
   'gfortran' '-fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4'
MACH=PPRO,PII,PIII,P4,P4E,K7,HAMMER OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc
   'gcc' '-fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4'
MACH=PPRO,PII,PIII,P4,P4E,K7,HAMMER OS=Win9x,WinNT LVL=1005 COMPS=smc,dmc,skc,dkc,icc
   'gcc-4' '-fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4'
# CoreSolo,CoreDuo
MACH=CoreSolo,CoreDuo OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc
   'gcc' '-fomit-frame-pointer -O3 -mfpmath=387'
# 3rd generation opteron (Barcelona and descendents)
MACH=AMD64K10h OS=ALL LVL=1000 COMPS=f77
   'gfortran' '-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -falign-loops=32'
MACH=AMD64K10h OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc
   'gcc' '-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -falign-loops=32'
MACH=AMD64K10h OS=Win9x,WinNT LVL=1005 COMPS=smc,dmc,skc,dkc,icc
   'gcc' '-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -falign-loops=32'
# UltraSPARC T2
MACH=UST2 OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc,xcc
    'gcc' '-mcpu=niagara2 -mtune=niagara2 -Os'
MACH=UST2 OS=ALL LVL=1000 COMPS=f77
   'gfortran' '-mcpu=niagara2 -mtune=niagara2 -Os'
# UltraSPARC III & IV
MACH=USIII,USIV OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc
   'gcc' '-mcpu=ultrasparc3 -mtune=ultrasparc3 -O3 -funroll-all-loops'
MACH=USIII,USIV OS=ALL LVL=1000 COMPS=icc,xcc
   'gcc' '-mcpu=ultrasparc3 -mtune=ultrasparc3 -O'
MACH=USIII,USIV OS=ALL LVL=1000 COMPS=f77
   'f77' '-dalign -native -xO5'
MACH=USIII,USIV OS=ALL LVL=100 COMPS=f77
   'gfortran' '-O -mcpu=ultrasparc3 -mtune=ultrasparc3'
MACH=USIII,USIV OS=ALL LVL=10 COMPS=f77
   'g77' '-O -mcpu=ultrasparc3 -mtune=ultrasparc3'
#
# Itanium & Itanium 2
#
# These gcc 4 default flags will die on gcc3, allowing gcc3's flags to be used
MACH=IA64Itan,IA64Itan2 OS=ALL LVL=1010 COMPS=smc,dmc,skc,dkc
   'gcc' '-fomit-frame-pointer -O2 -fno-tree-loop-optimize'
MACH=IA64Itan,IA64Itan2 OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc
   'gcc' '-fomit-frame-pointer -O2'
MACH=IA64Itan,IA64Itan2 OS=ALL LVL=1010 COMPS=f77
   'gfortran' '-fomit-frame-pointer -O2 -fno-tree-loop-optimize'
#
# IRIX/MIPS
#
MACH=MIPSR1xK OS=IRIX LVL=1000 COMPS=smc,dmc,skc,dkc
   'cc' '-O3 -OPT:Olimit=15000 -LNO:blocking=OFF -LOPT:alias=typed'
MACH=MIPSR1xK OS=IRIX LVL=1000 COMPS=icc,xcc
   'cc' '-O2 -OPT:Olimit=15000 -LNO:blocking=OFF'
MACH=MIPSR1xK OS=IRIX LVL=1000 COMPS=f77
   'f77' '-O2'
#
# Linux/MIPSICE9
#
MACH=MIPSICE9 OS=ALL LVL=1000 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-O2 -mips64 -march=5kf -mtune=5kf -fno-schedule-insns -fschedule-insns2 -fno-peephole -fno-peephole2'
MACH=MIPSICE9 OS=ALL LVL=100 COMPS=f77
   'pathf95' '-march=auto -O2'
#
# G4 flags
#
MACH=PPCG4 OS=ALL LVL=1000 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-O3 -maltivec -mabi=altivec -mcpu=7400 -mtune=7400'
MACH=PPCG4 OS=OSX LVL=1001 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-O3 -maltivec -mabi=altivec -mcpu=7400 -mtune=7400 -no-cpp-precomp -faltivec'

#
# OS X / PowerPC970; the
# The flags -fno-schedule-insns -fno-rerun-loop-opt are a workaround for
# a compiler error in gcc 4.2.  If you have gcc4.1.1, can get back some
# performance by removing them (for all PowerPC platforms)
#
MACH=PPCG5 OS=OSX LVL=1001 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-mpowerpc64 -maltivec -mabi=altivec -mcpu=970 -mtune=970 -faltivec -O3'
MACH=PPCG5 OS=OSX LVL=1010 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-mpowerpc64 -maltivec -mabi=altivec -mcpu=970 -mtune=970 -faltivec -force_cpusubtype_ALL -O3 -fno-schedule-insns -fno-rerun-loop-opt'
MACH=PPCG5 OS=ALL LVL=1000 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-mpowerpc64 -maltivec -mabi=altivec -mcpu=970 -mtune=970 -O3'
MACH=POWER5 OS=ALL LVL=1010 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-mcpu=power5 -mtune=power5 -O3 -fno-schedule-insns -fno-rerun-loop-opt'
MACH=POWER5 OS=ALL LVL=1010 COMPS=f77
   'gfortran' '-mcpu=power5 -mtune=power5 -O3 -fno-schedule-insns -fno-rerun-loop-opt'
MACH=POWER5 OS=ALL LVL=1010 COMPS=f77
   'xlf' '-qtune=pwr5 -qarch=pwr5 -O3 -qmaxmem=-1 -qfloat=hsflt'
MACH=POWER4 OS=ALL LVL=1010 COMPS=icc,dmc,smc,dkc,skc,xcc
   'gcc' '-mcpu=power4 -mtune=power4 -O3 -fno-schedule-insns -fno-rerun-loop-opt'
MACH=POWER4 OS=ALL LVL=1010 COMPS=f77
   'xlf' '-qtune=pwr4 -qarch=pwr4 -O3 -qmaxmem=-1 -qfloat=hsflt'
MACH=POWER6 OS=ALL LVL=1010 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-mcpu=power6 -mtune=power6 -maltivec -O3 -fno-schedule-insns -fschedule-insns2 -minsert-sched-nops=2'
MACH=POWER6 OS=ALL LVL=1010 COMPS=f77
   'gfortran' '-mcpu=power6 -mtune=power6 -maltivec -O3 -fno-schedule-insns -fschedule-insns2 -minsert-sched-nops=2'
MACH=POWER7 OS=ALL LVL=1010 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-O3 -mvsx -mcpu=power7 -mtune=power7 -fno-schedule-insns -fschedule-insns2'
MACH=POWER7 OS=ALL LVL=1010 COMPS=f77
   'gfortran' '-O3 -mvsx -mcpu=power7 -mtune=power7 -fno-schedule-insns -fschedule-insns2'

#
# Windows defaults ; need to make SSE/SSE2 arch dep.
#
MACH=P5,P5MMX,PPRO,PII OS=WinNT LVL=4 COMPS=icc,dmc,smc,dkc,skc,xcc
   'cl' '-Oy -Ox'
MACH=PIII,K7 OS=WinNT LVL=4 COMPS=icc,dmc,smc,dkc,skc,xcc
   'cl' '-Oy -Ox -arch:SSE -nologo'
MACH=ALL OS=WinNT LVL=0 COMPS=icc,dmc,smc,dkc,skc,xcc
   'cl' '-Oy -Ox -arch:SSE2 -nologo'
MACH=ALL OS=WinNT LVL=0 COMPS=f77
   'ifort' '-O2 -fltconsistency -nologo'
MACH=P4,PM OS=WinNT LVL=0 COMPS=icc,dmc,smc,dkc,skc,xcc
   'icl' '-QxN -O3 -Qprec -fp:extended -fp:except -nologo -Oy'
#
# Generic defaults
#
MACH=ALL OS=ALL LVL=5 COMPS=icc,smc,dmc,skc,dkc,xcc
   'gcc' '-O -fomit-frame-pointer'
MACH=ALL OS=ALL LVL=5 COMPS=f77
   'gfortran' '-O'
MACH=ALL OS=ALL LVL=4 COMPS=f77
   'g77' '-O'
MACH=ALL OS=ALL LVL=0 COMPS=f77
   'f77' '-O'
