[Git][cmucl/cmucl][rtoy-use-ssse3-insts] Refine features to include sse4 for popcnt
Raymond Toy
gitlab at common-lisp.net
Sun Apr 19 17:33:46 UTC 2020
Raymond Toy pushed to branch rtoy-use-ssse3-insts at cmucl / cmucl
Commits:
285d1d96 by Raymond Toy at 2020-04-19T10:33:27-07:00
Refine features to include sse4 for popcnt
popcnt is part of sse4, not sse3/ssse3, so add feature detection for
sse4 to enable use of this instruciton.
sse4 and ppcnt was first available in the Nehalem architecture, Nov
2008 in the first gen of Core i7 and i5 processors. The oldest
machines I have access to date from 2011.
Also remove :ssse3 because we don't currently define or use any ssse3
instructions.
Add a bit of documentation about popcnt.
Setup CI to build with a bootstrap file to get these instructions.
- - - - -
5 changed files:
- .gitlab-ci.yml
- src/bootfiles/21d/boot-2020-04.lisp
- src/code/x86-vm.lisp
- src/compiler/x86/arith.lisp
- src/compiler/x86/insts.lisp
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -1,7 +1,7 @@
variables:
download_url: "https://common-lisp.net/project/cmucl/downloads/snapshots/2020/04"
version: "2020-04-x86"
- bootstrap: ""
+ bootstrap: "-B boot-2020-04"
linux-runner:
tags:
=====================================
src/bootfiles/21d/boot-2020-04.lisp
=====================================
@@ -2,4 +2,6 @@
#+x86
(pushnew :sse3 *features*)
#+x86
-(pushnew :ssse3 *features*)
\ No newline at end of file
+(pushnew :ssse3 *features*)
+#+x86
+(pushnew :sse4 *features*)
=====================================
src/code/x86-vm.lisp
=====================================
@@ -42,12 +42,21 @@
(setf *features* (delete :x87 *features*))
(sys:register-lisp-feature :sse2))
+#+sse3
+(progn
+ (setf *features* (delete :x87 *features*))
+ (sys:register-lisp-feature :sse3))
+
#+ssse3
(progn
(setf *features* (delete :x87 *features*))
- (sys:register-lisp-feature :sse3)
(sys:register-lisp-feature :ssse3))
+#+sse4
+(progn
+ (setf *features* (delete :x87 *features*))
+ (sys:register-lisp-feature :sse4))
+
#+(or darwin linux)
(sys:register-lisp-runtime-feature :relocatable-stacks)
=====================================
src/compiler/x86/arith.lisp
=====================================
@@ -964,7 +964,7 @@
(:arg-types unsigned-num)
(:results (result :scs (unsigned-reg)))
(:result-types positive-fixnum)
- (:guard (backend-featurep :sse3))
+ (:guard (backend-featurep :sse4))
(:generator 2
(inst popcnt result arg)))
=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -3201,6 +3201,7 @@
(define-regular-sse-inst paddq #x66 #xd4)
)
+;; SSE4 instruction
(define-instruction popcnt (segment dst src)
(:printer ext-reg-reg/mem
((prefix #xf3) (op #xb8)))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/285d1d9603e8b02d43d78412c335c0ca9a31111a
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/285d1d9603e8b02d43d78412c335c0ca9a31111a
You're receiving this email because of your account on gitlab.common-lisp.net.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20200419/1a94bea8/attachment-0001.htm>
More information about the cmucl-cvs
mailing list