Changeset 8553


Ignore:
Timestamp:
Feb 21, 2008, 7:38:50 PM (12 years ago)
Author:
rme
Message:

Use a better (shorter/clearer) instruction sequence for getting the 1/0
from a bit vector into a fixnum result.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8664/x8664-vinsns.lisp

    r8549 r8553  
    21562156                                            ())
    21572157  (btq (:%q bitnum) (:@ x8664::misc-data-offset (:%q bitvector)))
    2158   (setb (:%b bitnum))
    2159   (negb (:%b bitnum))
    2160   (andl (:$l x8664::fixnumone) (:%l bitnum))
    2161   (movl (:%l bitnum) (:%l dest)))                                       
     2158  (setc (:%b bitnum))
     2159  (movzbl (:%b bitnum) (:%l bitnum))
     2160  (imull (:$b x8664::fixnumone) (:%l bitnum) (:%l dest)))
    21622161                                                     
    21632162(define-x8664-vinsn misc-ref-c-bit-fixnum (((dest :imm))
     
    21672166  (btq (:$ub (:apply logand 63 idx))
    21682167       (:@ (:apply + x8664::misc-data-offset (:apply ash (:apply ash idx -6) x8664::word-shift)) (:%q src)))
    2169   (setb (:%b temp))
    2170   (negb (:%b temp))
    2171   (andl (:$l x8664::fixnumone) (:%l temp))
    2172   (movl (:%l temp) (:%l dest)))
     2168  (setc (:%b temp))
     2169  (movzbl (:%b temp) (:%l temp))
     2170  (imull (:$b x8664::fixnumone) (:%l temp) (:%l dest)))
    21732171
    21742172(define-x8664-vinsn deref-macptr (((addr :address))
  • trunk/source/lisp-kernel/x86-spentry64.s

    r8547 r8553  
    560560        __(btq %imm0,misc_data_offset(%arg_y))
    561561        __(setc %imm0_b)
    562         __(negb %imm0_b)
    563         __(andl $fixnum_one,%imm0_l)
    564         __(movq %imm0,%arg_z)
     562        __(movzbl %imm0_b,%imm0_l)
     563        __(imull $fixnumone,%imm0_l,%arg_z_l)
    565564        __(ret)
    566565local_label(misc_ref_invalid):
Note: See TracChangeset for help on using the changeset viewer.