core/x86/instr.c
/* PR 251479: support general re-relativization.  If INSTR_RIP_REL_VALID is set and
 * the raw bits are valid, instr->rip_rel_pos is assumed to hold the offset into the
 * instr of a 32-bit rip-relative displacement, which is used to re-relativize during
 * encoding.  We only use this for level 1-3 instrs, and we invalidate it if the raw
 * bits are modified at all.
 * For caching the encoded bytes of a Level 4 instr, instr_encode() sets
 * the rip_rel_pos field and flag without setting the raw bits valid:
 * private_instr_encode() then sets the raw bits, after examing the rip rel flag
 * by itself.  Thus, we must invalidate the rip rel flag when we invalidate
 * raw bits: we can't rely just on the raw bits invalidation.
 * There can only be one rip-relative operand per instruction.
 */
PR 251479: support general re-relativization.  If INSTR_RIP_REL_VALID is set and
the raw bits are valid, instr->rip_rel_pos is assumed to hold the offset into the
instr of a 32-bit rip-relative displacement, which is used to re-relativize during
encoding.  We only use this for level 1-3 instrs, and we invalidate it if the raw
bits are modified at all.
For caching the encoded bytes of a Level 4 instr, instr_encode() sets
the rip_rel_pos field and flag without setting the raw bits valid:
private_instr_encode() then sets the raw bits, after examing the rip rel flag
by itself.  Thus, we must invalidate the rip rel flag when we invalidate
raw bits: we can't rely just on the raw bits invalidation.
There can only be one rip-relative operand per instruction.
PR 251479 : support general re - relativization . If INSTR_RIP_REL_VALID is set and the raw bits are valid instr - > rip_rel_pos is assumed to hold the offset into the instr of a 32 - bit rip - relative displacement which is used to re - relativize during encoding . We only use this for level 1 - 3 instrs and we invalidate it if the raw bits are modified at all . For caching the encoded bytes of a Level 4 instr instr_encode () sets the rip_rel_pos field and flag without setting the raw bits valid : private_instr_encode () then sets the raw bits after examing the rip rel flag by itself . Thus we must invalidate the rip rel flag when we invalidate raw bits : we can ' t rely just on the raw bits invalidation . There can only be one rip - relative operand per instruction .
bool
instr_rip_rel_valid(instr_t *instr)
{
    return instr_raw_bits_valid(instr) && TEST(INSTR_RIP_REL_VALID, instr->flags);
}
bool instr_rip_rel_valid ( instr_t * instr ) { return instr_raw_bits_valid ( instr ) && TEST ( INSTR_RIP_REL_VALID , instr -> flags ) ; }
PR 251479: support general re-relativization.
PR 251479 : support general re - relativization .