Comment 2 for bug 1066204

Revision history for this message
Paul Khuong (pvk) wrote :

with (optimize speed (safety 0)):

* (disassemble '(lambda (x y) (ash (the fixnum x) (the (integer -60 0) y))))
; in: LAMBDA (X Y)
; (ASH (THE FIXNUM X) (THE (INTEGER -60 0) Y))
; ==>
; (SB-KERNEL:%ASH/RIGHT INTEGER
; (IF (<= SB-C::AMOUNT -64)
; 63
; (- SB-C::AMOUNT)))
;
; note: unable to
; optimize
; due to type uncertainty:
; The result is a (VALUES FIXNUM &OPTIONAL), not a (VALUES (INTEGER -1 0) &REST
; T).
;
; compilation unit finished
; printed 1 note

; disassembly for (LAMBDA (X Y))
; Size: 19 bytes
; 0687ADA2: 48F7D9 NEG RCX ; no-arg-parsing entry point
; A5: 48D1F9 SAR RCX, 1
; A8: 48D3FA SAR RDX, CL
; AB: 4883E2FE AND RDX, -2
; AF: 488BE5 MOV RSP, RBP
; B2: F8 CLC
; B3: 5D POP RBP
; B4: C3 RET
NIL

* (disassemble '(lambda (x y) (ash (the fixnum x) (- (the (integer 0 60) y)))))
; in: LAMBDA (X Y)
; (ASH (THE FIXNUM X) (- (THE (INTEGER 0 60) Y)))
; ==>
; (SB-KERNEL:%ASH/RIGHT INTEGER
; (IF (>= SB-C::AMOUNT 64)
; 63
; SB-C::AMOUNT))
;
; note: unable to
; optimize
; due to type uncertainty:
; The result is a (VALUES FIXNUM &OPTIONAL), not a (VALUES (INTEGER -1 0) &REST
; T).
;
; compilation unit finished
; printed 1 note

; disassembly for (LAMBDA (X Y))
; Size: 16 bytes
; 06A54672: 48D1F9 SAR RCX, 1 ; no-arg-parsing entry point
; 75: 48D3FA SAR RDX, CL
; 78: 4883E2FE AND RDX, -2
; 7C: 488BE5 MOV RSP, RBP
; 7F: F8 CLC
; 80: 5D POP RBP
; 81: C3 RET