1
0
forked from M-Labs/nac3

core/model: add Int not

This commit is contained in:
lyken 2024-08-23 14:53:58 +08:00
parent 2fa3ada445
commit 2d799d13e2
No known key found for this signature in database
GPG Key ID: 3BD5FC6AC8325DD8

View File

@ -340,4 +340,10 @@ impl<'ctx, N: IntKind<'ctx>> Instance<'ctx, Int<N>> {
let value = ctx.builder.build_int_compare(op, self.value, other.value, "").unwrap();
Int(Bool).believe_value(value)
}
#[must_use]
pub fn not(&self, ctx: &CodeGenContext<'ctx, '_>) -> Self {
let value = ctx.builder.build_not(self.value, "").unwrap();
self.model.believe_value(value)
}
}