• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
      • 100-theorems
      • Arithmetic
      • Bit-vectors
        • Sparseint
        • Bitops
          • Bitops/merge
          • Bitops-compatibility
          • Bitops-books
          • Logbitp-reasoning
          • Bitops/signed-byte-p
          • Fast-part-select
          • Bitops/integer-length
          • Bitops/extra-defs
          • Install-bit
          • Trailing-0-count
          • Bitops/defaults
          • Logbitp-mismatch
          • Trailing-1-count
          • Bitops/rotate
          • Bitops/equal-by-logbitp
          • Bitops/ash-bounds
          • Bitops/fast-logrev
          • Limited-shifts
          • Bitops/part-select
          • Bitops/parity
          • Bitops/saturate
          • Bitops/part-install
          • Bitops/logbitp-bounds
          • Bitops/ihsext-basics
          • Bitops/fast-rotate
          • Bitops/fast-logext
            • Fast-logext
              • Fast-logext-exec
              • Fast-logext64
                • Fast-logext16
                • Fast-logext8
                • Fast-logext32
                • Fast-logext-fn
            • Bitops/ihs-extensions
          • Bv
          • Ihs
          • Rtl
        • Algebra
      • Testing-utilities
    • Fast-logext

    Fast-logext64

    Optimized implementation of 64-bit sign-extension.

    Signature
    (fast-logext64 x) → *
    Arguments
    x — Guard (integerp x).

    Definitions and Theorems

    Function: fast-logext64$inline

    (defun fast-logext64$inline (x)
     (declare (xargs :guard (integerp x)))
     (let ((__function__ 'fast-logext64))
       (declare (ignorable __function__))
       (mbe :logic (logext 64 x)
            :exec
            (if (and (<= x 1152921504606846975)
                     (<= -1152921504606846976 x))
                x
              (the (signed-byte 64)
                   (- (the (unsigned-byte 64)
                           (logxor (the (unsigned-byte 64)
                                        (logand 18446744073709551615 x))
                                   (the (unsigned-byte 64)
                                        9223372036854775808)))
                      9223372036854775808))))))