X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fx86%2Finsts.lisp;h=ce271e60722d2c36f79222076be11efb1e307108;hb=42ab0c5b87f834c69842713c60587a76f953411f;hp=05d9b338fc6a50fcd357b3352eb35322e01154b1;hpb=48ff891135e403e49037940bbad18d262e23df5e;p=sbcl.git diff --git a/src/compiler/x86/insts.lisp b/src/compiler/x86/insts.lisp index 05d9b33..ce271e6 100644 --- a/src/compiler/x86/insts.lisp +++ b/src/compiler/x86/insts.lisp @@ -896,6 +896,23 @@ (emit-word segment value)) (:dword (emit-dword segment value)))) + +(defun toggle-word-width (chunk inst stream dstate) + (declare (ignore chunk inst stream)) + (let ((word-width (or (sb!disassem:dstate-get-prop dstate 'word-width) + +default-operand-size+))) + (setf (sb!disassem:dstate-get-prop dstate 'word-width) + (ecase word-width + (:word :dword) + (:dword :word))))) + +;;; This is a "prefix" instruction, which means that it modifies the +;;; following instruction in some way without having an actual +;;; mnemonic of its own. +(define-instruction operand-size-prefix (segment) + (:printer byte ((op +operand-size-prefix-byte+)) + nil ; don't actually print it + :control #'toggle-word-width)) ;;;; general data transfer @@ -1089,9 +1106,15 @@ (define-instruction fs-segment-prefix (segment) + (:printer byte ((op #b01100100))) (:emitter (emit-byte segment #x64))) +(define-instruction gs-segment-prefix (segment) + (:printer byte ((op #b01100101))) + (:emitter + (emit-byte segment #x65))) + ;;;; flag control instructions ;;; CLC -- Clear Carry Flag.