From f7b8795e7384da3c49f4d594b1008d8d23d1d2a8 Mon Sep 17 00:00:00 2001 From: Cesar Strauss Date: Fri, 2 Apr 2021 16:53:32 -0300 Subject: [PATCH] Enforce explicit src/dest masks on CR twin-predication --- src/soc/sv/trans/svp64.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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: -- 2.30.2