mirror of
https://github.com/zachjs/sv2v.git
synced 2026-09-03 08:13:42 +02:00
integer atom explicit sign cast support
This commit is contained in:
@@ -162,4 +162,9 @@ typeSigning :: Type -> Maybe Signing
|
||||
typeSigning (Net _ sg _) = Just sg
|
||||
typeSigning (Implicit sg _) = Just sg
|
||||
typeSigning (IntegerVector _ sg _) = Just sg
|
||||
typeSigning (IntegerAtom t sg ) =
|
||||
Just $ case (sg, t) of
|
||||
(Unspecified, TTime) -> Unsigned
|
||||
(Unspecified, _ ) -> Signed
|
||||
(_ , _ ) -> sg
|
||||
typeSigning _ = Nothing
|
||||
|
||||
@@ -120,10 +120,10 @@ nullRange t rs1 =
|
||||
(tf, rs2) = typeRanges t'
|
||||
|
||||
elaborateIntegerAtom :: Type -> Type
|
||||
elaborateIntegerAtom (IntegerAtom TInt sg) = baseIntType sg Signed 32
|
||||
elaborateIntegerAtom (IntegerAtom TShortint sg) = baseIntType sg Signed 16
|
||||
elaborateIntegerAtom (IntegerAtom TLongint sg) = baseIntType sg Signed 64
|
||||
elaborateIntegerAtom (IntegerAtom TByte sg) = baseIntType sg Unspecified 8
|
||||
elaborateIntegerAtom (IntegerAtom TInt sg) = baseIntType sg Signed 32
|
||||
elaborateIntegerAtom (IntegerAtom TShortint sg) = baseIntType sg Signed 16
|
||||
elaborateIntegerAtom (IntegerAtom TLongint sg) = baseIntType sg Signed 64
|
||||
elaborateIntegerAtom (IntegerAtom TByte sg) = baseIntType sg Signed 8
|
||||
elaborateIntegerAtom other = other
|
||||
|
||||
-- makes a integer "compatible" type with the given signing, base signing and
|
||||
|
||||
Reference in New Issue
Block a user