On Cortex v7M architecture, looking at the T3 and T4 encodings for the B and Bcc instructions in the architecture reference manual...
Do T3 and T4 really have the J bits of the immediate value in the opposite order from one another?
T3 (20 bit immediate value): imm32 = SignExtend(S:J2:J1:imm6:imm11:'0', 32);T4 (24bit immediate value): I1 = NOT(J1 EOR S); I2 = NOT(J2 EOR S); imm32 = SignExtend(S:I1:I2:imm10:imm11:'0', 32);All the references are consistent, but it just seems particularly odd.Is there some more intuitive way to look at the Not(S xor Jn) part of the instructions?
T3 (20 bit immediate value): imm32 = SignExtend(S:J2:J1:imm6:imm11:'0', 32);
T4 (24bit immediate value): I1 = NOT(J1 EOR S); I2 = NOT(J2 EOR S); imm32 = SignExtend(S:I1:I2:imm10:imm11:'0', 32);
T3/T4 encoding applies to all Thumb-2 Cores, means Cortex-A,R and M. So T4 might be used. Still not clear to me, where your problem lies. The encoding of T4 is kind of weird, agree. But I fear, you won't get an answer to the "why" :-)