CompactedLanes<LogicType extends Logic> constructor
- TypedLogicArray<
LogicType, LogicValue> lanes, { - required int countWidth,
- String? name,
Creates a compacted lane payload.
Implementation
CompactedLanes(
TypedLogicArray<LogicType, LogicValue> lanes, {
required this.countWidth,
String? name,
}) : laneCount = lanes.arrayElements.length,
super(
[
lanes,
Logic(name: 'validCount', width: countWidth),
Logic(name: 'consumedMask', width: lanes.arrayElements.length),
],
name: name ?? '${lanes.name}_compacted',
) {
if (lanes.dimensions.length != 1 || countWidth < widthFor(laneCount + 1)) {
throw ArgumentError(
'Lanes must be one-dimensional and countWidth must represent every '
'valid lane count.',
);
}
}