Skip to content

buffer.compare.address

← buffer dialect

Compare two byte positions without exposing their addresses. Each nonnull buffer must be live and its selected position must be in bounds or at the one-past endpoint. Signed index positions may precede an interior origin; offset positions remain nonnegative. A null buffer permits only position zero and differs from every nonnull buffer, including empty storage. Aliased buffers compare by their selected positions, not wrapper identity. An empty root without native storage retains a distinct logical position shared by its subspans. The operation reads no payload bytes and changes no ownership.

Operation contract

Property Value
Semantic phase executable
Traits Pure
Ownership effects borrow lhs (by_value), borrow rhs (by_value)

Signature

Kind Name Type Cardinality Description
Operand lhs buffer required Left storage reference.
Operand lhs_offset address required Left byte position.
Operand rhs buffer required Right storage reference.
Operand rhs_offset address required Right byte position.
Result result i1 required Result of the selected predicate.
Attribute predicate enum BufferAddressPredicate required —

Examples

%done = buffer.compare.address eq, %cursor[%position], %end[%limit]
%more = buffer.compare.address ne, %cursor[%position], %end[%limit]