X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Finsts.lisp;h=29cb69827a988e82ba8c0cab00e7f2de3d247ff2;hb=cd13034f9415f64cdaa05893a4ac5ff1e95c97bd;hp=c64e761c9a22c30c76c6a6aad9ac56e6e7ecb1b3;hpb=c68bb6b62d2813eb5af3cb7d4502625990a933d6;p=sbcl.git diff --git a/src/compiler/x86/insts.lisp b/src/compiler/x86/insts.lisp index c64e761..29cb698 100644 --- a/src/compiler/x86/insts.lisp +++ b/src/compiler/x86/insts.lisp @@ -588,6 +588,16 @@ :type 'byte-reg/mem) (reg :field (byte 3 19) :value #b000)) +(sb!disassem:define-instruction-format (cond-move 24 + :default-printer + '('cmov cc :tab reg ", " reg/mem)) + (prefix :field (byte 8 0) :value #b00001111) + (op :field (byte 4 12) :value #b0100) + (cc :field (byte 4 8) :type 'condition-code) + (reg/mem :fields (list (byte 2 22) (byte 3 16)) + :type 'reg/mem) + (reg :field (byte 3 19) :type 'reg)) + (sb!disassem:define-instruction-format (enter-format 32 :default-printer '(:name :tab disp @@ -627,7 +637,7 @@ (let ((offset (fixup-offset fixup))) (if (label-p offset) (emit-back-patch segment - 4 ; FIXME: sb!vm:n-word-bytes + 4 ; FIXME: n-word-bytes (lambda (segment posn) (declare (ignore posn)) (emit-dword segment @@ -656,7 +666,7 @@ (base nil :type (or tn null)) (index nil :type (or tn null)) (scale 1 :type (member 1 2 4 8)) - (disp 0 :type (or (signed-byte 32) fixup))) + (disp 0 :type (or (unsigned-byte 32) (signed-byte 32) fixup))) (def!method print-object ((ea ea) stream) (cond ((or *print-escape* *print-readably*) (print-unreadable-object (ea stream :type t) @@ -1784,6 +1794,18 @@ (emit-byte segment #b11100000) (emit-byte-displacement-backpatch segment target))) +;;;; conditional move +(define-instruction cmov (segment cond dst src) + (:printer cond-move ()) + (:emitter + (aver (register-p dst)) + (let ((size (matching-operand-size dst src))) + (aver (or (eq size :word) (eq size :dword))) + (maybe-emit-operand-size-prefix segment size)) + (emit-byte segment #b00001111) + (emit-byte segment (dpb (conditional-opcode cond) (byte 4 0) #b01000000)) + (emit-ea segment src (reg-tn-encoding dst)))) + ;;;; conditional byte set (define-instruction set (segment dst cond)