Raymond Toy pushed to branch master at cmucl / cmucl
Commits: 8f18e12c by Raymond Toy at 2021-02-05T05:14:29+00:00 Fix #101: Add -ftrapping-math to clang compiler options
Because lisp runs with FP traps enabled, we want the C code to honor that. Hence add -ftrapping-math.
Also cleaned up the options, replacing -march=pentium4 and -mtune=generic with just -mtune=pentiume4. Replace -mfpmath=sse (not sure what that does) with -msse2.
Finally, update CI to do a clang build so we can verify this actually works.
- - - - - f99321c7 by Raymond Toy at 2021-02-05T05:14:29+00:00 Merge branch 'issue-101-clang-trapping-math' into 'master'
Fix #101: Add -ftrapping-math to clang compiler options
Closes #101
See merge request cmucl/cmucl!70 - - - - -
2 changed files:
- .gitlab-ci.yml - src/lisp/Config.x86_linux_clang
Changes:
===================================== .gitlab-ci.yml ===================================== @@ -7,6 +7,7 @@ stages: - install - build - test + - ansi-test - benchmark
cache: @@ -41,7 +42,7 @@ linux:build: #- bin/create-target.sh xcross x86_linux_clang #- bin/cross-build-world.sh -crl -B boot-2020-04-1 xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp snapshot/bin/lisp # Regular build using the cross-compiled result or snapshot - - bin/build.sh $bootstrap -R -C "" -o snapshot/bin/lisp + - bin/build.sh $bootstrap -R -C "x86_linux_clang" -o snapshot/bin/lisp - bin/make-dist.sh -I dist linux-4
linux:test: @@ -56,15 +57,28 @@ linux:test: # Needs artifacts from build (dist/) - job: linux:build artifacts: true + script: + - bin/run-tests.sh -l dist/bin/lisp 2>&1 | tee test.log + +linux:ansi-test: + stage: ansi-test + tags: + - linux + artifacts: + paths: + - ansi-test/test.out + needs: + # Needs artifacts from build (dist/) + - job: linux:build + artifacts: true before_script: - git clone https://gitlab.common-lisp.net/cmucl/ansi-test.git - (cd ansi-test; git checkout rtoy-cmucl-expected-failures) script: - - bin/run-tests.sh -l dist/bin/lisp 2>&1 | tee test.log - cd ansi-test - make LISP="../dist/bin/lisp -batch -noinit -nositeinit" - grep 'No unexpected (successes|failures)' test.out - + linux:benchmark: stage: benchmark tags: @@ -121,21 +135,33 @@ osx:test: - osx artifacts: paths: - - ansi-test/test.out - test.log needs: # Needs artifacts from build (dist/) - job: osx:build artifacts: true + script: + - bin/run-tests.sh -l dist/bin/lisp 2>&1 | tee test.log + +osx:ansi-test: + stage: ansi-test + tags: + - osx + artifacts: + paths: + - ansi-test/test.out + needs: + # Needs artifacts from build (dist/) + - job: osx:build + artifacts: true before_script: - git clone https://gitlab.common-lisp.net/cmucl/ansi-test.git - (cd ansi-test; git checkout rtoy-cmucl-expected-failures) script: - - bin/run-tests.sh -l dist/bin/lisp 2>&1 | tee test.log - cd ansi-test - make LISP="../dist/bin/lisp -batch -noinit -nositeinit" - grep 'No unexpected (successes|failures)' test.out - + osx:benchmark: stage: benchmark tags:
===================================== src/lisp/Config.x86_linux_clang ===================================== @@ -4,7 +4,11 @@ include Config.x86_common CC = clang CPPFLAGS += -m32 -D__NO_CTYPE -D_GNU_SOURCE CFLAGS += $(COPT) -CFLAGS += -march=pentium4 -mfpmath=sse -mtune=generic + +# Allow sse2 instructions (-msse2); and tune for pentium4 +# (-mtune=pentium4), the first chip to have sse2; and finally generate +# code assuming instructions can trap (-ftrapping-math). +CFLAGS += -msse2 -mtune=pentium4 -ftrapping-math
UNDEFSYMPATTERN = -Xlinker -u -Xlinker & ASSEM_SRC += linux-stubs.S
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/408711a94a60d6bb1422edf...