Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
ef9fc1bc by Raymond Toy at 2021-01-15T13:59:13-08:00
Minor tweak to put use the right EI_OSABI value
Previously, the EI_OSABI value was either ELFOSAB_SOLARIS for solaris
or ELFOSABI_FREEBSD for everything else. Let's update this to include
NetBSD and Linux. Unlikely we'll ever support other things like
HP-UX, AIX, IRIX, Tru64, etc.
The value currently doesn't seem matter, but it seems nice to get it
right.
- - - - -
1 changed file:
- src/lisp/elf.c
Changes:
=====================================
src/lisp/elf.c
=====================================
@@ -132,8 +132,15 @@ write_elf_header(int fd)
eh.e_ident[EI_VERSION] = EV_CURRENT;
#ifdef SOLARIS
eh.e_ident[EI_OSABI] = ELFOSABI_SOLARIS;
-#else
+#elif defined(__FREEBSD__)
eh.e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+#elif defined(__NetBSD__)
+ eh.e_ident[EI_OSABI] = ELFOSABI_NETBSD;
+#elif defined(__linux__)
+ eh.e_ident[EI_OSABI] = ELFOSABI_LINUX;
+#else
+ /* Default to NONE */
+ eh.e_ident[EI_OSABI] = ELFOSABI_NONE;
#endif
#ifdef SOLARIS
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/ef9fc1bced6dbad3b63213d…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/ef9fc1bced6dbad3b63213d…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
22e573f3 by Raymond Toy at 2021-01-12T16:44:14-08:00
Address #89: Remove C code to scavenge read-only space
Since we got rid of the symbol `*scavenge-read-only-space*`, we can
never scavenge the read-only space, so remove the C code that
scavenges the space.
Get rid of the unused var `read_only_space_size` too.
- - - - -
3593ca90 by Raymond Toy at 2021-01-13T01:05:13+00:00
Merge branch 'issue-89-unused-var' into 'master'
Address #89: Remove C code to scavenge read-only space
See merge request cmucl/cmucl!66
- - - - -
1 changed file:
- src/lisp/gencgc.c
Changes:
=====================================
src/lisp/gencgc.c
=====================================
@@ -7722,7 +7722,7 @@ static void
garbage_collect_generation(int generation, int raise)
{
unsigned long i;
- unsigned long read_only_space_size, static_space_size;
+ unsigned long static_space_size;
#if defined(i386) || defined(__x86_64)
invalid_stack_start = (void *) control_stack;
@@ -7865,17 +7865,6 @@ garbage_collect_generation(int generation, int raise)
printf("Done scavenging the scavenger hooks.\n");
#endif
-#if 0
- if (SymbolValue(SCAVENGE_READ_ONLY_SPACE) != NIL) {
- read_only_space_size =
- (lispobj *) SymbolValue(READ_ONLY_SPACE_FREE_POINTER) -
- read_only_space;
- fprintf(stderr, "Scavenge read only space: %ld bytes\n",
- read_only_space_size * sizeof(lispobj));
- scavenge(read_only_space, read_only_space_size);
- }
-#endif
-
static_space_size = (lispobj *) SymbolValue(STATIC_SPACE_FREE_POINTER)
- static_space;
if (gencgc_verbose > 1)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/9c0c857dd10067e1cf90ec…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/9c0c857dd10067e1cf90ec…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
755f7a80 by Raymond Toy at 2021-01-11T20:05:32-08:00
Fix #98: Use FSTP instruction with appropriate size
Instead of printing `FSTP` and `FSTPD`, print `FSTP DWORD PTR` and
`FSTP QWORD PTR` to store a single-float and double-float value to
memory.
Clang likes this form better than the original, but gcc accepts both.
- - - - -
9c0c857d by Raymond Toy at 2021-01-12T04:27:13+00:00
Merge branch 'issue-98-fstpd-formatting' into 'master'
Fix #98: Use FSTP instruction with appropriate size
Closes #98
See merge request cmucl/cmucl!65
- - - - -
1 changed file:
- src/compiler/x86/insts.lisp
Changes:
=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -2636,7 +2636,8 @@
;;; store single from st(0) and pop
;;;
(define-instruction fstp (segment dest)
- (:printer floating-point ((op '(#b001 #b011))))
+ (:printer floating-point ((op '(#b001 #b011)))
+ '('fstp :tab 'dword " " 'ptr " " reg/mem))
(:emitter
(cond ((fp-reg-tn-p dest)
(emit-byte segment #b11011101)
@@ -2648,7 +2649,8 @@
;;; store double from st(0) and pop
;;;
(define-instruction fstpd (segment dest)
- (:printer floating-point ((op '(#b101 #b011))))
+ (:printer floating-point ((op '(#b101 #b011)))
+ '('fstp :tab 'qword " " 'ptr " " reg/mem))
(:printer floating-point-fp ((op '(#b101 #b011))))
(:emitter
(cond ((fp-reg-tn-p dest)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5e87a39ad45b1dde4d565a…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5e87a39ad45b1dde4d565a…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
b5bfb153 by Raymond Toy at 2021-01-11T05:37:39+00:00
Fix #95: Fix disassembly for je and movzx/movsx instructions
We were printing `jeq` for the branch on equal instruction, but it
should be `je`. This is fixed by changing the order of the options in
the `defconstant` `conditions`. The first in the list is the
preferred value, so we can write `je`, `jeq`, or `jz`, but these will
all get printed out as `je` instead of the previous `jeq`.
For `movzx` and `movsx`, we need to specify the size of the memory object
to match Intel syntax. This is done by changing the size of the
`ext-reg-reg/mem` format so that the reg/mem field has type
`sized-reg/mem` instead of just `reg/mem`.
Finally, we just added a note that the `break` instruction is really
the `int3` instruction. I don't know why it's called `break` instead
of `int3`.
- - - - -
5e87a39a by Raymond Toy at 2021-01-11T05:37:39+00:00
Merge branch 'issue-95-fix-disassem-syntax' into 'master'
Fix #95: Fix disassembly for je and movzx/movsx instructions
Closes #95
See merge request cmucl/cmucl!64
- - - - -
2 changed files:
- src/bootfiles/21d/boot-2020-04-1.lisp
- src/compiler/x86/insts.lisp
Changes:
=====================================
src/bootfiles/21d/boot-2020-04-1.lisp
=====================================
@@ -10,3 +10,8 @@
;; x86: cross-x86-x86
;; sparc: cross-sparc-sparc
+;; This is also used to easily change the order of x86::conditions
+;; constant so that we prefer je instead of jeq. Without a
+;; cross-compile we'd need to handle the refefintion of the
+;; defconstant in a different way. See issue #95.
+
=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -255,12 +255,15 @@
(= (tn-offset thing) 0)))
(eval-when (compile load eval)
+;; If a line has more than one value, then these are all synonyms, but
+;; the first one is the one that is preferred when printing the
+;; condition code out.
(defconstant conditions
'((:o . 0)
(:no . 1)
(:b . 2) (:nae . 2) (:c . 2)
(:nb . 3) (:ae . 3) (:nc . 3)
- (:eq . 4) (:e . 4) (:z . 4)
+ (:e . 4) (:eq . 4) (:z . 4)
(:ne . 5) (:nz . 5)
(:be . 6) (:na . 6)
(:nbe . 7) (:a . 7)
@@ -794,7 +797,7 @@
(op :field (byte 7 1))
(width :field (byte 1 0) :type 'width)
(reg/mem :fields (list (byte 2 14) (byte 3 8))
- :type 'reg/mem)
+ :type 'sized-reg/mem)
(reg :field (byte 3 11) :type 'reg)
;; optional fields
(imm))
@@ -832,7 +835,10 @@
(disassem:define-instruction-format
(accum-reg/mem 16
:include 'reg/mem :default-printer '(:name :tab accum ", " reg/mem))
- (reg/mem :type 'reg/mem) ; don't need a size
+ ;; This format uses the accumulator, so the size is known; therefore
+ ;; we don't really need to print out the memory size, but let's do
+ ;; it for consistency.
+ (reg/mem :type 'sized-reg/mem)
(accum :type 'accum))
;;; Same as reg-reg/mem, but with a prefix of #b00001111
@@ -843,7 +849,7 @@
(op :field (byte 7 9))
(width :field (byte 1 8) :type 'width)
(reg/mem :fields (list (byte 2 22) (byte 3 16))
- :type 'reg/mem)
+ :type 'sized-reg/mem)
(reg :field (byte 3 19) :type 'reg)
;; optional fields
(imm))
@@ -865,7 +871,7 @@
(prefix :field (byte 8 0) :value #b00001111)
(op :field (byte 8 8))
(reg/mem :fields (list (byte 2 22) (byte 3 16))
- :type 'reg/mem)
+ :type 'sized-reg/mem)
(reg :field (byte 3 19) :type 'reg)
;; optional fields
(imm))
@@ -1129,7 +1135,8 @@
(error "Bogus args to XCHG: ~S ~S" operand1 operand2)))))))
(define-instruction lea (segment dst src)
- (:printer reg-reg/mem ((op #b1000110) (width 1)))
+ ;; Don't need to print out the width for the LEA instruction
+ (:printer reg-reg/mem ((op #b1000110) (width 1) (reg/mem nil :type 'reg/mem)))
(:emitter
(assert (dword-reg-p dst))
(emit-byte segment #b10001101)
@@ -2112,6 +2119,7 @@
(nt "Function end breakpoint trap"))
)))
+;; This is really the int3 instruction.
(define-instruction break (segment code)
(:declare (type (unsigned-byte 8) code))
(:printer byte-imm ((op #b11001100)) '(:name :tab code)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5b5082c6cbe682d5805630…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5b5082c6cbe682d5805630…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-95-fix-disassem-syntax at cmucl / cmucl
Commits:
a99465d8 by Raymond Toy at 2021-01-10T11:06:53-08:00
Make more mem access print out the size
But we don't want to do that for the LEA instruction. gcc doesn't
require it and objdump doesn't print out a size.
- - - - -
1 changed file:
- src/compiler/x86/insts.lisp
Changes:
=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -797,7 +797,7 @@
(op :field (byte 7 1))
(width :field (byte 1 0) :type 'width)
(reg/mem :fields (list (byte 2 14) (byte 3 8))
- :type 'reg/mem)
+ :type 'sized-reg/mem)
(reg :field (byte 3 11) :type 'reg)
;; optional fields
(imm))
@@ -835,7 +835,10 @@
(disassem:define-instruction-format
(accum-reg/mem 16
:include 'reg/mem :default-printer '(:name :tab accum ", " reg/mem))
- (reg/mem :type 'reg/mem) ; don't need a size
+ ;; This format uses the accumulator, so the size is known; therefore
+ ;; we don't really need to print out the memory size, but let's do
+ ;; it for consistency.
+ (reg/mem :type 'sized-reg/mem)
(accum :type 'accum))
;;; Same as reg-reg/mem, but with a prefix of #b00001111
@@ -1132,7 +1135,8 @@
(error "Bogus args to XCHG: ~S ~S" operand1 operand2)))))))
(define-instruction lea (segment dst src)
- (:printer reg-reg/mem ((op #b1000110) (width 1)))
+ ;; Don't need to print out the width for the LEA instruction
+ (:printer reg-reg/mem ((op #b1000110) (width 1) (reg/mem nil :type 'reg/mem)))
(:emitter
(assert (dword-reg-p dst))
(emit-byte segment #b10001101)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a99465d8e3c6cb2f245b278…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a99465d8e3c6cb2f245b278…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
1144015f by Raymond Toy at 2021-01-10T04:33:03+00:00
Fix #91: Handle loop destructuring
The destructuring shortcut in loop doesn't require all the parts be
available. If they're not, each item is replaced by NIL.
This is fixed by still using `destructuring-bind`, except we mark
everything as optional.
- - - - -
5b5082c6 by Raymond Toy at 2021-01-10T04:33:04+00:00
Merge branch 'issue-91-loop-destructuring-bind' into 'master'
Fix #91: loop destructuring bind
Closes #91
See merge request cmucl/cmucl!63
- - - - -
1 changed file:
- src/code/loop.lisp
Changes:
=====================================
src/code/loop.lisp
=====================================
@@ -995,7 +995,10 @@ collected result will be returned as the value of the LOOP."
(if crocks
(let ((*ignores* ()))
(declare (special *ignores*))
- `((destructuring-bind ,(subst-gensyms-for-nil (car crocks))
+ ;; Destructuring in loop doesn't require that the values be
+ ;; available. The missing elements are filled with NIL. So,
+ ;; make everything &optional
+ `((destructuring-bind (&optional ,@(subst-gensyms-for-nil (car crocks)))
,(cadr crocks)
(declare (ignore ,@*ignores*))
,@(loop-build-destructuring-bindings (cddr crocks) forms))))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/fdeafbc630fd3599062a68…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/fdeafbc630fd3599062a68…
You're receiving this email because of your account on gitlab.common-lisp.net.