Changeset 15922


Ignore:
Timestamp:
Oct 1, 2013, 9:04:33 AM (8 years ago)
Author:
gb
Message:

Handle 1-digit bignums in REQUIRE-U64. Fixes ticket:1115 in the trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8632/x8632-vinsns.lisp

    r15884 r15922  
    27562756  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-64))))
    27572757
     2758;;; Something is an (UNSIGNED-BYTE 64) iff:
     2759;;; a) it's a non-negative FIXNUM
     2760;;; b) it's a 1- or 2-digit BIGNUM and the sign bit is clear
     2761;;; c) it's a 3-digit BIGNUM and the high word is 0
    27582762(define-x8632-vinsn require-u64 (()
    27592763                                 ((object :lisp))
    27602764                                 ((tag :s32)))
    27612765  :again
    2762   (testl (:$l x8632::fixnummask) (:%l object))
     2766  (testl (:$l (logior (ash 1 31) x8632::fixnummask)) (:%l object))
    27632767  (movl (:%l object) (:%l tag))
    2764   (je :ok-if-non-negative)
     2768  (je :ok)
    27652769  (andl (:$l x8632::fulltagmask) (:%l tag))
    27662770  (cmpl (:$l x8632::fulltag-misc) (:%l tag))
    27672771  (jne :bad)
    2768   (cmpl (:$l x8632::two-digit-bignum-header) (:@ x8632::misc-header-offset (:%l object)))
    2769   (je :two)
    27702772  (cmpl (:$l x8632::three-digit-bignum-header) (:@ x8632::misc-header-offset (:%l object)))
    2771   (jne :bad)
     2773  (jne :notthree)
    27722774  (cmpl (:$b 0) (:@ (+ x8632::misc-data-offset 8) (:%l object)))
    27732775  (je :ok)
     
    27752777  (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-unsigned-byte-64))
    27762778  (jmp :again)
    2777   :two
    2778   (movl (:@ x8632::misc-data-offset (:%l object)) (:%l tag))
    2779   :ok-if-non-negative
    2780   (testl (:%l tag) (:%l tag))
     2779  :notthree
     2780  (xorl (:%l tag) (:%l tag))
     2781  (cmpl (:$l x8632::one-digit-bignum-header) (:@ x8632::misc-header-offset (:%l object)))
     2782  (je :testsign)
     2783  (addl (:$b x8632::fixnumone) (:%l tag))
     2784  (cmpl (:$l x8632::two-digit-bignum-header) (:@ x8632::misc-header-offset (:%l object)))
     2785  (jne :bad)
     2786  :testsign
     2787  (cmpl (:$b 0) (:@ x8632::misc-data-offset (:%l object) (:%l tag)))
    27812788  (js :bad)
    27822789  :ok)
Note: See TracChangeset for help on using the changeset viewer.