You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relative branches in Loongarch do not add the value of the immediate to the instruction address so that the target address is encoded in .imm, as occurs in other instructions.
The expected behavior would be for the instruction address (the value 0x1000 above) to be added to the immediate, so that the immediate contains the target address, as occurs in other architectures.
Work environment
pip install capstone==6.0.0a4
Relative branches in Loongarch do not add the value of the immediate to the instruction address so that the target address is encoded in
.imm
, as occurs in other instructions.Actual behavior
Expected behavior
The expected behavior would be for the instruction address (the value
0x1000
above) to be added to the immediate, so that the immediate contains the target address, as occurs in other architectures.An example
je
instruction in x86-64:cstool -d x64 "74 4a" 0x1000 1000 74 4a je 0x104c ID: 260 (je) Prefix:0x00 0x00 0x00 0x00 Opcode:0x74 0x00 0x00 0x00 rex: 0x0 addr_size: 8 modrm: 0x0 disp: 0x0 sib: 0x0 imm_count: 1 imms[1]: 0x104c op_count: 1 operands[0].type: IMM = 0x104c operands[0].size: 8 Registers read: rflags Registers modified: eip EFLAGS: TEST_ZF Groups: branch_relative jump
In this example, the constant offset 0x4c is added to the offset 0x1000 so that the branch target is encoded in the .imm value,
0x104c
.The text was updated successfully, but these errors were encountered: