Changeset 7967


Ignore:
Timestamp:
Dec 30, 2007, 1:38:01 AM (12 years ago)
Author:
gb
Message:

Need %STRING-HASH for PPC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-0/PPC/ppc-symbol.lisp

    r5389 r7967  
    152152    (srri arg_z accum (- 5 target::fixnumshift))
    153153    (blr)))
     154
     155(defppclapfunction %string-hash ((start arg_x) (str arg_y) (len arg_z))
     156  (let ((nextw imm1)
     157        (accum imm0)
     158        (offset imm2))
     159    (cmpwi cr0 len 0)
     160    #+32-bit-target
     161    (la offset target::misc-data-offset start)
     162    #+64-bit-target
     163    (progn
     164      (srwi offset start 1)
     165      (la offset target::misc-data-offset offset))
     166    (li accum 0)
     167    (beqlr- cr0)   
     168    @loop
     169    (cmpri cr1 len '1)
     170    (subi len len '1)
     171    (lwzx nextw str offset)
     172    (addi offset offset 4)
     173    (rotlwi accum accum 5)
     174    (xor accum accum nextw)
     175    (bne cr1 @loop)
     176    (slri accum accum 5)
     177    (srri arg_z accum (- 5 target::fixnumshift))
     178    (blr)))
Note: See TracChangeset for help on using the changeset viewer.