From: Cesar Strauss Date: Fri, 2 Apr 2021 19:53:32 +0000 (-0300) Subject: Enforce explicit src/dest masks on CR twin-predication X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7b8795e7384da3c49f4d594b1008d8d23d1d2a8;p=soc.git Enforce explicit src/dest masks on CR twin-predication --- diff --git a/src/soc/sv/trans/svp64.py b/src/soc/sv/trans/svp64.py index 37d5abee..a28f94cd 100644 --- a/src/soc/sv/trans/svp64.py +++ b/src/soc/sv/trans/svp64.py @@ -491,6 +491,15 @@ class SVP64Asm: "cannot have both source-mask and predicate mask" assert not has_pmask,\ "cannot have both dest-mask and predicate mask" + # since the default is INT predication (ALWAYS), if you + # specify one CR mask, you must specify both, to avoid + # mixing INT and CR reg types + if has_pmask and pmmode == 1: + assert has_smask, \ + "need explicit source-mask in CR twin predication" + if has_smask and smmode == 1: + assert has_pmask, \ + "need explicit dest-mask in CR twin predication" # sanity-check that 2Pred mask is same mode if (has_pmask and has_smask) or mask_m_specified: