Only set gcc's "-msse4.2", etc, option when compiling for generic targets.

We don't need it when ispc is just generating an object file directly, and gcc
on OS X doesn't recognize -mavx.
This commit is contained in:
Matt Pharr
2012-07-13 12:01:04 -07:00
parent 371d4be8ef
commit 9a1932eaf7

View File

@@ -265,11 +265,9 @@ def run_test(filename):
gcc_arch = '-m64'
gcc_isa=""
if options.target == 'sse2' or options.target == 'sse2-x2':
gcc_isa = '-msse3'
if options.target == 'sse4' or options.target == 'sse4-x2' or options.target == 'generic-4':
if options.target == 'generic-4':
gcc_isa = '-msse4.2'
if options.target == 'avx' or options.target == 'avx-x2' or options.target == 'generic-8':
if options.target == 'generic-8':
gcc_isa = '-mavx'
if (options.target == 'generic-16' or options.target == 'generic-32' or options.target == 'generic-64') \
and (options.include_file.find("knc.h")!=-1 or options.include_file.find("knc2x.h")!=-1):