Skip to content
Snippets Groups Projects
Commit c17392f4 authored by Raymond Toy's avatar Raymond Toy
Browse files

Add popcnt instruction and use it in logcount vop if :sse3 is a

feature.

 * src/compiler/x86/arith.lisp
   * Add vop for logcount that uses popcnt instruction.
 * src/compiler/x86/insts.lisp
   * Define popcnt instruction (but only for :sse3)
 * src/general-info/release-20d.txt:
   * Update.
parent c4379fd5
No related branches found
No related tags found
No related merge requests found
......@@ -900,6 +900,18 @@
(inst and temp #x0000ffff)
(inst add result temp)))
(define-vop (sse3-unsigned-byte-32-count)
(:translate logcount)
(:note _N"inline (unsigned-byte 32) logcount")
(:policy :fast-safe)
(:args (arg :scs (unsigned-reg)))
(:arg-types unsigned-num)
(:results (result :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:temporary (:sc unsigned-reg :from (:argument 0)) temp)
(:guard (backend-featurep :sse3))
(:generator 2
(inst popcnt result arg)))
;;;; Binary conditional VOPs:
......
......
......@@ -3091,6 +3091,17 @@
:type 'sized-xmmreg/mem)
(reg :field (byte 3 27) :type 'reg))
;;; Like ext-reg-xmm/mem, but both are registers
(disassem:define-instruction-format (ext-reg-reg/mem 32
:default-printer
'(:name :tab reg ", " reg/mem))
(prefix :field (byte 8 0))
(x0f :field (byte 8 8) :value #x0f)
(op :field (byte 8 16))
(reg/mem :fields (list (byte 2 30) (byte 3 24))
:type 'reg/mem)
(reg :field (byte 3 27) :type 'reg))
(disassem:define-instruction-format
(ext-xmm-xmm/mem-imm 32
:include 'ext-xmm-xmm/mem
......@@ -3182,9 +3193,12 @@
;; dst[63:0] = dst[63:0]
;; dst[127:64] = src[63:0]
(define-regular-sse-inst unpcklpd #x66 #x14 t)
(define-regular-sse-inst unpcklps nil #x14 t)
(define-regular-sse-inst unpcklps nil #x14 t))
)
(define-instruction popcnt (segment dst src)
(:printer ext-reg-reg/mem
((prefix #xf3) (op #xb8)))
(:emitter (emit-sse-inst segment dst src #xf3 #xb8)))
;;; MOVSD, MOVSS
(macrolet ((define-movsd/ss-sse-inst (name prefix op)
......
......
......@@ -42,6 +42,7 @@ New in this release:
* Updated to Unicode 6.1.0.
* Many additional aliases for external formats added that match
the glibc iconv aliases.
* Implement faster LOGCOUNT function, if :SSE3 feature is available.
* ANSI compliance fixes:
* CMUCL was not printing pathnames like (make-pathname :directory
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment