SetALUOp sets the ALUOp on ALU operations. Returns InvalidOpCode if op is of the wrong class.
(alu ALUOp)
| 233 | // |
| 234 | // Returns InvalidOpCode if op is of the wrong class. |
| 235 | func (op OpCode) SetALUOp(alu ALUOp) OpCode { |
| 236 | if !op.Class().IsALU() || !valid(OpCode(alu), aluMask) { |
| 237 | return InvalidOpCode |
| 238 | } |
| 239 | return (op & ^aluMask) | OpCode(alu) |
| 240 | } |
| 241 | |
| 242 | // SetJumpOp sets the JumpOp on jump operations. |
| 243 | // |