# !cr4bits->res1

Update the |X86ISA|::|RES1| field of a cr4bits bit structure.

- Signature
(!cr4bits->res1 res1 x) → new-x

- Arguments
`res1` — Guard (bitp res1).
`x` — Guard (cr4bits-p x).
- Returns
`new-x` — Type (cr4bits-p new-x).

### Definitions and Theorems

**Function: **!cr4bits->res1$inline

(defun !cr4bits->res1$inline (res1 x)
(declare (xargs :guard (and (bitp res1) (cr4bits-p x))))
(mbe
:logic
(b* ((res1 (mbe :logic (bfix res1) :exec res1))
(x (cr4bits-fix x)))
(part-install res1 x :width 1 :low 15))
:exec (the (unsigned-byte 26)
(logior (the (unsigned-byte 26)
(logand (the (unsigned-byte 26) x)
(the (signed-byte 17) -32769)))
(the (unsigned-byte 16)
(ash (the (unsigned-byte 1) res1)
15))))))

**Theorem: **cr4bits-p-of-!cr4bits->res1

(defthm cr4bits-p-of-!cr4bits->res1
(b* ((new-x (!cr4bits->res1$inline res1 x)))
(cr4bits-p new-x))
:rule-classes :rewrite)

**Theorem: **!cr4bits->res1$inline-of-bfix-res1

(defthm !cr4bits->res1$inline-of-bfix-res1
(equal (!cr4bits->res1$inline (bfix res1) x)
(!cr4bits->res1$inline res1 x)))

**Theorem: **!cr4bits->res1$inline-bit-equiv-congruence-on-res1

(defthm !cr4bits->res1$inline-bit-equiv-congruence-on-res1
(implies (bit-equiv res1 res1-equiv)
(equal (!cr4bits->res1$inline res1 x)
(!cr4bits->res1$inline res1-equiv x)))
:rule-classes :congruence)

**Theorem: **!cr4bits->res1$inline-of-cr4bits-fix-x

(defthm !cr4bits->res1$inline-of-cr4bits-fix-x
(equal (!cr4bits->res1$inline res1 (cr4bits-fix x))
(!cr4bits->res1$inline res1 x)))

**Theorem: **!cr4bits->res1$inline-cr4bits-equiv-congruence-on-x

(defthm !cr4bits->res1$inline-cr4bits-equiv-congruence-on-x
(implies (cr4bits-equiv x x-equiv)
(equal (!cr4bits->res1$inline res1 x)
(!cr4bits->res1$inline res1 x-equiv)))
:rule-classes :congruence)

**Theorem: **!cr4bits->res1-is-cr4bits

(defthm !cr4bits->res1-is-cr4bits
(equal (!cr4bits->res1 res1 x)
(change-cr4bits x :res1 res1)))

**Theorem: **cr4bits->res1-of-!cr4bits->res1

(defthm cr4bits->res1-of-!cr4bits->res1
(b* ((?new-x (!cr4bits->res1$inline res1 x)))
(equal (cr4bits->res1 new-x)
(bfix res1))))

**Theorem: **!cr4bits->res1-equiv-under-mask

(defthm !cr4bits->res1-equiv-under-mask
(b* ((?new-x (!cr4bits->res1$inline res1 x)))
(cr4bits-equiv-under-mask new-x x -32769)))