-
Couldn't load subscription status.
- Fork 64
Open
Description
$ cargo llvm-lines -p rspirv
Lines Copies Function name
----- ------ -------------
434621 (100%) 6861 (100%) (TOTAL)
113962 (26.2%) 1 (0.0%) rspirv::lift::LiftContext::lift_op
I wonder if it would be possible to have all operand matches of all instructions with the same "function signature" be grouped together. Something like:
145u32 | 146u32 => {
let id1 = (match operands.next() {
Some(&dr::Operand::IdRef(ref value)) => Some(*value),
Some(_) => return Err(OperandError::WrongType.into()),
None => None,
}).ok_or(OperandError::Missing)?;
let id2 = (match operands.next() {
Some(&dr::Operand::IdRef(ref value)) => Some(*value),
Some(_) => return Err(OperandError::WrongType.into()),
None => None,
})
.ok_or(OperandError::Missing)?;
match raw.class.opcode as u32 {
145u32 => ops::Op::MatrixTimesVector { matrix: id1, vector: id2 },
146u32 => ops::Op::MatrixTimesMatrix { left_matrix: id1, right_matrix: id2 },
_ => unreachable!(),
}
}instead of
145u32 => Ok(ops::Op::MatrixTimesVector {
matrix: (match operands.next() {
Some(&dr::Operand::IdRef(ref value)) => Some(*value),
Some(_) => return Err(OperandError::WrongType.into()),
None => None,
})
.ok_or(OperandError::Missing)?,
vector: (match operands.next() {
Some(&dr::Operand::IdRef(ref value)) => Some(*value),
Some(_) => return Err(OperandError::WrongType.into()),
None => None,
})
.ok_or(OperandError::Missing)?,
}),
146u32 => Ok(ops::Op::MatrixTimesMatrix {
left_matrix: (match operands.next() {
Some(&dr::Operand::IdRef(ref value)) => Some(*value),
Some(_) => return Err(OperandError::WrongType.into()),
None => None,
})
.ok_or(OperandError::Missing)?,
right_matrix: (match operands.next() {
Some(&dr::Operand::IdRef(ref value)) => Some(*value),
Some(_) => return Err(OperandError::WrongType.into()),
None => None,
})
.ok_or(OperandError::Missing)?,
}),Metadata
Metadata
Assignees
Labels
No labels