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.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
f993ea43 by Raymond Toy at 2021-01-06T17:11:03-08:00
Fix #93: Use our fork of ansi-test
Instead of using the upstream ansi-test for CI, use our own fork.
- - - - -
fdeafbc6 by Raymond Toy at 2021-01-07T05:36:53+00:00
Merge branch 'issue-93-update-ansi-test-location' into 'master'
Fix #93: Use our fork of ansi-test
Closes #93
See merge request cmucl/cmucl!62
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -57,7 +57,7 @@ linux:test:
- job: linux:build
artifacts: true
before_script:
- - git clone https://gitlab.common-lisp.net/ansi-test/ansi-test.git
+ - git clone https://gitlab.common-lisp.net/cmucl/ansi-test.git
- (cd ansi-test; git checkout rtoy-cmucl-expected-failures)
script:
- bin/run-tests.sh -l dist/bin/lisp 2>&1 | tee test.log
@@ -128,7 +128,7 @@ osx:test:
- job: osx:build
artifacts: true
before_script:
- - git clone https://gitlab.common-lisp.net/ansi-test/ansi-test.git
+ - git clone https://gitlab.common-lisp.net/cmucl/ansi-test.git
- (cd ansi-test; git checkout rtoy-cmucl-expected-failures)
script:
- bin/run-tests.sh -l dist/bin/lisp 2>&1 | tee test.log
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/18a3be34f2a3cadebc9949…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/18a3be34f2a3cadebc9949…
You're receiving this email because of your account on gitlab.common-lisp.net.