Thread (16 messages) flat view 16 messages, 6 authors, 2021-04-27

Re: [PATCH 1/2] powerpc/sstep: Add emulation support for‘setb’ instruction

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2021-04-21 07:31:10

"Naveen N. Rao" [off-list ref] writes:
Daniel Axtens wrote:
quoted
Sathvika Vasireddy [off-list ref] writes:
quoted
This adds emulation support for the following instruction:
   * Set Boolean (setb)

Signed-off-by: Sathvika Vasireddy <redacted>
...
quoted
If you do end up respinning the patch, I think it would be good to make
the maths a bit clearer. I think it works because a left shift of 2 is
the same as multiplying by 4, but it would be easier to follow if you
used a temporary variable for btf.
Indeed. I wonder if it is better to follow the ISA itself. Per the ISA, 
the bit we are interested in is:
	4 x BFA + 32

So, if we use that along with the PPC_BIT() macro, we get:
	if (regs->ccr & PPC_BIT(ra + 32))
Use of PPC_BIT risks annoying your maintainer :)

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help