Like logext for 4vecs; the width is also a 4vec.
When
When
Function:
(defun 4vec-sign-ext (n x) (declare (xargs :guard (and (4vec-p n) (4vec-p x)))) (let ((__function__ '4vec-sign-ext)) (declare (ignorable __function__)) (if (and (2vec-p n) (< 0 (2vec->val n))) (if-2vec-p (x) (2vec (fast-logext (2vec->val n) (2vec->val x))) (b* (((4vec x)) (nval (2vec->val n))) (4vec (fast-logext nval x.upper) (fast-logext nval x.lower)))) (4vec-x))))
Theorem:
(defthm 4vec-p-of-4vec-sign-ext (b* ((x-ext (4vec-sign-ext n x))) (4vec-p x-ext)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-sign-ext-of-4vec-fix-n (equal (4vec-sign-ext (4vec-fix n) x) (4vec-sign-ext n x)))
Theorem:
(defthm 4vec-sign-ext-4vec-equiv-congruence-on-n (implies (4vec-equiv n n-equiv) (equal (4vec-sign-ext n x) (4vec-sign-ext n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm 4vec-sign-ext-of-4vec-fix-x (equal (4vec-sign-ext n (4vec-fix x)) (4vec-sign-ext n x)))
Theorem:
(defthm 4vec-sign-ext-4vec-equiv-congruence-on-x (implies (4vec-equiv x x-equiv) (equal (4vec-sign-ext n x) (4vec-sign-ext n x-equiv))) :rule-classes :congruence)