InstructionMask

public final class InstructionMask

A vectorial mask, used to guard vectorial instructions.

Fields

controlInstruction

public Instruction controlInstruction

The control of this mask. Control must be an expression Tree of type (array of) boolean. It is placed in an Instruction to allow all controlled Instructions to share any modification of this control.

enclosingMask

public InstructionMask enclosingMask

The enclosing mask level, if any.

isTrueBranch

public boolean isTrueBranch

When true, this mask designates the “then” where branch of its control, otherwise the “else” where branch.

Constructors

InstructionMask

public InstructionMask(Tree localControl, InstructionMask enclosingMask)

Create a mask level enclosed in enclosingMask, controlled by localControl.

Methods

copy

protected InstructionMask copy()
Returns

a copy of this mask, but the copy shares the controlInstruction.

createElseMask

public InstructionMask createElseMask()
Returns

a copy of this mask, sharing the controlInstruction, but designating the “else” branch.

depth

public int depth()
Returns

the depth of the enclosing mask levels.

dump

public void dump()

Prints in detail the contents of this InstructionMask, onto TapEnv.curOutputStream().

equalMasks

public static boolean equalMasks(InstructionMask mask1, InstructionMask mask2)

getControlTree

public Tree getControlTree()
Returns

the control Tree of this mask.

isEmpty

public boolean isEmpty()
Returns

true if this mask level is empty i.e. has no control.

rebuildTree

public Tree rebuildTree()

setControlTree

public void setControlTree(Tree tree)

Sets the control Tree of this mask.

toString

public String toString()