Integer branches of pinned rustc_const_eval interpret/operator.rs.
Layout acquisition and scalar extraction are separate interpreter operations.
These entry points take their checked scalar payload and integer layout;
they do not assert that an arbitrary MIR operand has either property.
- size : ABI.Size
- kind : MIR.IntegerKind
Instances For
Equations
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
Instances For
- scalar : Memory.ScalarInt
- type : IntegerType
Instances For
Equations
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.divisionByZero Miri.Interpreter.IntegerUB.divisionByZero = isTrue ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.divisionByZero (Miri.Interpreter.IntegerUB.arithmeticOverflow op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.divisionByZero (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.remainderByZero Miri.Interpreter.IntegerUB.remainderByZero = isTrue ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.remainderByZero (Miri.Interpreter.IntegerUB.arithmeticOverflow op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.remainderByZero (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.divisionOverflow Miri.Interpreter.IntegerUB.divisionOverflow = isTrue ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.divisionOverflow (Miri.Interpreter.IntegerUB.arithmeticOverflow op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.divisionOverflow (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.remainderOverflow Miri.Interpreter.IntegerUB.remainderOverflow = isTrue ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.remainderOverflow (Miri.Interpreter.IntegerUB.arithmeticOverflow op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq Miri.Interpreter.IntegerUB.remainderOverflow (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.arithmeticOverflow op) Miri.Interpreter.IntegerUB.divisionByZero = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.arithmeticOverflow op) Miri.Interpreter.IntegerUB.remainderByZero = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.arithmeticOverflow op) Miri.Interpreter.IntegerUB.divisionOverflow = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.arithmeticOverflow op) Miri.Interpreter.IntegerUB.remainderOverflow = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.arithmeticOverflow op) (Miri.Interpreter.IntegerUB.shiftOverflow op_1 amount signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) Miri.Interpreter.IntegerUB.divisionByZero = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) Miri.Interpreter.IntegerUB.remainderByZero = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) Miri.Interpreter.IntegerUB.divisionOverflow = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) Miri.Interpreter.IntegerUB.remainderOverflow = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerUB.decEq (Miri.Interpreter.IntegerUB.shiftOverflow op amount signed) (Miri.Interpreter.IntegerUB.arithmeticOverflow op_1) = isFalse ⋯
Instances For
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- scalar (reason : Memory.ScalarIntError) : IntegerOpError
- undefinedBehavior (reason : IntegerUB) : IntegerOpError
- asymmetricTypes (left right : IntegerType) : IntegerOpError
- invalidBinaryOperator (op : MIR.BinOp) : IntegerOpError
- invalidUnaryOperator (op : MIR.UnOp) (signed : Bool) : IntegerOpError
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.scalar a) (Miri.Interpreter.IntegerOpError.scalar b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.scalar reason) (Miri.Interpreter.IntegerOpError.undefinedBehavior reason_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.scalar reason) (Miri.Interpreter.IntegerOpError.asymmetricTypes left right) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.scalar reason) (Miri.Interpreter.IntegerOpError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.scalar reason) (Miri.Interpreter.IntegerOpError.invalidUnaryOperator op signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.undefinedBehavior reason) (Miri.Interpreter.IntegerOpError.scalar reason_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.undefinedBehavior reason) (Miri.Interpreter.IntegerOpError.asymmetricTypes left right) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.undefinedBehavior reason) (Miri.Interpreter.IntegerOpError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.undefinedBehavior reason) (Miri.Interpreter.IntegerOpError.invalidUnaryOperator op signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.asymmetricTypes left right) (Miri.Interpreter.IntegerOpError.scalar reason) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.asymmetricTypes left right) (Miri.Interpreter.IntegerOpError.undefinedBehavior reason) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.asymmetricTypes left right) (Miri.Interpreter.IntegerOpError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.asymmetricTypes left right) (Miri.Interpreter.IntegerOpError.invalidUnaryOperator op signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.invalidBinaryOperator op) (Miri.Interpreter.IntegerOpError.scalar reason) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.invalidBinaryOperator op) (Miri.Interpreter.IntegerOpError.undefinedBehavior reason) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.invalidBinaryOperator op) (Miri.Interpreter.IntegerOpError.asymmetricTypes left right) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.invalidBinaryOperator op) (Miri.Interpreter.IntegerOpError.invalidUnaryOperator op_1 signed) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.invalidUnaryOperator op signed) (Miri.Interpreter.IntegerOpError.scalar reason) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.invalidUnaryOperator op signed) (Miri.Interpreter.IntegerOpError.undefinedBehavior reason) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.invalidUnaryOperator op signed) (Miri.Interpreter.IntegerOpError.asymmetricTypes left right) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerOpError.decEq (Miri.Interpreter.IntegerOpError.invalidUnaryOperator op signed) (Miri.Interpreter.IntegerOpError.invalidBinaryOperator op_1) = isFalse ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
- scalar (value : Memory.ScalarInt) : IntegerResult
- withOverflow (value : Memory.ScalarInt) (overflow : Bool) : IntegerResult
- boolean (value : Bool) : IntegerResult
- ordering (value : Ordering) : IntegerResult
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.scalar a) (Miri.Interpreter.IntegerResult.scalar b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.scalar value) (Miri.Interpreter.IntegerResult.withOverflow value_1 overflow) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.scalar value) (Miri.Interpreter.IntegerResult.boolean value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.scalar value) (Miri.Interpreter.IntegerResult.ordering value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.withOverflow value overflow) (Miri.Interpreter.IntegerResult.scalar value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.withOverflow value overflow) (Miri.Interpreter.IntegerResult.boolean value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.withOverflow value overflow) (Miri.Interpreter.IntegerResult.ordering value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.boolean value) (Miri.Interpreter.IntegerResult.scalar value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.boolean value) (Miri.Interpreter.IntegerResult.withOverflow value_1 overflow) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.boolean a) (Miri.Interpreter.IntegerResult.boolean b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.boolean value) (Miri.Interpreter.IntegerResult.ordering value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.ordering value) (Miri.Interpreter.IntegerResult.scalar value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.ordering value) (Miri.Interpreter.IntegerResult.withOverflow value_1 overflow) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.ordering value) (Miri.Interpreter.IntegerResult.boolean value_1) = isFalse ⋯
- Miri.Interpreter.instDecidableEqIntegerResult.decEq (Miri.Interpreter.IntegerResult.ordering a) (Miri.Interpreter.IntegerResult.ordering b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
@[instance_reducible]
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.Eq l r = do let result ← pure (l == r) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.Ne l r = do let result ← pure (l != r) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.Lt l r = do let result ← pure (decide (l < r)) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.Le l r = do let result ← pure (decide (l ≤ r)) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.Gt l r = do let result ← pure (decide (l > r)) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.Ge l r = do let result ← pure (decide (l ≥ r)) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.BitAnd l r = do let result ← pure (l && r) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.BitOr l r = do let result ← pure (l || r) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
- Miri.Interpreter.IntegerOps.binaryBool Miri.MIR.BinOp.BitXor l r = do let result ← pure (l ^^ r) (fun (result : Bool) => pure (Miri.Interpreter.IntegerResult.boolean result)) result
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Size-checked extraction using the source layout's signedness.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Miri.Interpreter.IntegerOps.computeSizeInBytes
(elementSize : ABI.Size)
(count : UInt64)
(maxSizeOfVal : ABI.Size)
:
Source compute_size_in_bytes checks u64 multiplication and an inclusive
max_size_of_val, which differs from Size.checkedMul's object-size bound.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Miri.Interpreter.IntegerOps.binary_division_by_zero
(left right : IntegerValue)
(l : Int)
(hl : decode left = Except.ok l)
(hr : decode right = Except.ok 0)
(ht : left.type = right.type)
:
Once operand extraction and type agreement have succeeded, division by zero is always UB; wrapping arithmetic never turns it into a successful result.
theorem
Miri.Interpreter.IntegerOps.division_success_nonzero
(left right : IntegerValue)
(l r : Int)
(hl : decode left = Except.ok l)
(hr : decode right = Except.ok r)
(ht : left.type = right.type)
(value : IntegerResult)
(success : binary MIR.BinOp.Div left right = Except.ok value)
: