class NormalLDSTBaseRM(BaseRM):
def specifiers(self, record):
+ # these go in inverse order. calculable as: "8<<(3-width)"
+ # TODO later: fp operations would be ew=fp16 ew=bf16 ew=fp32
widths = {
0b11: "8",
0b10: "16",
(1, 0b111): "ns",
}
+ # predication - single and twin. use "m=" if same otherwise sm/dm
mmode = int(self.mmode)
mask = int(self.mask)
if record.svp64.ptype is _SVPtype.P2:
(smask, dmask) = (int(self.smask), mask)
else:
(smask, dmask) = (mask, mask)
- if all((smask, dmask)) and (smask == dmask):
- yield f"m={predicates[(mmode, smask)]}"
+ if smask == dmask:
+ m = predicates.get((mmode, smask))
+ if m:
+ yield "m="+m
else:
sw = predicates.get((mmode, smask))
dw = predicates.get((mmode, dmask))
if dw:
yield f"dm={dw}"
+ # elwidths: use "w=" if same otherwise dw/sw
dw = int(self.elwidth)
sw = int(self.ewsrc)
if all((dw, sw)) and (dw == sw):
]
self._do_tst(expected)
+ def test_15_predicates(self):
+ expected = [
+ "sv.add./m=r3 *3,*7,*11",
+ "sv.add./m=1<<r3 *3,*7,*11",
+ "sv.add./m=~r10 *3,*7,*11",
+ "sv.add./m=so *3,*7,*11",
+ "sv.add./m=ne *3,*7,*11",
+ "sv.add./m=lt *3,*7,*11",
+ "sv.add. *3,*7,*11",
+ "sv.extsw/m=r30 3,7",
+ "sv.extsw/sm=r30/dm=~r30 3,7",
+ "sv.extsw/sm=gt/dm=eq 3,7",
+ "sv.extsw/sm=~r3 3,7",
+ "sv.extsw/dm=r30 3,7",
+ ]
+ self._do_tst(expected)
+
if __name__ == "__main__":
unittest.main()