Executable definition of fast-logext in the general case.
Function:
(defun fast-logext-exec$inline (b x) (declare (xargs :guard (and (posp b) (integerp x)))) (let ((__function__ 'fast-logext-exec)) (declare (ignorable __function__)) (b* ((x1 (logand (1- (ash 1 b)) x)) (m (ash 1 (- b 1)))) (- (logxor x1 m) m))))
Theorem:
(defthm fast-logext-exec-is-logext (implies (posp b) (equal (fast-logext-exec b x) (logext b x))))