Changeset 9630

May 30, 2008, 1:56:24 PM (11 years ago)

Avoid a few cases of partial register writes (assignments to the low
16 bits of a register), which can have a surprisingly severe negative
effect on performance. (Catching more cases involves some bootstrapping
of kernel changes from the trunk, to guarantee that "set_nargs()" always
zero-extends the argument count through all bits in the register.)

Make CODE-CHAR return NIL for codes #xFFFE and #xFFFF, which are defined
(along with things in the surrogate-pair range) to be invalid. This
slows down CODE-CHAR a little (obviously), but avoids problems and
keeps higher-level things from having to worry about that.

(Note that (CODE-CHAR (THE CCL::VALID-CHAR-CODE x)) skips this checking
when it's safe to do so.)

1 edited


  • branches/working-0711/ccl/compiler/X86/X8664/x8664-vinsns.lisp

    r9589 r9630  
    441441                                       ((temp :u64)))
    442442  (rcmpw (:%w x8664::nargs) (:$w (:apply ash n x8664::word-shift)))
    443   (movw (:%w x8664::nargs) (:%w temp))
     443  (movzwl (:%w x8664::nargs) (:%l temp))
    444444  (jae :done)
    445445  :loop
    446   (addw (:$w x8664::fixnumone) (:%w temp))
    447   (cmpw (:$w (:apply ash n x8664::word-shift)) (:%w temp))
     446  (addl (:$b x8664::fixnumone) (:%l temp))
     447  ((:pred < n 16)
     448   (cmpl (:$b (:apply ash n x8664::word-shift)) (:%l temp)))
     449  ((:pred >= n 16)
     450   (cmpl (:$l (:apply ash n x8664::word-shift)) (:%l temp)))
    448451  (pushq (:$l x8664::nil-value))
    449452  (jne :loop)
    16401643                             ((n :u16const))
    16411644                             ((imm :u16)))
     1645  (movzwl (:%w x8664::nargs) (:%l x8664::nargs))
    16421646  ((:pred = n 0)
    1643    (xorq (:%q imm) (:%q imm)))
     1647   (xorl (:%l imm) (:%l imm)))
    16441648  ((:not (:pred = n 0))
    1645    (movw (:$w (:apply ash n x8664::fixnumshift)) (:%w imm)))
    1646   (subw (:%w x8664::nargs) (:%w imm))
     1649   (movl (:$l (:apply ash n x8664::fixnumshift)) (:%l imm)))
     1650  (subl (:%l x8664::nargs) (:%l imm))
    16471651  (jae :push-more)
    1648   (movswq (:%w imm) (:%q imm))
     1652  (movslq (:%l imm) (:%q imm))
    16491653  (subq (:%q imm) (:%q x8664::rsp))
    16501654  (jmp :done)
    16511655  :push-loop
    16521656  (pushq (:$l x8664::nil-value))
    1653   (addw (:$b x8664::node-size) (:%w x8664::nargs))
    1654   (subw (:$b x8664::node-size) (:%w imm))
     1657  (addl (:$b x8664::node-size) (:%l x8664::nargs))
     1658  (subl (:$b x8664::node-size) (:%l imm))
    16551659  :push-more
    16561660  (jne :push-loop)
    31923196(define-x8664-vinsn opt-supplied-p (()
    31933197                                    ())
     3198  (movzwl (:%w x8664::nargs) (:%l x8664::nargs))
    31943199  (xorl (:%l x8664::imm1) (:%l x8664::imm1))
    31953200  (movl (:$l x8664::t-value) (:%l x8664::arg_y))
    31963201  :loop
    3197   (rcmpw (:%w x8664::imm1) (:%w x8664::nargs))
     3202  (rcmpl (:%l x8664::imm1) (:%l x8664::nargs))
    31983203  (movl (:$l x8664::nil-value) (:%l x8664::arg_z))
    31993204  (cmovll (:%l x8664::arg_y) (:%l  x8664::arg_z))
    35753580                                  ((temp :u32)))
    35763581  (movl (:%l src) (:%l temp))
    3577   (sarl (:$ub (+ x8664::fixnumshift 11)) (:%l temp))
     3582  (sarl (:$ub (+ x8664::fixnumshift 1)) (:%l temp))
     3583  (cmpl (:$l (ash #xfffe -1)) (:%l temp))
     3584  (je :bad-if-eq)
     3585  (sarl (:$ub (- 11 1)) (:%l temp))
    35783586  (cmpl (:$b (ash #xd800 -11))(:%l temp))
     3587  :bad-if-eq
    35793588  (movl (:$l x8664::nil-value) (:%l temp))
    35803589  (cmovel (:%l temp) (:%l dest))
Note: See TracChangeset for help on using the changeset viewer.