[Git][cmucl/cmucl][issue-97-define-ud2-inst] Define separate int and int3 instructions.

Raymond Toy (@rtoy) gitlab at common-lisp.net
Fri May 21 04:18:57 UTC 2021



Raymond Toy pushed to branch issue-97-define-ud2-inst at cmucl / cmucl


Commits:
9c5cdf07 by Raymond Toy at 2021-05-20T21:18:44-07:00
Define separate int and int3 instructions.

Note that `(inst int 3)` is two bytes long and is not converted to an
int3 instruction that is one byte long.

Tested by looking at the output of
`disassem::print-backend-inst-space` and also by inserting a
function-start breakpoint in `#'kernel:%sqrt` and disassembling the
function.  We see the `int3` instruction, and it is exactly one byte
long.

- - - - -


1 changed file:

- src/compiler/x86/insts.lisp


Changes:

=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -2161,15 +2161,14 @@
 (define-instruction int (segment number)
   (:declare (type (unsigned-byte 8) number))
   (:printer byte-imm ((op #b11001101)))
-  (:printer byte ((op #b11001100))
-	    `(:name 3))
-  (:emitter
-   (etypecase number
-     ((member 3)
-      (emit-byte segment #b11001100))
-     ((unsigned-byte 8)
-      (emit-byte segment #b11001101)
-      (emit-byte segment number)))))
+  (:emitter
+   (emit-byte segment #b11001101)
+   (emit-byte segment number)))
+
+(define-instruction int3 (segment)
+  (:printer byte ((op #b11001100)))
+  (:emitter
+   (emit-byte segment #b11001100)))
 
 (define-instruction into (segment)
   (:printer byte ((op #b11001110)))



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/9c5cdf0700fabcd09a09258aaf890fce98ca3dc5

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/9c5cdf0700fabcd09a09258aaf890fce98ca3dc5
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/20210521/c8c4ae68/attachment.html>


More information about the cmucl-cvs mailing list