mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-11-28 09:23:04 +03:00
Optimize symbolic "extract" to produce literal value if result has width 0
This commit is contained in:
parent
733c7932c5
commit
010d930638
@ -106,6 +106,7 @@ instance SDivisible (SBV BitVector) where
|
||||
extract :: Int -> Int -> SWord -> SWord
|
||||
extract i j x =
|
||||
case x of
|
||||
_ | i < j -> SBV k (Left (CW k (CWInteger 0)))
|
||||
SBV _ (Left cw) ->
|
||||
case cw of
|
||||
CW _ (CWInteger v) -> SBV k (Left (normCW (CW k (CWInteger (v `shiftR` j)))))
|
||||
|
Loading…
Reference in New Issue
Block a user