forked from M-Labs/nac3
1
0
Fork 0

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
1 changed files with 6 additions and 0 deletions

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)
}
}