def qif(mask, ifSeq, elseSeq=None): if elseSeq: return [CmpEq(mask), Goto(label(ifSeq)) ] + elseSeq + [Goto(endlabel(ifSeq))] + ifSeq else: endlabel(ifSeq) return [CmpNeq(mask), Goto(endlabel(ifSeq))] + ifSeq
def qif(mask, ifSeq, elseSeq=None): if elseSeq: endlabel(elseSeq) # make sure to populate label of elseSeq before using it return [CmpEq(mask), Goto(label(ifSeq))] + elseSeq + [Goto(endlabel(ifSeq))] + ifSeq else: endlabel(ifSeq) return [CmpNeq(mask), Goto(endlabel(ifSeq))] + ifSeq
def qif(mask, ifSeq, elseSeq=None): if elseSeq: endlabel( elseSeq) # make sure to populate label of elseSeq before using it return [CmpEq(mask), Goto(label(ifSeq)) ] + elseSeq + [Goto(endlabel(ifSeq))] + ifSeq else: endlabel(ifSeq) return [CmpNeq(mask), Goto(endlabel(ifSeq))] + ifSeq
def qwhile(mask, seq): return [CmpNeq(mask), Goto(endlabel(seq))] + seq