Raymond Toy pushed to branch issue-283-unsigned-integer-length-vop at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/compiler/x86/arith.lisp
    ... ... @@ -765,10 +765,12 @@
    765 765
       (:result-types positive-fixnum)
    
    766 766
       (:generator 30
    
    767 767
         (move res arg)
    
    768
    -    ;; BSR is undefined if the source is 0, so check for that here.
    
    769
    -    (inst cmp res 0)
    
    770
    -    (inst jmp :eq DONE)
    
    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.
    
    771 772
         (inst bsr res res)
    
    773
    +    (inst jmp :z DONE)
    
    772 774
         ;; The result of BSR is one too small for what we want, so
    
    773 775
         ;; increment the result.
    
    774 776
         (inst inc res)