Changeset 15301


Ignore:
Timestamp:
Apr 7, 2012, 10:50:41 PM (8 years ago)
Author:
gb
Message:

EQL calls .SPbuiltin-eql on x86.

Location:
trunk/source/level-0/X86
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/X86/X8632/x8632-pred.lisp

    r13067 r15301  
    2222numbers with the same type and value."
    2323  (check-nargs 2)
    24   @top
    25   @tail
    26   (cmpl (% x) (% y))
    27   (je @win)
    28   (movl (% x) (% imm0))
    29   (andb ($ x8632::fulltagmask) (% al))
    30   (movb (% arg_z.b) (% ah))
    31   (andb ($ x8632::fulltagmask) (% ah))
    32   (cmpb (% al) (% ah))
    33   (jnz @lose)
    34   (cmpb ($ x8632::fulltag-misc) (% al))
    35   (jnz @lose)
    36   (cmpb ($ x8632::fulltag-misc) (% ah))
    37   (jnz @lose)
    38   ;; Objects are both of tag-misc.  Headers must match exactly;
    39   ;; dispatch on subtag.
    40   (getvheader x imm0)
    41   ;;(getvheader y imm1)
    42   (cmpb ($ x8632::subtag-macptr) (% imm0.b))
    43   (je @macptr)                          ; will need to check subtag of %y
    44   (cmp (% imm0) (@ x8632::misc-header-offset (% y)))
    45   (jne @lose)
    46   (cmpb ($ x8632::subtag-bignum) (% imm0.b))
    47   (je @bignum)
    48   (cmpb ($ x8632::subtag-single-float) (% imm0.b))
    49   (je @one-unboxed-word)
    50   (cmpb ($ x8632::subtag-double-float) (% imm0.b))
    51   (je @double-float)
    52   (cmpb ($ x8632::subtag-complex) (% imm0.b))
    53   (je @complex)
    54   (cmpb ($ x8632::subtag-ratio) (% imm0.b))
    55   (je @ratio)
    56   @lose
    57   (movl ($ (target-nil-value)) (% arg_z))
    58   (single-value-return)
    59   @double-float
    60   ;; use UCOMISD here, maybe?
    61   (movl (@ x8632::double-float.val-high (% x)) (% imm0))
    62   (cmpl (% imm0) (@ x8632::double-float.val-high (% y)))
    63   (jne @lose)
    64   (movl (@ x8632::double-float.value (% x)) (% imm0))
    65   (cmpl (% imm0) (@ x8632::double-float.value (% y)))
    66   (jne @lose)
    67   (movl ($ (target-t-value)) (% arg_z))
    68   (single-value-return)
    69   @macptr
    70   (cmpb ($ x8632::subtag-macptr) (@ x8632::misc-subtag-offset (% y)))
    71   (jne @lose)
    72   @one-unboxed-word
    73   (movl (@ x8632::misc-data-offset (% x)) (% imm0))
    74   @test
    75   (cmpl (% imm0) (@ x8632::misc-data-offset (% y)))
    76   (movl ($ (target-t-value)) (%l imm0))
    77   (lea (@ (- x8632::t-offset) (% imm0)) (% arg_z))
    78   (cmovel (%l imm0) (%l arg_z))
    79   (single-value-return)
    80   @win
    81   (movl ($ (target-t-value)) (% arg_z))
    82   (single-value-return)
    83   @ratio
    84   @complex
    85   ;; Have either a ratio or a complex.  In either case, corresponding
    86   ;; elements of both objects must be EQL.  Recurse on the first
    87   ;; elements.  If true, tail-call on the second, else fail.
    88   (save-simple-frame)
    89   (pushl (@ x8632::ratio.denom (% x)))  ; aka complex.imagpart
    90   (pushl (@ x8632::ratio.denom (% y)))
    91   (movl (@ x8632::ratio.numer (% x)) (% x))       ; aka complex.realpart
    92   (movl (@ x8632::ratio.numer (% y)) (% y))       ; aka complex.realpart
    93   (:talign 5)
    94   (call @top)
    95   (recover-fn)
    96   (cmp-reg-to-nil arg_z)
    97   (pop (% y))
    98   (pop (% x))
    99   (restore-simple-frame)
    100   (jnz @tail)
    101   ;; lose, again
    102   (movl ($ (target-nil-value)) (% arg_z))
    103   (single-value-return)
    104   @bignum
    105   ;; Way back when, we got x's header into imm0.  We know that y's
    106   ;; header is identical.  Use the element-count from imm0 to control
    107   ;; the loop.  There's no such thing as a 0-element bignum, so the
    108   ;; loop must always execute at least once.
    109   (header-length imm0 temp0)
    110   (xor (% temp1) (% temp1))
    111   @bignum-next
    112   (movl (@ x8632::misc-data-offset (% x) (% temp1)) (% imm0))
    113   (cmpl (@ x8632::misc-data-offset (% y) (% temp1)) (% imm0))
    114   (jne @lose)
    115   (addl ($ '1) (% temp1))
    116   (sub ($ '1) (% temp0))
    117   (jnz @bignum-next)
    118   (movl ($ (target-t-value)) (% arg_z))
    119   (single-value-return))
     24  (jmp-subprim .SPbuiltin-eql))
    12025
    12126(defx8632lapfunction equal ((x arg_y) (y arg_z))
  • trunk/source/level-0/X86/x86-pred.lisp

    r13067 r15301  
    2828numbers with the same type and value."
    2929  (check-nargs 2)
    30   @top
    31   @tail
    32   (cmpq (% x) (% y))
    33   (je @win)
    34   (extract-fulltag x imm0)
    35   (extract-fulltag y imm1)
    36   (cmpb (% imm0.b) (% imm1.b))
    37   (jnz @lose)
    38   (cmpb ($ x8664::fulltag-misc) (% imm0.b))
    39   (jnz @lose)
    40   (getvheader x imm0)
    41   (getvheader y imm1)
    42   (cmpb ($ x8664::subtag-macptr) (% imm0.b))
    43   (je @macptr)                          ; will need to check %imm1.b
    44   (cmpq (% imm0) (% imm1))
    45   (jne @lose)
    46   (cmpb ($ x8664::subtag-bignum) (% imm0.b))
    47   (je @bignum)
    48   (cmpb ($ x8664::subtag-double-float) (% imm0.b))
    49   (je @double-float)
    50   (cmpb ($ x8664::subtag-complex) (% imm0.b))
    51   (je @complex)
    52   (cmpb ($ x8664::subtag-ratio) (% imm0.b))
    53   (je @ratio)
    54   @lose
    55   (movq ($ nil) (% arg_z))
    56   (single-value-return)
    57   @macptr
    58   (cmpb ($ x8664::subtag-macptr) (% imm1.b))
    59   (jne @lose)
    60   @double-float
    61   (movq  (@ x8664::misc-data-offset (% x)) (% imm0))
    62   (movq  (@ x8664::misc-data-offset (% y)) (% imm1))
    63   @test
    64   (cmpq (% imm0) (% imm1))
    65   (movl ($ (target-t-value)) (%l imm0))
    66   (lea (@ (- x8664::t-offset) (% imm0)) (% arg_z))
    67   (cmovel (%l imm0) (%l arg_z))
    68   (single-value-return)
    69   @win
    70   (movq ($ t) (% arg_z))
    71   (single-value-return)
    72   @ratio
    73   @complex
    74   (save-simple-frame)
    75   (pushq (@ x8664::ratio.denom (% x)))  ; aka complex.imagpart
    76   (pushq (@ x8664::ratio.denom (% y)))
    77   (movq (@ x8664::ratio.numer (% x)) (% x))       ; aka complex.realpart
    78   (movq (@ x8664::ratio.numer (% y)) (% y))       ; aka complex.realpart
    79   (:talign 3)
    80   (call @top)
    81   (recover-fn-from-rip)
    82   (cmp-reg-to-nil arg_z)
    83   (pop (% y))
    84   (pop (% x))
    85   (restore-simple-frame)
    86   (jnz @tail)
    87   ;; lose, again
    88   (movq ($ nil) (% arg_z))
    89   (single-value-return)
    90   @bignum
    91   ;; Way back when, we got x's header into imm0.  We know that y's
    92   ;; header is identical.  Use the element-count from imm0 to control
    93   ;; the loop.  There's no such thing as a 0-element bignum, so the
    94   ;; loop must always execute at least once.
    95   (header-length imm0 temp0)
    96   (xorq (% imm1) (% imm1))
    97   @bignum-next
    98   (movl (@ x8664::misc-data-offset (% x) (% imm1)) (% imm0.l))
    99   (cmpl (@ x8664::misc-data-offset (% y) (% imm1)) (% imm0.l))
    100   (jne @lose)
    101   (addq ($ 4) (% imm1))
    102   (sub ($ '1) (% temp0))
    103   (jnz @bignum-next)
    104   (movq ($ t) (% arg_z))
    105   (single-value-return))
     30  (jmp-subprim .SPbuiltin-eql))
    10631 
    10732
Note: See TracChangeset for help on using the changeset viewer.