Raymond Toy pushed to branch issue-192-disassemble-prints-radix-marker at cmucl / cmucl
Commits:
c662da73 by Raymond Toy at 2023-04-28T07:20:34-07:00
Add *disassemble-print-radix* as the default for :radix
Export this symbol too to make it clear that this is the API and
we're allowing users to modify this.
Update `disassemble` docstring to mention `disassem:disasemble`.
- - - - -
4 changed files:
- src/code/exports.lisp
- src/code/misc.lisp
- src/compiler/disassem.lisp
- src/i18n/locale/cmucl.pot
Changes:
=====================================
src/code/exports.lisp
=====================================
@@ -1368,7 +1368,9 @@
(:export "*NOTE-COLUMN*" "*OPCODE-COLUMN-WIDTH*" "ADD-COMMENT-HOOK"
"ADD-HOOK" "ADD-NOTE-HOOK" "ARG-VALUE" "CREATE-DSTATE"
"DISASSEM-STATE" "DISASSEMBLE" "DISASSEMBLE-CODE-COMPONENT"
- "DISASSEMBLE-FUNCTION" "DISASSEMBLE-MEMORY" "DISASSEMBLE-SEGMENT"
+ "DISASSEMBLE-FUNCTION" "DISASSEMBLE-MEMORY"
+ "*DISASSEMBLE-PRINT-RADIX*"
+ "DISASSEMBLE-SEGMENT"
"DISASSEMBLE-SEGMENTS" "DSTATE-CODE" "DSTATE-CURPOS"
"DSTATE-GET-PROP" "DSTATE-NEXTPOS" "DSTATE-SEGMENT-LENGTH"
"DSTATE-SEGMENT-SAP" "DSTATE-SEGMENT-START" "FIELD-TYPE"
=====================================
src/code/misc.lisp
=====================================
@@ -181,5 +181,7 @@
"Disassemble the machine code associated with OBJECT, which can be a
function, a lambda expression, or a symbol with a function definition. If
it is not already compiled, the compiler is called to produce something to
- disassemble."
+ disassemble.
+
+ Also see disassem:disassemble for finer control of disassembly."
(disassem:disassemble object))
=====================================
src/compiler/disassem.lisp
=====================================
@@ -3318,12 +3318,16 @@
:format-control (intl:gettext "Can't make a compiled function from ~S")
:format-arguments (list name)))))
+(defvar *disassemble-print-radix*
+ t
+ "Default value for :radix argument for disassem:disassemble")
+
(defun disassemble (object &key (stream *standard-output*)
(use-labels t)
(backend c:*native-backend*)
(base 16)
(case :downcase)
- (radix t))
+ (radix *disassemble-print-radix*))
"Disassemble the machine code associated with OBJECT, which can be a
function, a lambda expression, or a symbol with a function definition. If
it is not already compiled, the compiler is called to produce something to
@@ -3338,7 +3342,7 @@
:Radix
The disassembler uses the specified base, case, and radix when
printing the disassembled code. The default values are 16,
- :downcase, and T, respectively."
+ :downcase, and *disassemble-print-radix*, respectively."
(declare (type (or function symbol cons) object)
(type (or (member t) stream) stream)
(type (member t nil) use-labels)
=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -5694,7 +5694,9 @@ msgid ""
"If\n"
" it is not already compiled, the compiler is called to produce something "
"to\n"
-" disassemble."
+" disassemble.\n"
+"\n"
+" Also see disassem:disassemble for finer control of disassembly."
msgstr ""
#: src/code/misc-doc.lisp
@@ -17387,6 +17389,10 @@ msgstr ""
msgid "Can't make a compiled function from ~S"
msgstr ""
+#: src/compiler/disassem.lisp
+msgid "Default value for :radix argument for disassem:disassemble"
+msgstr ""
+
#: src/compiler/disassem.lisp
msgid ""
"Disassemble the machine code associated with OBJECT, which can be a\n"
@@ -17405,7 +17411,7 @@ msgid ""
" :Radix\n"
" The disassembler uses the specified base, case, and radix when\n"
" printing the disassembled code. The default values are 16,\n"
-" :downcase, and T, respectively."
+" :downcase, and *disassemble-print-radix*, respectively."
msgstr ""
#: src/compiler/disassem.lisp
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/c662da73c4ea1e29e947b92…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/c662da73c4ea1e29e947b92…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-185-x86-shorter-insts at cmucl / cmucl
Commits:
db1e9b11 by Carl S. Shapiro at 2023-04-26T22:59:49+00:00
Simplify test using `sign-extend`.
- - - - -
1 changed file:
- src/compiler/x86/insts.lisp
Changes:
=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -1274,12 +1274,7 @@
#b00000100
#b00000101)))
(emit-sized-immediate segment size src))
- ((and (not (eq size :byte))
- (or (<= -128 src 127)
- ;; Check that the top 25 bits are all ones so
- ;; that sign-extending an 8-bit value produces
- ;; the desired 32-bit value.
- (= (ldb (byte 25 7) src) #x1ffffff)))
+ ((and (not (eq size :byte)) (<= -128 (sign-extend src 32) 127))
(emit-byte segment #b10000011)
(emit-ea segment dst opcode allow-constants)
(emit-byte segment (ldb (byte 8 0) src)))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/db1e9b11dc19a5c3cedea51…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/db1e9b11dc19a5c3cedea51…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
c2a99381 by Raymond Toy at 2023-04-26T21:38:42+00:00
Fix #131: Move unix-uname to contrib/unix
- - - - -
acb29d8f by Raymond Toy at 2023-04-26T21:38:42+00:00
Merge branch 'issue-131-move-unix-uname' into 'master'
Fix #131: Move unix-uname to contrib/unix
Closes #131
See merge request cmucl/cmucl!142
- - - - -
5 changed files:
- src/code/exports.lisp
- src/code/unix.lisp
- src/contrib/unix/unix-glibc2.lisp
- src/contrib/unix/unix.lisp
- src/i18n/locale/cmucl-unix.pot
Changes:
=====================================
src/code/exports.lisp
=====================================
@@ -249,9 +249,6 @@
"OPEN-DIR"
"READ-DIR"
- ;; linux-os, sunos-os.
- "UNIX-UNAME"
-
;; filesys.lisp
"UNIX-GETPWUID"
@@ -411,7 +408,7 @@
"TIOCSETP"
"TTY-IUCLC"
"TTY-OCRNL" "TTY-OFDEL" "TTY-OFILL" "TTY-OLCUC" "TTY-ONLRET" "TTY-ONOCR"
- "TTY-XCASE" "UNIX-DUP2" "UNIX-GETITIMER" "UNIX-PID" "UNIX-UNAME"
+ "TTY-XCASE" "UNIX-DUP2" "UNIX-GETITIMER" "UNIX-PID"
"UTSNAME"
)
#+solaris
=====================================
src/code/unix.lisp
=====================================
@@ -2724,27 +2724,6 @@
(machine (array char 65))
(domainname (array char 65))))
-(defun unix-uname ()
- _N"Unix-uname returns information from the uname(2) system call.
- The return values are
-
- Name of the operating system
- Name of this node within some implementation-defined network, if any
- Release level of this operating system
- Version level of this operating system release
- Name of the hardware type on which the system is running"
- (with-alien ((names (struct utsname)))
- (syscall* (#-(or freebsd (and x86 solaris)) "uname"
- #+(and x86 solaris) "nuname" ; See /usr/include/sys/utsname.h
- #+freebsd "__xuname" #+freebsd int
- (* (struct utsname)))
- (values (cast (slot names 'sysname) c-string)
- (cast (slot names 'nodename) c-string)
- (cast (slot names 'release) c-string)
- (cast (slot names 'version) c-string)
- (cast (slot names 'machine) c-string))
- #+freebsd 256
- (addr names))))
;;; For asdf. Well, only getenv, but might as well make it symmetric.
=====================================
src/contrib/unix/unix-glibc2.lisp
=====================================
@@ -1908,5 +1908,26 @@ in at a time in poll.")
:until (zerop (sap-int (alien-sap member)))
:collect (string (cast member c-call:c-string))))))))
+(defun unix-uname ()
+ _N"Unix-uname returns information from the uname(2) system call.
+ The return values are
+
+ Name of the operating system
+ Name of this node within some implementation-defined network, if any
+ Release level of this operating system
+ Version level of this operating system release
+ Name of the hardware type on which the system is running"
+ (with-alien ((names (struct utsname)))
+ (syscall* (#-(or freebsd (and x86 solaris)) "uname"
+ #+(and x86 solaris) "nuname" ; See /usr/include/sys/utsname.h
+ #+freebsd "__xuname" #+freebsd int
+ (* (struct utsname)))
+ (values (cast (slot names 'sysname) c-string)
+ (cast (slot names 'nodename) c-string)
+ (cast (slot names 'release) c-string)
+ (cast (slot names 'version) c-string)
+ (cast (slot names 'machine) c-string))
+ #+freebsd 256
+ (addr names))))
;; EOF
=====================================
src/contrib/unix/unix.lisp
=====================================
@@ -929,4 +929,25 @@
_N"Unix-getpagesize returns the number of bytes in a system page."
(int-syscall ("getpagesize")))
+(defun unix-uname ()
+ _N"Unix-uname returns information from the uname(2) system call.
+ The return values are
+
+ Name of the operating system
+ Name of this node within some implementation-defined network, if any
+ Release level of this operating system
+ Version level of this operating system release
+ Name of the hardware type on which the system is running"
+ (with-alien ((names (struct utsname)))
+ (syscall* (#-(or freebsd (and x86 solaris)) "uname"
+ #+(and x86 solaris) "nuname" ; See /usr/include/sys/utsname.h
+ #+freebsd "__xuname" #+freebsd int
+ (* (struct utsname)))
+ (values (cast (slot names 'sysname) c-string)
+ (cast (slot names 'nodename) c-string)
+ (cast (slot names 'release) c-string)
+ (cast (slot names 'version) c-string)
+ (cast (slot names 'machine) c-string))
+ #+freebsd 256
+ (addr names))))
;; EOF
=====================================
src/i18n/locale/cmucl-unix.pot
=====================================
@@ -1370,18 +1370,6 @@ msgid ""
" and its children."
msgstr ""
-#: src/code/unix.lisp
-msgid ""
-"Unix-uname returns information from the uname(2) system call.\n"
-" The return values are\n"
-"\n"
-" Name of the operating system\n"
-" Name of this node within some implementation-defined network, if any\n"
-" Release level of this operating system\n"
-" Version level of this operating system release\n"
-" Name of the hardware type on which the system is running"
-msgstr ""
-
#: src/code/unix.lisp
msgid ""
"Get the value of the environment variable named Name. If no such\n"
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/90a5e5690f8baa91a3484f…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/90a5e5690f8baa91a3484f…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-185-x86-shorter-insts at cmucl / cmucl
Commits:
54ba7245 by Carl S. Shapiro at 2023-04-25T23:53:54+00:00
Simplify testing for signed-imm-byte data using sign-extend function.,
- - - - -
1 changed file:
- src/compiler/x86/insts.lisp
Changes:
=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -1304,19 +1304,12 @@
(defun arith-logical-constant-control (chunk inst stream dstate)
(declare (ignore inst stream))
- (let ((opcode (ldb (byte 8 0) chunk))
- (signed-imm-data (ldb (byte 8 16) chunk)))
- ;; See emit-random-arith-inst for the case where we use an 8-bit
- ;; signed immediate value in the instruction. We print a note
- ;; only if we have a 8-bit immediate and the 8-bit value is
- ;; negative (MSB is 1).
- (when (and (= opcode #b10000011)
- (logbitp 7 signed-imm-data))
- (disassem:note #'(lambda (stream)
- (princ (ldb (byte 32 0)
- (sign-extend signed-imm-data 8))
- stream))
- dstate))))
+ (when (= (ldb (byte 8 0) chunk) #b10000011)
+ (let ((imm (sign-extend (ldb (byte 8 16) chunk) 8)))
+ (when (minusp imm)
+ (disassem:note #'(lambda (stream)
+ (princ (ldb (byte 32 0) imm) stream))
+ dstate)))))
(eval-when (compile eval)
(defun arith-inst-printer-list (subop &key control)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/54ba7245abe655147e6dfe0…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/54ba7245abe655147e6dfe0…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
31825793 by Raymond Toy at 2023-04-25T20:49:36+00:00
Fix #189: Move get-system-info from unix.lisp to os.lisp
- - - - -
90a5e569 by Raymond Toy at 2023-04-25T20:49:36+00:00
Merge branch 'issue-189-move-get-system-info' into 'master'
Fix #189: Move get-system-info from unix.lisp to os.lisp
Closes #189
See merge request cmucl/cmucl!141
- - - - -
5 changed files:
- src/code/os.lisp
- src/code/unix.lisp
- src/i18n/locale/cmucl-linux-os.pot
- + src/i18n/locale/cmucl-os.pot
- src/i18n/locale/cmucl-unix.pot
Changes:
=====================================
src/code/os.lisp
=====================================
@@ -15,7 +15,7 @@
(in-package "SYSTEM")
(use-package "EXTENSIONS")
-(intl:textdomain "cmucl-linux-os")
+(intl:textdomain "cmucl-os")
(export '(get-page-size))
@@ -33,3 +33,27 @@
maybe-page-size))
+;;; GET-SYSTEM-INFO -- Interface
+;;;
+;;; Return system time, user time (in usec) and number of page
+;;; faults.
+;;;
+(defun get-system-info ()
+ _N"Get system information consisting of the user time (in usec), the
+ system time (in usec) and the number of major page faults."
+ (alien:with-alien ((utime unix:int64-t 0)
+ (stime unix:int64-t 0)
+ (major-fault c-call:long 0))
+ (let ((rc (alien:alien-funcall
+ (alien:extern-alien "os_get_system_info"
+ (function c-call:int
+ (* unix:int64-t)
+ (* unix:int64-t)
+ (* c-call:long)))
+ (alien:addr utime)
+ (alien:addr stime)
+ (alien:addr major-fault))))
+ (when (minusp rc)
+ (error (intl:gettext "Unix system call getrusage failed: ~A.")
+ (unix:get-unix-error-msg utime)))
+ (values utime stime major-fault))))
=====================================
src/code/unix.lisp
=====================================
@@ -2921,28 +2921,3 @@
(extern-alien "os_get_locale_codeset"
(function (* char))))
c-string))
-
-;;; GET-SYSTEM-INFO -- Interface
-;;;
-;;; Return system time, user time (in usec) and number of page
-;;; faults.
-;;;
-(defun get-system-info ()
- "Get system information consisting of the user time (in usec), the
- system time (in usec) and the number of major page faults."
- (with-alien ((utime int64-t 0)
- (stime int64-t 0)
- (major-fault c-call:long 0))
- (let ((rc (alien-funcall
- (extern-alien "os_get_system_info"
- (function c-call:int
- (* int64-t)
- (* int64-t)
- (* c-call:long)))
- (addr utime)
- (addr stime)
- (addr major-fault))))
- (when (minusp rc)
- (error (intl:gettext "Unix system call getrusage failed: ~A.")
- (unix:get-unix-error-msg utime)))
- (values utime stime major-fault))))
=====================================
src/i18n/locale/cmucl-linux-os.pot
=====================================
@@ -19,14 +19,6 @@ msgstr ""
msgid "Getpagesize failed: ~A"
msgstr ""
-#: src/code/os.lisp
-msgid "Return the system page size"
-msgstr ""
-
-#: src/code/os.lisp
-msgid "get-page-size failed: ~A"
-msgstr ""
-
#: src/code/signal.lisp
msgid "Stack fault on coprocessor"
msgstr ""
=====================================
src/i18n/locale/cmucl-os.pot
=====================================
@@ -0,0 +1,35 @@
+#@ cmucl-os
+
+# SOME DESCRIPTIVE TITLE
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL(a)li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/code/os.lisp
+msgid "Return the system page size"
+msgstr ""
+
+#: src/code/os.lisp
+msgid "get-page-size failed: ~A"
+msgstr ""
+
+#: src/code/os.lisp
+msgid ""
+"Get system information consisting of the user time (in usec), the\n"
+" system time (in usec) and the number of major page faults."
+msgstr ""
+
+#: src/code/os.lisp
+msgid "Unix system call getrusage failed: ~A."
+msgstr ""
+
=====================================
src/i18n/locale/cmucl-unix.pot
=====================================
@@ -1444,13 +1444,3 @@ msgstr ""
msgid "Get the codeset from the locale"
msgstr ""
-#: src/code/unix.lisp
-msgid ""
-"Get system information consisting of the user time (in usec), the\n"
-" system time (in usec) and the number of major page faults."
-msgstr ""
-
-#: src/code/unix.lisp
-msgid "Unix system call getrusage failed: ~A."
-msgstr ""
-
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/412d65234e9caf87ba2f9b…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/412d65234e9caf87ba2f9b…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-189-move-get-system-info at cmucl / cmucl
Commits:
527160e8 by Raymond Toy at 2023-04-21T07:17:03-07:00
Update pot files
cmucl-linux-os.pot has changed because we moved some functions.
Likewise cmucl-unix.pot has changed too.
Add cmucl-os.pot to hold the new OS strings from os.lisp.
- - - - -
3 changed files:
- src/i18n/locale/cmucl-linux-os.pot
- + src/i18n/locale/cmucl-os.pot
- src/i18n/locale/cmucl-unix.pot
Changes:
=====================================
src/i18n/locale/cmucl-linux-os.pot
=====================================
@@ -19,14 +19,6 @@ msgstr ""
msgid "Getpagesize failed: ~A"
msgstr ""
-#: src/code/os.lisp
-msgid "Return the system page size"
-msgstr ""
-
-#: src/code/os.lisp
-msgid "get-page-size failed: ~A"
-msgstr ""
-
#: src/code/signal.lisp
msgid "Stack fault on coprocessor"
msgstr ""
=====================================
src/i18n/locale/cmucl-os.pot
=====================================
@@ -0,0 +1,35 @@
+#@ cmucl-os
+
+# SOME DESCRIPTIVE TITLE
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL(a)li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/code/os.lisp
+msgid "Return the system page size"
+msgstr ""
+
+#: src/code/os.lisp
+msgid "get-page-size failed: ~A"
+msgstr ""
+
+#: src/code/os.lisp
+msgid ""
+"Get system information consisting of the user time (in usec), the\n"
+" system time (in usec) and the number of major page faults."
+msgstr ""
+
+#: src/code/os.lisp
+msgid "Unix system call getrusage failed: ~A."
+msgstr ""
+
=====================================
src/i18n/locale/cmucl-unix.pot
=====================================
@@ -1444,13 +1444,3 @@ msgstr ""
msgid "Get the codeset from the locale"
msgstr ""
-#: src/code/unix.lisp
-msgid ""
-"Get system information consisting of the user time (in usec), the\n"
-" system time (in usec) and the number of major page faults."
-msgstr ""
-
-#: src/code/unix.lisp
-msgid "Unix system call getrusage failed: ~A."
-msgstr ""
-
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/527160e8cc697f24a5c980c…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/527160e8cc697f24a5c980c…
You're receiving this email because of your account on gitlab.common-lisp.net.