Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/compiler/x86/arith.lisp
    ... ... @@ -755,6 +755,28 @@
    755 755
         (inst xor res res)
    
    756 756
         DONE))
    
    757 757
     
    
    758
    +(define-vop (unsigned-byte-32-len)
    
    759
    +  (:translate integer-length)
    
    760
    +  (:note _N"inline (unsigned-byte 32) integer-length")
    
    761
    +  (:policy :fast-safe)
    
    762
    +  (:args (arg :scs (unsigned-reg)))
    
    763
    +  (:arg-types unsigned-num)
    
    764
    +  (:results (res :scs (any-reg)))
    
    765
    +  (:result-types positive-fixnum)
    
    766
    +  (:generator 30
    
    767
    +    (move res arg)
    
    768
    +    ;; The Intel docs say that BSR leaves the destination register
    
    769
    +    ;; undefined if the source is 0.  But AMD64 says the destination
    
    770
    +    ;; register is unchanged.  This also appears to be the case for
    
    771
    +    ;; GCC and LLVM.
    
    772
    +    (inst bsr res res)
    
    773
    +    (inst jmp :z DONE)
    
    774
    +    ;; The result of BSR is one too small for what we want, so
    
    775
    +    ;; increment the result.
    
    776
    +    (inst inc res)
    
    777
    +    (inst shl res 2)
    
    778
    +    DONE))
    
    779
    +
    
    758 780
     (define-vop (unsigned-byte-32-count)
    
    759 781
       (:translate logcount)
    
    760 782
       (:note _N"inline (unsigned-byte 32) logcount")
    

  • src/i18n/locale/cmucl-x86-vm.pot
    ... ... @@ -296,6 +296,10 @@ msgstr ""
    296 296
     msgid "inline (signed-byte 32) integer-length"
    
    297 297
     msgstr ""
    
    298 298
     
    
    299
    +#: src/compiler/x86/arith.lisp
    
    300
    +msgid "inline (unsigned-byte 32) integer-length"
    
    301
    +msgstr ""
    
    302
    +
    
    299 303
     #: src/compiler/x86/arith.lisp
    
    300 304
     msgid "inline (unsigned-byte 32) logcount"
    
    301 305
     msgstr ""