BNDCL

Check Lower Bound

stableVMJITAOTinstruction

Encodings

OpcodeInstructionOp/En64-bitCompat/LegacyDescription
F3 0F 1A /rBNDCL bnd, r/m32RMNot encodableValidGenerate a #BR if the address in r/m32 is lower than the lower bound in bnd.LB.
F3 0F 1A /rBNDCL bnd, r/m64RMValidNot encodableGenerate a #BR if the address in r/m64 is lower than the lower bound in bnd.LB.

Operand encoding

Each mode is a value of the Op/En column above. It says which field of the encoded instruction carries each operand, in the order they are written, and whether the instruction reads it, writes it or both.

RM

  1. modrm.reg escrituraModRM byte, reg field (bits 5-3)
  2. modrm.rm lecturaModRM byte, r/m field (bits 2-0); with the SIB byte and the displacement when the mod field asks for them

Measured cost

Loading measurements from arch-data...

Description

Compare the address in the second operand with the lower bound in bnd. The second operand can be either a register or memory operand. If the address is lower than the lower bound in bnd.LB, it will set BNDSTATUS to 01H and signal a #BR exception.

This instruction does not cause any memory access, and does not read or write any flags.

Operation

BNDCL BND, reg
IF reg < BND.LB Then

    BNDSTATUS := 01H;
    #BR;
FI;

BNDCL BND, mem
TEMP := LEA(mem);
IF TEMP < BND.LB Then

    BNDSTATUS := 01H;
    #BR;
FI;

Intel C/C++ compiler intrinsics

BNDCL void _bnd_chk_ptr_lbounds(const void *q);

Flags affected

None

Exceptions

Protected mode
#BRIf lower bound check fails.
#UDIf the LOCK prefix is used. If ModRM.r/m encodes BND4-BND7 when Intel MPX is enabled. If 67H prefix is not used and CS.D=0. If 67H prefix is used and CS.D=1.
Real address mode
#BRIf lower bound check fails.
#UDIf the LOCK prefix is used. If ModRM.r/m encodes BND4-BND7 when Intel MPX is enabled. If 16-bit addressing is used.
Virtual-8086 mode
#BRIf lower bound check fails.
#UDIf the LOCK prefix is used. If ModRM.r/m encodes BND4-BND7 when Intel MPX is enabled. If 16-bit addressing is used.
Compatibility mode
Same exceptions as in protected mode.
64-bit mode
#UDIf ModRM.r/m and REX encodes BND4-BND15 when Intel MPX is enabled. Same exceptions as in protected mode.

Sources