Closed AlessandroGrassi99 closed 2 years ago
Looks good.
Have you thought about passing op2
by reference?
By doing so could we avoid reassignement?
Looks good.
Have you thought about passing
op2
by reference? By doing so could we avoid reassignement?
I thought about it, but u32 implements Copy, so it doesn't seem a noteworthy advantage to me.
Since the shift operation is used by several instructions, I preferred to separate it from
Data Processing (ALU)
.I made two methods,
shift
andshift_immediate
, the first one performs special operations in case theshift_amount
is0
, the second one performs the shift operation directly.