diff --git a/Makefile b/Makefile index aba1cdd4..1fc77dff 100644 --- a/Makefile +++ b/Makefile @@ -109,14 +109,13 @@ else BUILD_VERSION:=$(GIT_REVISION) endif -CXX=g++ -CPP=cpp +CXX=clang++ OPT=-O2 CXXFLAGS=$(OPT) $(LLVM_CXXFLAGS) -I. -Iobjs/ -I$(CLANG_INCLUDE) \ $(LLVM_VERSION_DEF) \ -Wall \ -DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_VERSION="\"$(BUILD_VERSION)\"" \ - -Wno-sign-compare + -Wno-sign-compare -Wno-unused-function ifneq ($(LLVM_VERSION),LLVM_3_1) CXXFLAGS+=-Werror endif @@ -202,9 +201,14 @@ ispc: print_llvm_src dirs $(OBJS) $(CXX) $(OPT) $(LDFLAGS) -o $@ $(OBJS) $(ISPC_LIBS) # Use clang as a default compiler, instead of gcc +# This is default now. clang: ispc clang: CXX=clang++ +# Use gcc as a default compiler, instead of gcc +gcc: ispc +gcc: CXX=clang++ + # Build ispc with address sanitizer instrumentation using clang compiler # Note that this is not portable build asan: clang diff --git a/alloy.py b/alloy.py index cda51d70..d56ef3a4 100755 --- a/alloy.py +++ b/alloy.py @@ -70,7 +70,7 @@ def try_do_LLVM(text, command, from_validation): error("can't " + text, 1) print_debug("DONE.\n", from_validation, alloy_build) -def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, from_validation, force, make): +def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, extra, from_validation, force, make): print_debug("Building LLVM. Version: " + version_LLVM + ". ", from_validation, alloy_build) if revision != "": print_debug("Revision: " + revision + ".\n", from_validation, alloy_build) @@ -121,6 +121,15 @@ def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, from_v try_do_LLVM("load clang from http://llvm.org/svn/llvm-project/cfe/" + SVN_PATH + " ", "svn co " + revision + " http://llvm.org/svn/llvm-project/cfe/" + SVN_PATH + " clang", from_validation) + if extra == True: + os.chdir("./clang/tools") + try_do_LLVM("load extra clang extra tools ", + "svn co " + revision + " http://llvm.org/svn/llvm-project/clang-tools-extra/" + SVN_PATH + " extra", + from_validation) + os.chdir("../../../projects") + try_do_LLVM("load extra clang compiler-rt ", + "svn co " + revision + " http://llvm.org/svn/llvm-project/compiler-rt/" + SVN_PATH + " compiler-rt", + from_validation) os.chdir("../") else: tar = tarball.split(" ") @@ -286,6 +295,8 @@ def run_special_tests(): i = 5 def validation_run(only, only_targets, reference_branch, number, notify, update, make): + if os.environ["ISPC_HOME"] != os.getcwd(): + error("you ISPC_HOME and your current pass are different!\n", 2) os.chdir(os.environ["ISPC_HOME"]) os.environ["PATH"] = os.environ["ISPC_HOME"] + ":" + os.environ["PATH"] if options.notify != "": @@ -387,7 +398,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update, gen_archs = ["x86-64"] need_LLVM = check_LLVM(LLVM) for i in range(0,len(need_LLVM)): - build_LLVM(need_LLVM[i], "", "", "", False, False, True, False, make) + build_LLVM(need_LLVM[i], "", "", "", False, False, False, True, False, make) # begin validation run for stabitily common.remove_if_exists(stability.in_file) R = [[[],[]],[[],[]],[[],[]],[[],[]]] @@ -465,7 +476,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update, # prepare LLVM 3.3 as newest LLVM need_LLVM = check_LLVM(["3.3"]) if len(need_LLVM) != 0: - build_LLVM(need_LLVM[i], "", "", "", False, False, True, False, make) + build_LLVM(need_LLVM[i], "", "", "", False, False, False, True, False, make) # prepare reference point. build both test and reference compilers try_do_LLVM("apply git", "git branch", True) temp4 = take_lines("git branch", "all") @@ -552,7 +563,7 @@ def Main(): try: if options.build_llvm: build_LLVM(options.version, options.revision, options.folder, options.tarball, - options.debug, options.selfbuild, False, options.force, make) + options.debug, options.selfbuild, options.extra, False, options.force, make) if options.validation_run: validation_run(options.only, options.only_targets, options.branch, options.number_for_performance, options.notify, options.update, make) @@ -628,6 +639,8 @@ llvm_group.add_option('--selfbuild', dest='selfbuild', help='make selfbuild of LLVM and clang', default=False, action="store_true") llvm_group.add_option('--force', dest='force', help='rebuild LLVM', default=False, action='store_true') +llvm_group.add_option('--extra', dest='extra', + help='load extra clang tools', default=False, action='store_true') parser.add_option_group(llvm_group) # options for activity "validation run" run_group = OptionGroup(parser, "Options for validation run", diff --git a/builtins/util.m4 b/builtins/util.m4 index 68fa818b..11501780 100644 --- a/builtins/util.m4 +++ b/builtins/util.m4 @@ -3834,9 +3834,9 @@ domixed: %first = call i64 @llvm.cttz.i64(i64 %mm) %first32 = trunc i64 %first to i32 %baseval = extractelement <$1 x $2> %v, i32 %first32 - %basev1 = bitcast $2 %baseval to <1 x $2> + %basev1 = insertelement <$1 x $2> undef, $2 %baseval, i32 0 ; get a vector that is that value smeared across all elements - %basesmear = shufflevector <1 x $2> %basev1, <1 x $2> undef, + %basesmear = shufflevector <$1 x $2> %basev1, <$1 x $2> undef, <$1 x i32> < forloop(i, 0, eval($1-2), `i32 0, ') i32 0 > ; now to a blend of that vector with the original vector, such that the diff --git a/cbackend.cpp b/cbackend.cpp index 7d4b4cfc..481ca3fd 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -3066,7 +3066,7 @@ void CWriter::visitReturnInst(llvm::ReturnInst &I) { // Don't output a void return if this is the last basic block in the function if (I.getNumOperands() == 0 && &*--I.getParent()->getParent()->end() == I.getParent() && - !I.getParent()->size() == 1) { + (!I.getParent()->size()) == 1) { return; } diff --git a/examples/aobench_instrumented/Makefile b/examples/aobench_instrumented/Makefile index 9921cf3e..d0b27cbf 100644 --- a/examples/aobench_instrumented/Makefile +++ b/examples/aobench_instrumented/Makefile @@ -1,5 +1,5 @@ -CXX=g++ -m64 +CXX=clang++ -m64 CXXFLAGS=-Iobjs/ -g3 -Wall ISPC=ispc ISPCFLAGS=-O2 --instrument --arch=x86-64 --target=sse2 diff --git a/examples/common.mk b/examples/common.mk index 367d3eb3..db7b8eee 100644 --- a/examples/common.mk +++ b/examples/common.mk @@ -3,14 +3,14 @@ TASK_CXX=../tasksys.cpp TASK_LIB=-lpthread TASK_OBJ=objs/tasksys.o -CXX=g++ -CXXFLAGS=-Iobjs/ -O2 -CC=gcc -CCFLAGS=-Iobjs/ -O2 +CXX=clang++ +CXXFLAGS+=-Iobjs/ -O2 +CC=clang +CCFLAGS+=-Iobjs/ -O2 LIBS=-lm $(TASK_LIB) -lstdc++ ISPC=ispc -ISPC_FLAGS=-O2 +ISPC_FLAGS+=-O2 ISPC_HEADER=objs/$(ISPC_SRC:.ispc=_ispc.h) ARCH:=$(shell uname -m | sed -e s/x86_64/x86/ -e s/i686/x86/ -e s/arm.*/arm/ -e s/sa110/arm/) diff --git a/examples/simple/Makefile b/examples/simple/Makefile index 80f09193..dce7942b 100644 --- a/examples/simple/Makefile +++ b/examples/simple/Makefile @@ -1,5 +1,5 @@ -CXX=g++ -m64 +CXX=clang++ -m64 CXXFLAGS=-Iobjs/ -O3 -Wall ISPC=ispc ISPCFLAGS=-O2 --arch=x86-64 --target=sse2 diff --git a/fail_db.txt b/fail_db.txt index 31db9961..f1aaaab2 100644 --- a/fail_db.txt +++ b/fail_db.txt @@ -8,42 +8,17 @@ % ./tests/masked-scatter-vector.ispc runfail x86-64 sse2-i32x4 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-13.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-10.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-11.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-13.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-5.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-6.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-13.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-10.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-11.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-13.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-5.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-6.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.4 -O2 * ./tests/funcptr-null-4.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * ./tests/funcptr-null-5.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * ./tests/funcptr-null-6.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-13.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-10.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-11.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-13.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-5.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-6.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * ./tests/funcptr-null-4.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * ./tests/funcptr-null-5.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * ./tests/funcptr-null-6.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-13.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-10.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-11.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-13.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-5.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/reduce-equal-6.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/avg-down-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/avg-up-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/avg-down-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.3 g++4.4 -O2 * -./tests/avg-up-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-4.ispc runfail x86-64 generic-4 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-6.ispc runfail x86-64 generic-4 Linux LLVM 3.3 g++4.4 -O2 * -./tests/atomics-swap.ispc runfail x86-64 generic-4 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-varyingptr-2.ispc runfail x86-64 generic-4 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-varyingptr-4.ispc runfail x86-64 generic-4 Linux LLVM 3.3 g++4.4 -O2 * ./tests/avg-down-uint16.ispc runfail x86-64 generic-4 Linux LLVM 3.3 g++4.4 -O2 * @@ -158,10 +133,6 @@ ./tests/funcptr-null-4.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 g++4.4 -O2 * ./tests/funcptr-null-5.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 g++4.4 -O2 * ./tests/funcptr-null-6.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 g++4.4 -O2 * -./tests/avg-down-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.4 g++4.4 -O2 * -./tests/avg-up-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.4 g++4.4 -O2 * -./tests/avg-down-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.4 g++4.4 -O2 * -./tests/avg-up-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.4 g++4.4 -O2 * ./tests/array-gather-ifs.ispc runfail x86-64 generic-4 Linux LLVM 3.4 g++4.4 -O2 * ./tests/array-gather-multi-unif.ispc runfail x86-64 generic-4 Linux LLVM 3.4 g++4.4 -O2 * ./tests/array-gather-unif.ispc runfail x86-64 generic-4 Linux LLVM 3.4 g++4.4 -O2 * @@ -330,42 +301,17 @@ ./tests/reduce-equal.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 g++4.4 -O2 * ./tests/test-141.ispc runfail x86 avx2-i32x16 Linux LLVM 3.4 g++4.4 -O2 * ./tests/test-141.ispc runfail x86-64 avx2-i32x16 Linux LLVM 3.4 g++4.4 -O2 * -./tests/atomics-swap.ispc runfail x86-64 generic-4 Linux LLVM 3.4 g++4.4 -O2 * ./tests/masked-scatter-struct.ispc runfail x86-64 generic-4 Linux LLVM 3.3 g++4.4 -O2 * ./tests/atomics-13.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-10.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-11.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-13.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-5.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-6.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * ./tests/atomics-13.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-10.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-11.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-13.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-5.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-6.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 g++4.7 -O2 * ./tests/funcptr-null-4.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/funcptr-null-5.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/funcptr-null-6.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/atomics-13.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-10.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-11.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-13.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-5.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-6.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/funcptr-null-4.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/funcptr-null-5.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/funcptr-null-6.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/atomics-13.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-10.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-11.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-13.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-5.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/reduce-equal-6.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/avg-down-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/avg-up-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/avg-down-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.3 g++4.7 -O2 * -./tests/avg-up-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/avg-down-int8.ispc compfail x86 avx1.1-i32x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/avg-up-int8.ispc compfail x86 avx1.1-i32x16 Linux LLVM 3.3 g++4.7 -O2 * ./tests/avg-down-int8.ispc compfail x86-64 avx1.1-i32x16 Linux LLVM 3.3 g++4.7 -O2 * @@ -425,10 +371,6 @@ ./tests/funcptr-null-4.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 g++4.7 -O2 * ./tests/funcptr-null-5.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 g++4.7 -O2 * ./tests/funcptr-null-6.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 g++4.7 -O2 * -./tests/avg-down-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.4 g++4.7 -O2 * -./tests/avg-up-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.4 g++4.7 -O2 * -./tests/avg-down-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.4 g++4.7 -O2 * -./tests/avg-up-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.4 g++4.7 -O2 * ./tests/avg-down-int8.ispc compfail x86 avx1.1-i32x16 Linux LLVM 3.4 g++4.7 -O2 * ./tests/avg-up-int8.ispc compfail x86 avx1.1-i32x16 Linux LLVM 3.4 g++4.7 -O2 * ./tests/avg-down-int8.ispc compfail x86-64 avx1.1-i32x16 Linux LLVM 3.4 g++4.7 -O2 * @@ -949,3 +891,137 @@ .\tests\uint64-min-1.ispc runfail x86 avx1-i64x4 Windows LLVM 3.3 cl -O2 * .\tests\uint64-min.ispc runfail x86 avx1-i64x4 Windows LLVM 3.3 cl -O2 * .\tests\reduce-min-uint64.ispc runfail x86 avx1-i64x4 Windows LLVM 3.4 cl -O2 * +./tests/atomics-13.ispc compfail x86 sse4-i16x8 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/atomics-13.ispc compfail x86-64 sse4-i16x8 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-4.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-5.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-6.ispc runfail x86 sse4-i8x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/atomics-13.ispc compfail x86 sse4-i8x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-4.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-5.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-6.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/atomics-13.ispc compfail x86-64 sse4-i8x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/ptr-assign-lhs-math-1.ispc compfail x86-64 generic-4 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/short-vec-8.ispc compfail x86-64 generic-4 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86-64 generic-16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/test-143.ispc runfail x86-64 generic-16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/ptr-assign-lhs-math-1.ispc compfail x86-64 generic-16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86 avx1.1-i32x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86 avx1.1-i32x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86-64 avx1.1-i32x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86-64 avx1.1-i32x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86 avx2-i32x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86-64 avx2-i32x16 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/reduce-equal-4.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-4.ispc runfail x86 sse4-i8x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-5.ispc runfail x86 sse4-i8x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-6.ispc runfail x86 sse4-i8x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-4.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-5.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-6.ispc runfail x86-64 sse4-i8x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86 avx1-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86-64 avx1-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/ptr-assign-lhs-math-1.ispc compfail x86-64 generic-4 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/short-vec-8.ispc compfail x86-64 generic-4 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86-64 generic-16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/test-143.ispc runfail x86-64 generic-16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/ptr-assign-lhs-math-1.ispc compfail x86-64 generic-16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86 avx1.1-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86 avx1.1-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86-64 avx1.1-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86-64 avx1.1-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/atomics-varyingptr-2.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/atomics-varyingptr-3.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/atomics-varyingptr-4.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-11.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-12.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-13.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-4.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-5.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-6.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-7.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-8.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-swap.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-varyingptr-2.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-varyingptr-3.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-varyingptr-4.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/memset-varying.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-1.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-12.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-13.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-2.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-3.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-4.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-5.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-6.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-7.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal.ispc compfail x86-64 avx2-i32x8 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86 avx2-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86-64 avx2-i32x16 Linux LLVM 3.4 clang++3.3 -O2 * +./tests/atomics-13.ispc compfail x86 sse4-i16x8 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/atomics-13.ispc compfail x86-64 sse4-i16x8 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-4.ispc runfail x86 sse4-i8x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-5.ispc runfail x86 sse4-i8x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-6.ispc runfail x86 sse4-i8x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/atomics-13.ispc compfail x86 sse4-i8x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-4.ispc runfail x86-64 sse4-i8x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-5.ispc runfail x86-64 sse4-i8x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-6.ispc runfail x86-64 sse4-i8x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/atomics-13.ispc compfail x86-64 sse4-i8x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/ptr-assign-lhs-math-1.ispc compfail x86-64 generic-4 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/short-vec-8.ispc compfail x86-64 generic-4 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86-64 generic-16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/test-143.ispc runfail x86-64 generic-16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/ptr-assign-lhs-math-1.ispc compfail x86-64 generic-16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86 avx2-i32x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86-64 avx2-i32x16 Mac LLVM 3.3 clang++3.3 -O2 * +./tests/funcptr-null-4.ispc runfail x86 sse4-i8x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-5.ispc runfail x86 sse4-i8x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-6.ispc runfail x86 sse4-i8x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-4.ispc runfail x86-64 sse4-i8x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-5.ispc runfail x86-64 sse4-i8x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/funcptr-null-6.ispc runfail x86-64 sse4-i8x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86 avx1-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86 avx1-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86-64 avx1-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86-64 avx1-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86 avx1.1-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86 avx1.1-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/avg-down-int8.ispc compfail x86-64 avx1.1-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/avg-up-int8.ispc compfail x86-64 avx1.1-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/ptr-assign-lhs-math-1.ispc compfail x86-64 generic-4 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/short-vec-8.ispc compfail x86-64 generic-4 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86-64 generic-16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/test-143.ispc runfail x86-64 generic-16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/ptr-assign-lhs-math-1.ispc compfail x86-64 generic-16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/double-3.ispc runfail x86 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/atomics-varyingptr-2.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/atomics-varyingptr-3.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/atomics-varyingptr-4.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-11.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-12.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-13.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-4.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-5.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-6.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-7.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-8.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-swap.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-varyingptr-2.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-varyingptr-3.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/local-atomics-varyingptr-4.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/memset-varying.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-1.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-12.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-13.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-2.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-3.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-4.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-5.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-6.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal-7.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/reduce-equal.ispc compfail x86-64 avx2-i32x8 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86 avx2-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * +./tests/test-141.ispc runfail x86-64 avx2-i32x16 Mac LLVM 3.4 clang++3.3 -O2 * diff --git a/ispc.cpp b/ispc.cpp index 0d9a4190..bd28fc51 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -735,7 +735,7 @@ const char * Target::SupportedTargets() { return "nvptx64, " #ifdef ISPC_ARM_ENABLED - "neon-i8x16, neon-16x8, neon-32x4, " + "neon-i8x16, neon-i16x8, neon-i32x4, " #endif "sse2-i32x4, sse2-i32x8, " "sse4-i32x4, sse4-i32x8, sse4-i16x8, sse4-i8x16, " diff --git a/llvm_patches/3_3_0001-Fix-PR16807.patch b/llvm_patches/3_3_0001-Fix-PR16807.patch new file mode 100755 index 00000000..daf1327c --- /dev/null +++ b/llvm_patches/3_3_0001-Fix-PR16807.patch @@ -0,0 +1,78 @@ +From b9c47f44691cb9a648b9fa1ae373f0defe53c757 Mon Sep 17 00:00:00 2001 +From: Michael Liao +Date: Thu, 10 Oct 2013 16:47:00 -0700 +Subject: [PATCH] Fix PR16807 + +- Lower signed division by constant powers-of-2 to target-independent + DAG operators instead of target-dependent ones to support them on + targets where vector types are legal but shift operators on that types + are illegal, e.g. on AVX, PSRAW is only available on <8 x i16> though + <16 x i16> is a legal type. +--- + lib/Target/X86/X86ISelLowering.cpp | 22 ++++++++++++++++------ + test/CodeGen/X86/pr16807.ll | 18 ++++++++++++++++++ + 2 files changed, 34 insertions(+), 6 deletions(-) + create mode 100644 test/CodeGen/X86/pr16807.ll + +diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp +index bd5ad4e..518bb90 100644 +--- lib/Target/X86/X86ISelLowering.cpp ++++ lib/Target/X86/X86ISelLowering.cpp +@@ -12462,14 +12462,24 @@ static SDValue LowerSDIV(SDValue Op, SelectionDAG &DAG) { + (SplatValue.isPowerOf2() || (-SplatValue).isPowerOf2())) { + unsigned lg2 = SplatValue.countTrailingZeros(); + // Splat the sign bit. +- SDValue Sz = DAG.getConstant(EltTy.getSizeInBits()-1, MVT::i32); +- SDValue SGN = getTargetVShiftNode(X86ISD::VSRAI, dl, VT, N0, Sz, DAG); ++ SmallVector Sz(NumElts, ++ DAG.getConstant(EltTy.getSizeInBits() - 1, ++ EltTy)); ++ SDValue SGN = DAG.getNode(ISD::SRA, dl, VT, N0, ++ DAG.getNode(ISD::BUILD_VECTOR, dl, VT, &Sz[0], ++ NumElts)); + // Add (N0 < 0) ? abs2 - 1 : 0; +- SDValue Amt = DAG.getConstant(EltTy.getSizeInBits() - lg2, MVT::i32); +- SDValue SRL = getTargetVShiftNode(X86ISD::VSRLI, dl, VT, SGN, Amt, DAG); ++ SmallVector Amt(NumElts, ++ DAG.getConstant(EltTy.getSizeInBits() - lg2, ++ EltTy)); ++ SDValue SRL = DAG.getNode(ISD::SRL, dl, VT, SGN, ++ DAG.getNode(ISD::BUILD_VECTOR, dl, VT, &Amt[0], ++ NumElts)); + SDValue ADD = DAG.getNode(ISD::ADD, dl, VT, N0, SRL); +- SDValue Lg2Amt = DAG.getConstant(lg2, MVT::i32); +- SDValue SRA = getTargetVShiftNode(X86ISD::VSRAI, dl, VT, ADD, Lg2Amt, DAG); ++ SmallVector Lg2Amt(NumElts, DAG.getConstant(lg2, EltTy)); ++ SDValue SRA = DAG.getNode(ISD::SRA, dl, VT, ADD, ++ DAG.getNode(ISD::BUILD_VECTOR, dl, VT, &Lg2Amt[0], ++ NumElts)); + + // If we're dividing by a positive value, we're done. Otherwise, we must + // negate the result. +diff --git a/test/CodeGen/X86/pr16807.ll b/test/CodeGen/X86/pr16807.ll +new file mode 100644 +index 0000000..6d55d99 +--- /dev/null ++++ test/CodeGen/X86/pr16807.ll +@@ -0,0 +1,18 @@ ++; RUN: llc < %s -mtriple=x86_64-linux-gnu -mcpu=core-avx-i | FileCheck %s ++ ++define <16 x i16> @f_fu(<16 x i16> %bf) { ++allocas: ++ %avg.i.i = sdiv <16 x i16> %bf, ++ ret <16 x i16> %avg.i.i ++} ++ ++; CHECK: f_fu ++; CHECK: psraw ++; CHECK: psrlw ++; CHECK: paddw ++; CHECK: psraw ++; CHECK: psraw ++; CHECK: psrlw ++; CHECK: paddw ++; CHECK: psraw ++; CHECK: ret +-- +1.8.1.2 + diff --git a/module.cpp b/module.cpp index 755a5dc4..41861a2d 100644 --- a/module.cpp +++ b/module.cpp @@ -936,7 +936,7 @@ Module::AddExportedTypes(const std::vectorfinalize(); lStripUnusedDebugInfo(module); diff --git a/perf.py b/perf.py index 576a5c7d..2b5c6edd 100755 --- a/perf.py +++ b/perf.py @@ -299,6 +299,22 @@ def perf(options1, args): if cpu_percent > 20: error("CPU Usage is very high.\nClose other applications.\n", 2) + # prepare build.log, perf_temp and perf.log files + global perf_log + if options.in_file: + perf_log = pwd + options.in_file + common.remove_if_exists(perf_log) + else: + perf_log = "" + global build_log + build_log = pwd + os.sep + "logs" + os.sep + "perf_build.log" + common.remove_if_exists(build_log) + if os.path.exists(pwd + os.sep + "logs") == False: + os.makedirs(pwd + os.sep + "logs") + global perf_temp + perf_temp = pwd + "perf_temp" + + global ispc_test global ispc_ref global ref_compiler @@ -310,8 +326,8 @@ def perf(options1, args): ref_compiler_exists = False if is_windows == False: ispc_test = "ispc" - ref_compiler = "g++" - refc_compiler = "gcc" + ref_compiler = "clang++" + refc_compiler = "clang" if options.compiler != "": if options.compiler == "clang" or options.compiler == "clang++": ref_compiler = "clang++" @@ -319,21 +335,30 @@ def perf(options1, args): if options.compiler == "icc" or options.compiler == "icpc": ref_compiler = "icpc" refc_compiler = "icc" + if options.compiler == "gcc" or options.compiler == "g++": + ref_compiler = "g++" + refc_compiler = "gcc" else: ispc_test = "ispc.exe" ref_compiler = "cl.exe" ispc_ref = options.ref if options.ref != "": options.ref = True - for counter in PATH_dir: - if os.path.exists(counter + os.sep + ispc_test): + if os.environ.get("ISPC_HOME") != None: + if os.path.exists(os.environ["ISPC_HOME"] + os.sep + ispc_test): ispc_test_exists = True + ispc_test = os.environ["ISPC_HOME"] + os.sep + ispc_test + for counter in PATH_dir: + if ispc_test_exists == False: + if os.path.exists(counter + os.sep + ispc_test): + ispc_test_exists = True + ispc_test = counter + os.sep + ispc_test if os.path.exists(counter + os.sep + ref_compiler): ref_compiler_exists = True if os.path.exists(counter + os.sep + ispc_ref): ispc_ref_exists = True if not ispc_test_exists: - error("ISPC compiler not found.\nAdded path to ispc compiler to your PATH variable.\n", 1) + error("ISPC compiler not found.\nAdded path to ispc compiler to your PATH variable or ISPC_HOME variable\n", 1) if not ref_compiler_exists: error("C/C++ compiler %s not found.\nAdded path to %s compiler to your PATH variable.\n" % (ref_compiler, ref_compiler), 1) if options.ref: @@ -355,26 +380,11 @@ def perf(options1, args): if f_lines[i][0] != "%": lines.append(f_lines[i]) length = len(lines) - - # prepare build.log, perf_temp and perf.log files - global perf_log - if options.in_file: - perf_log = pwd + options.in_file - common.remove_if_exists(perf_log) - else: - perf_log = "" - global build_log - build_log = pwd + os.sep + "logs" + os.sep + "perf_build.log" - common.remove_if_exists(build_log) - if os.path.exists(pwd + os.sep + "logs") == False: - os.makedirs(pwd + os.sep + "logs") - - global perf_temp - perf_temp = pwd + "perf_temp" # end of preparations print_debug("Okey go go go!\n\n", s, perf_log) - + print_debug("Testing ispc: " + ispc_test + "\n", s, perf_log) + #print compilers versions common.print_version(ispc_test, ispc_ref, ref_compiler, False, perf_log, is_windows) diff --git a/run_tests.py b/run_tests.py index 4ee80fe3..803410b8 100755 --- a/run_tests.py +++ b/run_tests.py @@ -446,7 +446,7 @@ def verify(): f = open(test_states, 'r') f_lines = f.readlines() f.close() - check = [["g++", "clang", "cl"],["-O0", "-O2"],["x86","x86-64"], + check = [["g++", "clang++", "cl"],["-O0", "-O2"],["x86","x86-64"], ["Linux","Windows","Mac"],["LLVM 3.1","LLVM 3.2","LLVM 3.3","LLVM head"], ["sse2-i32x4", "sse2-i32x8", "sse4-i32x4", "sse4-i32x8", "sse4-i16x8", "sse4-i8x16", "avx1-i32x8", "avx1-i32x16", "avx1-i64x4", "avx1.1-i32x8", "avx1.1-i32x16", @@ -501,16 +501,26 @@ def run_tests(options1, args, print_version): # use relative path to not depend on host directory, which may possibly # have white spaces and unicode characters. global ispc_exe + ispc_exe = "" if not is_windows: - ispc_exe = "./ispc" + if os.environ.get("ISPC_HOME") != None: + if os.path.exists(os.environ["ISPC_HOME"] + os.sep + "ispc"): + ispc_exe = os.environ["ISPC_HOME"] + os.sep + "ispc" + else: + PATH_dir = string.split(os.getenv("PATH"), os.pathsep) + for counter in PATH_dir: + if os.path.exists(counter + os.sep + "ispc"): + ispc_exe = counter + os.sep + "ispc" else: - ispc_exe = ".\\Release\\ispc.exe" - + if os.path.exists(".\\Release\\ispc.exe"): + ispc_exe = ".\\Release\\ispc.exe" + else: + error("You don't have ispc.exe compiler in .\\Release.\n", 1) # checks the required ispc compiler otherwise prints an error message - if not os.path.exists(ispc_exe): - error("missing ispc compiler: %s\n" % ispc_exe, 1) + if ispc_exe == "": + error("ISPC compiler not found.\nAdded path to ispc compiler to your PATH variable or ISPC_HOME variable\n", 1) + print_debug("Testing ispc: " + ispc_exe + "\n", s, run_tests_log) ispc_exe += " " + options.ispc_flags - print_debug("ispc compiler: %s\n" % ispc_exe, s, run_tests_log) global is_generic_target is_generic_target = (options.target.find("generic-") != -1 and @@ -540,7 +550,7 @@ def run_tests(options1, args, print_version): if is_windows: options.compiler_exe = "cl.exe" else: - options.compiler_exe = "g++" + options.compiler_exe = "clang++" # checks the required compiler otherwise prints an error message PATH_dir = string.split(os.getenv("PATH"), os.pathsep)