Le 05/05/2026 à 16:49, Peter Zijlstra a écrit :
On Tue, May 05, 2026 at 04:45:39PM +0200, Peter Zijlstra wrote:
On Tue, May 05, 2026 at 02:16:23PM +0530, Sathvika Vasireddy wrote:
switch (opcode) {
+ case 16:
Like case 18 below, this wants a comment describing which instruction
this is; bclr ?
No, it is bc/bca/bcl/bcla, it is quite similar to type 18 which is
b/ba/bl/bla, but that's a conditional branch to a 14-bit offset while
type 18 is a non-conditional branch to a 24-bit offset (10 bits are the
conditional in the bc, hence the reduced offset size).
Also, isn't that typically used for return, suggesting at least
something should have INSN_RETURN on?
bclr (which is the return INSN_RETURN) has type 19
By the way you can have a look at
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/bfa8364da047d8610a09458a1cd924a0566aedbb.1736955567.git.christophe.le...@csgroup.eu/
That patch has all the objtool decoding. By the way objtool is missing a
INSN_CONDITIONAL_RETURN, also see
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/537e5d8f181b1f1c2b8918f1aefa1dba3f972c03.1736955567.git.christophe.le...@csgroup.eu/
+ if (ins & 1)
+ typ = INSN_OTHER;
+ else
+ typ = INSN_JUMP_CONDITIONAL;
+ imm = ins & 0xfffc;
+ if (imm & 0x8000)
+ imm -= 0x10000;
+ insn->immediate = imm | aa;
+ break;
+
case 18: /* b[l][a] */
if (ins == 0x48000005) /* bl .+4 */
typ = INSN_OTHER;