We want to put "1" in the mask, if the operation is to be performed.
The actual CR bits are: LT, GT, EQ and SO.
So, for those, we just copy the bit directly to the mask, as they are.
For GE, LE, NE and NS, we want to invert the bit first.
with m.Switch(mask):
with m.Case(SVP64PredCR.LT.value):
comb += idx.eq(0)
- comb += invert.eq(1)
+ comb += invert.eq(0)
with m.Case(SVP64PredCR.GE.value):
comb += idx.eq(0)
- comb += invert.eq(0)
+ comb += invert.eq(1)
with m.Case(SVP64PredCR.GT.value):
comb += idx.eq(1)
- comb += invert.eq(1)
+ comb += invert.eq(0)
with m.Case(SVP64PredCR.LE.value):
comb += idx.eq(1)
- comb += invert.eq(0)
+ comb += invert.eq(1)
with m.Case(SVP64PredCR.EQ.value):
comb += idx.eq(2)
- comb += invert.eq(1)
+ comb += invert.eq(0)
with m.Case(SVP64PredCR.NE.value):
comb += idx.eq(1)
- comb += invert.eq(0)
+ comb += invert.eq(1)
with m.Case(SVP64PredCR.SO.value):
comb += idx.eq(3)
- comb += invert.eq(1)
+ comb += invert.eq(0)
with m.Case(SVP64PredCR.NS.value):
comb += idx.eq(3)
- comb += invert.eq(0)
+ comb += invert.eq(1)
return idx, invert