";" and "#|") are more forgiving to encoding errors; they will
STYLE-WARN and then attempt to resync the stream at a character
boundary. (thanks to Teemu Kalvas)
+ * fixed some bugs in the x86-64 port:
+ ** Negative short int return values from c-calls are sign-extended
+ correctly.
+ ** The stack is aligned to 16-bytes for c-calls, as required by
+ the ABI. (thanks to Cheuksan Wang)
+ ** The disassembler understands more x86-64. (thanks to Cheuksan Wang)
+ ** The regression tests use SB-ALIEN:INT instead of SB-ALIEN:INTEGER
+ for enums. (thanks to Vincent Arkesteijn)
* fixed some bugs revealed by Paul Dietz' test suite:
** Space, Tab, Linefeed, Return and Page have the invalid
secondary constituent character trait.
(:generator 0
(aver (location= result rsp-tn))
(unless (zerop amount)
- (let ((delta (logandc2 (+ amount 3) 3)))
+ (let ((delta (logandc2 (+ amount 7) 7)))
(inst sub rsp-tn delta)))
+ ;; C stack must be 16 byte aligned
+ (inst and rsp-tn #xfffffff0)
(move result rsp-tn)))
(define-vop (dealloc-number-stack-space)
(:info amount)
(:generator 0
(unless (zerop amount)
- (let ((delta (logandc2 (+ amount 3) 3)))
+ (let ((delta (logandc2 (+ amount 7) 7)))
(inst add rsp-tn delta)))))
(define-vop (alloc-alien-stack-space)
-;;;; that part of the description of the x86 instruction set (for
-;;;; 80386 and above) which can live on the cross-compilation host
+;;;; that part of the description of the x86-64 instruction set
+;;;; which can live on the cross-compilation host
;;;; This software is part of the SBCL system. See the README file for
;;;; more information.
*default-address-size*))
dstate)))
+(sb!disassem:define-arg-type imm-data-upto-dword
+ :prefilter (lambda (value dstate)
+ (declare (ignore value)) ; always nil anyway
+ (let ((width (width-bits
+ (or (sb!disassem:dstate-get-prop dstate 'width)
+ *default-address-size*))))
+ (if (= width 64)
+ (sb!disassem:read-signed-suffix 32 dstate)
+ (sb!disassem:read-suffix width dstate)))))
+
(sb!disassem:define-arg-type signed-imm-data
:prefilter (lambda (value dstate)
(declare (ignore value)) ; always nil anyway
:include 'rex-simple
:default-printer '(:name
:tab accum ", " imm))
- (imm :type 'imm-data))
+ (imm :type 'imm-data-upto-dword))
(sb!disassem:define-instruction-format (reg-no-width 8
:default-printer '(:name :tab reg))
:default-printer
'(:name :tab reg/mem ", " imm))
(reg/mem :type 'sized-rex-reg/mem)
- (imm :type 'imm-data))
+ (imm :type 'imm-data-upto-dword))
;;; Same as reg/mem, but with using the accumulator in the default printer
(sb!disassem:define-instruction-format
(:printer rex-reg-reg/mem-dir ((op #b100010)))
;; immediate to register/memory
(:printer reg/mem-imm ((op '(#b1100011 #b000))))
- (:printer rex-reg/mem-imm ((op '(#b1100011 #b000))))
+ ;; doesn't work for 8-bit register yet
+ (:printer rex-reg/mem-imm ((op '(#b11000111 #b000))))
(:emitter
(let ((size (matching-operand-size dst src)))
(:printer reg-no-width ((op #b10010)) '(:name :tab accum ", " reg))
;; Register/Memory with Register.
(:printer reg-reg/mem ((op #b1000011)))
+ ;; doesn't work for 8-bit register yet
+ (:printer rex-reg-reg/mem ((op #b10000111)))
(:emitter
(let ((size (matching-operand-size operand1 operand2)))
(maybe-emit-operand-size-prefix segment size)
(t
(unless (or (ea-p where) (tn-p where))
(error "don't know what to do with ~A" where))
- (maybe-emit-rex-for-ea segment where nil)
+ ;; near jump defaults to 64 bit
+ ;; w-bit in rex prefix is unnecessary
+ (maybe-emit-rex-for-ea segment where nil :operand-size :dword)
(emit-byte segment #b11111111)
(emit-ea segment where #b100)))))
(define-alien-type enum.2 (enum nil (zero 0) (one 1) (two 2) (three 3)
(four 4) (five 5) (six 6) (seven 7)
(eight 8) (nine 9)))
-(with-alien ((integer-array (array integer 3)))
+(with-alien ((integer-array (array int 3)))
(let ((enum-array (cast integer-array (array enum.2 3))))
(setf (deref enum-array 0) 'three
(deref enum-array 1) 'four)
;; The code that is used for mapping from integers to symbols depends on the
;; `density' of the set of used integers, so test with a sparse set as well.
(define-alien-type enum.3 (enum nil (zero 0) (one 1) (k-one 1001) (k-two 1002)))
-(with-alien ((integer-array (array integer 3)))
+(with-alien ((integer-array (array int 3)))
(let ((enum-array (cast integer-array (array enum.3 3))))
(setf (deref enum-array 0) 'one
(deref enum-array 1) 'k-one)